File: ip.h

package info (click to toggle)
ipgrab 0.5-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 268 kB
  • ctags: 169
  • sloc: sh: 1,507; ansic: 1,234; makefile: 56
file content (34 lines) | stat: -rw-r--r-- 748 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**************************************************************************** 
** File: ip.h
**
** Author: Mike Borella
**
** Comments: Generic IP header structure - an attempt at OS independence
**
*****************************************************************************/

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

typedef struct _IPHdr
{
#if defined(WORDS_BIGENDIAN)
  u_int8_t    ip_v:4, 
              ip_hl:4;
#else
  u_int8_t    ip_hl:4, 
              ip_v:4;
#endif
  u_int8_t    ip_tos;
  u_int16_t   ip_len;
  u_int16_t   ip_id;
  u_int16_t   ip_off;
  u_int8_t    ip_ttl;
  u_int8_t    ip_p;
  u_int16_t   ip_csum;
  struct in_addr   ip_src;
  struct in_addr   ip_dst;
} IPHdr;