2 * Netgrind -- The Network Traffic Analyser
4 * (c) 2003 Martin Mares <mj@ucw.cz>
6 * This software may be freely distributed and used according to the terms
7 * of the GNU General Public License.
12 extern struct pkt_stats stat_link_dwarf, stat_link_in, stat_link_unknown, stat_link_arp;
14 void link_eth_got_packet(struct pkt *p);
18 extern struct pkt_stats stat_ip_in, stat_ip_invalid, stat_ip_uninteresting, stat_ip_fragmented, stat_ip_badsum;
20 uns tcpip_calc_checksum(void *data, uns len, uns csum);
21 uns tcpip_verify_checksum(uns csum);
22 void ip_got_packet(struct pkt *p);
26 extern struct pkt_stats stat_tcp_in, stat_tcp_invalid, stat_tcp_badsum, stat_tcp_unmatched,
30 list queue; /* incoming packets */
31 u32 last_acked_seq; /* last sequence number for which I sent ACK */
32 u32 syn_or_fin_seq; /* sequence number of SYN/FIN I sent */
33 enum { /* very simplified TCP state machine */
35 FLOW_SYN_SENT, /* sent SYN, waiting for SYN ACK */
36 FLOW_SYN_SENT_ACK, /* sent SYN ACK, waiting for first ACK */
37 FLOW_ESTABLISHED, /* established state including waiting for ACK of SYN ACK */
38 FLOW_FIN_SENT, /* sent FIN, waiting for its ACK */
39 FLOW_FINISHED /* closed, ignoring further packets */
41 struct pkt_stats stat_in;
45 struct flow *hash_next;
46 u32 saddr, daddr, sport, dport;
49 struct appl_hooks *appl;
62 void (*open)(struct flow *f, u64 when);
63 void (*input)(struct flow *f, int dir, struct pkt *p); /* dir0 = sent by initiator */
64 void (*close)(struct flow *f, int cause, u64 when);
70 void tcp_cleanup(void);
71 void tcp_got_packet(struct iphdr *iph, struct pkt *p);
75 extern struct appl_hooks appl_save, appl_asave;
76 extern uns asave_width;