indent dump_dns.c
[prads.git] / src / cxt.h
blobb612959afcc026dd358f9408e231527d5f665111
1 #ifndef CXT_H
2 #define CXT_H
4 #define CXT_HASH4(src,dst) \
5 ((src + dst) % BUCKET_SIZE)
7 #ifndef OSX
8 #define CXT_HASH6(src,dst) \
9 (( \
10 (src)->s6_addr32[0] + (src)->s6_addr32[1] + \
11 (src)->s6_addr32[2] + (src)->s6_addr32[3] + \
12 (dst)->s6_addr32[0] + (dst)->s6_addr32[1] + \
13 (dst)->s6_addr32[2] + (dst)->s6_addr32[3] \
14 ) % BUCKET_SIZE)
15 #else
16 #define CXT_HASH6(src,dest) \
17 (( \
18 (src)->__u6_addr.__u6_addr32[0] + (src)->__u6_addr.__u6_addr32[1] + \
19 (src)->__u6_addr.__u6_addr32[2] + (src)->__u6_addr.__u6_addr32[3] + \
20 (dst)->__u6_addr.__u6_addr32[0] + (dst)->__u6_addr.__u6_addr32[1] + \
21 (dst)->__u6_addr.__u6_addr32[2] + (dst)->__u6_addr.__u6_addr32[3] \
22 ) % BUCKET_SIZE)
23 #endif
25 enum { CX_NONE, CX_HUMAN, CX_NEW, CX_ENDED, CX_EXPIRE };
26 void end_sessions();
27 void cxt_init();
28 int cx_track(packetinfo *pi);
29 /*struct in6_addr *ip_src, uint16_t src_port,
30 struct in6_addr *ip_dst, uint16_t dst_port, uint8_t ip_proto,
31 uint16_t p_bytes, uint8_t tcpflags, time_t tstamp, int af);
33 void del_connection(connection *, connection **);
34 void cxt_write(connection *, FILE *fd, int human);
35 void cxt_write_all();
37 int connection_tracking(packetinfo *pi);
38 #endif // CXT_H