capt_get_packet(): check for key press only every 20ms
[iptraf-ng.git] / src / ipfrag.h
blob6a0bc850c8e566a2ed17ab779ab06e7c47e13885
1 #ifndef IPTRAF_NG_IPFRAG_H
2 #define IPTRAF_NG_IPFRAG_H
4 /***
6 ipfrag.h - IP fragmentation hander definitions
8 ***/
10 static inline unsigned int ipv4_frag_offset(struct iphdr *ip)
12 return (ntohs(ip->frag_off) & 0x1fff) * 8;
15 static inline int ipv4_is_first_fragment(struct iphdr *ip)
17 return (ntohs(ip->frag_off) & 0x1fff) == 0;
20 static inline int ipv4_is_fragmented(struct iphdr *ip)
22 return (ntohs(ip->frag_off) & 0x3fff) != 0;
25 static inline int ipv4_more_fragments(struct iphdr *ip)
27 return (ntohs(ip->frag_off) & 0x2000) != 0;
30 void destroyfraglist(void);
31 unsigned int processfragment(struct iphdr *packet, in_port_t *sport,
32 in_port_t *dport, int *firstin);
34 #endif /* IPTRAF_NG_IPFRAG_H */