Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

ip.h File Reference

Go to the source code of this file.

Defines

#define IP_ADDR_LEN   4
#define IP_ADDR_BITS   32
#define IP_HDR_LEN   20
#define IP_OPT_LEN   2
#define IP_OPT_LEN_MAX   40
#define IP_HDR_LEN_MAX   (IP_HDR_LEN + IP_OPT_LEN_MAX)
#define IP_LEN_MAX   65535
#define IP_LEN_MIN   IP_HDR_LEN
#define __attribute__(x)
#define IP_TOS_DEFAULT   0x00
#define IP_TOS_LOWDELAY   0x10
#define IP_TOS_THROUGHPUT   0x08
#define IP_TOS_RELIABILITY   0x04
#define IP_TOS_LOWCOST   0x02
#define IP_TOS_ECT   0x02
#define IP_TOS_CE   0x01
#define IP_TOS_PREC_ROUTINE   0x00
#define IP_TOS_PREC_PRIORITY   0x20
#define IP_TOS_PREC_IMMEDIATE   0x40
#define IP_TOS_PREC_FLASH   0x60
#define IP_TOS_PREC_FLASHOVERRIDE   0x80
#define IP_TOS_PREC_CRITIC_ECP   0xa0
#define IP_TOS_PREC_INTERNETCONTROL   0xc0
#define IP_TOS_PREC_NETCONTROL   0xe0
#define IP_RF   0x8000
#define IP_DF   0x4000
#define IP_MF   0x2000
#define IP_OFFMASK   0x1fff
#define IP_TTL_DEFAULT   64
#define IP_TTL_MAX   255
#define IP_PROTO_IP   0
#define IP_PROTO_HOPOPTS   IP_PROTO_IP
#define IP_PROTO_ICMP   1
#define IP_PROTO_IGMP   2
#define IP_PROTO_GGP   3
#define IP_PROTO_IPIP   4
#define IP_PROTO_ST   5
#define IP_PROTO_TCP   6
#define IP_PROTO_CBT   7
#define IP_PROTO_EGP   8
#define IP_PROTO_IGP   9
#define IP_PROTO_BBNRCC   10
#define IP_PROTO_NVP   11
#define IP_PROTO_PUP   12
#define IP_PROTO_ARGUS   13
#define IP_PROTO_EMCON   14
#define IP_PROTO_XNET   15
#define IP_PROTO_CHAOS   16
#define IP_PROTO_UDP   17
#define IP_PROTO_MUX   18
#define IP_PROTO_DCNMEAS   19
#define IP_PROTO_HMP   20
#define IP_PROTO_PRM   21
#define IP_PROTO_IDP   22
#define IP_PROTO_TRUNK1   23
#define IP_PROTO_TRUNK2   24
#define IP_PROTO_LEAF1   25
#define IP_PROTO_LEAF2   26
#define IP_PROTO_RDP   27
#define IP_PROTO_IRTP   28
#define IP_PROTO_TP   29
#define IP_PROTO_NETBLT   30
#define IP_PROTO_MFPNSP   31
#define IP_PROTO_MERITINP   32
#define IP_PROTO_SEP   33
#define IP_PROTO_3PC   34
#define IP_PROTO_IDPR   35
#define IP_PROTO_XTP   36
#define IP_PROTO_DDP   37
#define IP_PROTO_CMTP   38
#define IP_PROTO_TPPP   39
#define IP_PROTO_IL   40
#define IP_PROTO_IPV6   41
#define IP_PROTO_SDRP   42
#define IP_PROTO_ROUTING   43
#define IP_PROTO_FRAGMENT   44
#define IP_PROTO_RSVP   46
#define IP_PROTO_GRE   47
#define IP_PROTO_MHRP   48
#define IP_PROTO_ENA   49
#define IP_PROTO_ESP   50
#define IP_PROTO_AH   51
#define IP_PROTO_INLSP   52
#define IP_PROTO_SWIPE   53
#define IP_PROTO_NARP   54
#define IP_PROTO_MOBILE   55
#define IP_PROTO_TLSP   56
#define IP_PROTO_SKIP   57
#define IP_PROTO_ICMPV6   58
#define IP_PROTO_NONE   59
#define IP_PROTO_DSTOPTS   60
#define IP_PROTO_ANYHOST   61
#define IP_PROTO_CFTP   62
#define IP_PROTO_ANYNET   63
#define IP_PROTO_EXPAK   64
#define IP_PROTO_KRYPTOLAN   65
#define IP_PROTO_RVD   66
#define IP_PROTO_IPPC   67
#define IP_PROTO_DISTFS   68
#define IP_PROTO_SATMON   69
#define IP_PROTO_VISA   70
#define IP_PROTO_IPCV   71
#define IP_PROTO_CPNX   72
#define IP_PROTO_CPHB   73
#define IP_PROTO_WSN   74
#define IP_PROTO_PVP   75
#define IP_PROTO_BRSATMON   76
#define IP_PROTO_SUNND   77
#define IP_PROTO_WBMON   78
#define IP_PROTO_WBEXPAK   79
#define IP_PROTO_EON   80
#define IP_PROTO_VMTP   81
#define IP_PROTO_SVMTP   82
#define IP_PROTO_VINES   83
#define IP_PROTO_TTP   84
#define IP_PROTO_NSFIGP   85
#define IP_PROTO_DGP   86
#define IP_PROTO_TCF   87
#define IP_PROTO_EIGRP   88
#define IP_PROTO_OSPF   89
#define IP_PROTO_SPRITERPC   90
#define IP_PROTO_LARP   91
#define IP_PROTO_MTP   92
#define IP_PROTO_AX25   93
#define IP_PROTO_IPIPENCAP   94
#define IP_PROTO_MICP   95
#define IP_PROTO_SCCSP   96
#define IP_PROTO_ETHERIP   97
#define IP_PROTO_ENCAP   98
#define IP_PROTO_ANYENC   99
#define IP_PROTO_GMTP   100
#define IP_PROTO_IFMP   101
#define IP_PROTO_PNNI   102
#define IP_PROTO_PIM   103
#define IP_PROTO_ARIS   104
#define IP_PROTO_SCPS   105
#define IP_PROTO_QNX   106
#define IP_PROTO_AN   107
#define IP_PROTO_IPCOMP   108
#define IP_PROTO_SNP   109
#define IP_PROTO_COMPAQPEER   110
#define IP_PROTO_IPXIP   111
#define IP_PROTO_VRRP   112
#define IP_PROTO_PGM   113
#define IP_PROTO_ANY0HOP   114
#define IP_PROTO_L2TP   115
#define IP_PROTO_DDX   116
#define IP_PROTO_IATP   117
#define IP_PROTO_STP   118
#define IP_PROTO_SRP   119
#define IP_PROTO_UTI   120
#define IP_PROTO_SMP   121
#define IP_PROTO_SM   122
#define IP_PROTO_PTP   123
#define IP_PROTO_ISIS   124
#define IP_PROTO_FIRE   125
#define IP_PROTO_CRTP   126
#define IP_PROTO_CRUDP   127
#define IP_PROTO_SSCOPMCE   128
#define IP_PROTO_IPLT   129
#define IP_PROTO_SPS   130
#define IP_PROTO_PIPE   131
#define IP_PROTO_SCTP   132
#define IP_PROTO_FC   133
#define IP_PROTO_RSVPIGN   134
#define IP_PROTO_RAW   255
#define IP_PROTO_RESERVED   IP_PROTO_RAW
#define IP_PROTO_MAX   255
#define IP_OPT_CONTROL   0x00
#define IP_OPT_DEBMEAS   0x40
#define IP_OPT_COPY   0x80
#define IP_OPT_RESERVED1   0x20
#define IP_OPT_RESERVED2   0x60
#define IP_OPT_EOL   0
#define IP_OPT_NOP   1
#define IP_OPT_SEC   (2|IP_OPT_COPY)
#define IP_OPT_LSRR   (3|IP_OPT_COPY)
#define IP_OPT_TS   (4|IP_OPT_DEBMEAS)
#define IP_OPT_ESEC   (5|IP_OPT_COPY)
#define IP_OPT_CIPSO   (6|IP_OPT_COPY)
#define IP_OPT_RR   7
#define IP_OPT_SATID   (8|IP_OPT_COPY)
#define IP_OPT_SSRR   (9|IP_OPT_COPY)
#define IP_OPT_ZSU   10
#define IP_OPT_MTUP   11
#define IP_OPT_MTUR   12
#define IP_OPT_FINN   (13|IP_OPT_COPY|IP_OPT_DEBMEAS)
#define IP_OPT_VISA   (14|IP_OPT_COPY)
#define IP_OPT_ENCODE   15
#define IP_OPT_IMITD   (16|IP_OPT_COPY)
#define IP_OPT_EIP   (17|IP_OPT_COPY)
#define IP_OPT_TR   (18|IP_OPT_DEBMEAS)
#define IP_OPT_ADDEXT   (19|IP_OPT_COPY)
#define IP_OPT_RTRALT   (20|IP_OPT_COPY)
#define IP_OPT_SDB   (21|IP_OPT_COPY)
#define IP_OPT_NSAPA   (22|IP_OPT_COPY)
#define IP_OPT_DPS   (23|IP_OPT_COPY)
#define IP_OPT_UMP   (24|IP_OPT_COPY)
#define IP_OPT_MAX   25
#define IP_OPT_COPIED(o)   ((o) & 0x80)
#define IP_OPT_CLASS(o)   ((o) & 0x60)
#define IP_OPT_NUMBER(o)   ((o) & 0x1f)
#define IP_OPT_TYPEONLY(o)   ((o) == IP_OPT_EOL || (o) == IP_OPT_NOP)
#define IP_OPT_SEC_UNCLASS   0x0000
#define IP_OPT_SEC_CONFID   0xf135
#define IP_OPT_SEC_EFTO   0x789a
#define IP_OPT_SEC_MMMM   0xbc4d
#define IP_OPT_SEC_PROG   0x5e26
#define IP_OPT_SEC_RESTR   0xaf13
#define IP_OPT_SEC_SECRET   0xd788
#define IP_OPT_SEC_TOPSECRET   0x6bc5
#define IP_OPT_TS_TSONLY   0
#define IP_OPT_TS_TSADDR   1
#define IP_OPT_TS_PRESPEC   3
#define IP_CLASSA(i)
#define IP_CLASSA_NET   (htonl(0xff000000))
#define IP_CLASSA_NSHIFT   24
#define IP_CLASSA_HOST   (htonl(0x00ffffff))
#define IP_CLASSA_MAX   128
#define IP_CLASSB(i)
#define IP_CLASSB_NET   (htonl(0xffff0000))
#define IP_CLASSB_NSHIFT   16
#define IP_CLASSB_HOST   (htonl(0x0000ffff))
#define IP_CLASSB_MAX   65536
#define IP_CLASSC(i)
#define IP_CLASSC_NET   (htonl(0xffffff00))
#define IP_CLASSC_NSHIFT   8
#define IP_CLASSC_HOST   (htonl(0x000000ff))
#define IP_CLASSD(i)
#define IP_CLASSD_NET   (htonl(0xf0000000))
#define IP_CLASSD_NSHIFT   28
#define IP_CLASSD_HOST   (htonl(0x0fffffff))
#define IP_MULTICAST(i)   IP_CLASSD(i)
#define IP_EXPERIMENTAL(i)
#define IP_BADCLASS(i)
#define IP_LOCAL_GROUP(i)
#define IP_ADDR_ANY   (htonl(0x00000000))
#define IP_ADDR_BROADCAST   (htonl(0xffffffff))
#define IP_ADDR_LOOPBACK   (htonl(0x7f000001))
#define IP_ADDR_MCAST_ALL   (htonl(0xe0000001))
#define IP_ADDR_MCAST_LOCAL   (htonl(0xe00000ff))
#define ip_pack_hdr(hdr, tos, len, id, off, ttl, p, src, dst)
#define ip_aton   ip_pton
#define ip_cksum_carry(x)   (x = (x >> 16) + (x & 0xffff), (~(x + (x >> 16)) & 0xffff))

Typedefs

typedef uint32_t ip_addr_t
typedef ip_handle ip_t

Functions

__BEGIN_DECLS ip_tip_open (void)
ssize_t ip_send (ip_t *i, const void *buf, size_t len)
ip_tip_close (ip_t *i)
char * ip_ntop (const ip_addr_t *ip, char *dst, size_t len)
int ip_pton (const char *src, ip_addr_t *dst)
char * ip_ntoa (const ip_addr_t *ip)
ssize_t ip_add_option (void *buf, size_t len, int proto, const void *optbuf, size_t optlen)
void ip_checksum (void *buf, size_t len)
int ip_cksum_add (const void *buf, size_t len, int cksum)

Variables

ip_opt_data_sec __packed__


Define Documentation

#define __attribute__  ) 
 

Definition at line 28 of file ip.h.

#define IP_ADDR_ANY   (htonl(0x00000000))
 

Definition at line 396 of file ip.h.

Referenced by arp_add(), arp_delete(), route_delete(), route_get(), route_loop(), and route_msg().

#define IP_ADDR_BITS   32
 

Definition at line 15 of file ip.h.

Referenced by addr_bcast(), addr_btom(), addr_btos(), addr_net(), addr_ntop(), addr_pton(), addr_ston(), arp_loop(), ip_ntoa(), ip_send(), route_get(), route_loop(), route_main(), route_msg(), START_TEST(), and tun_open().

#define IP_ADDR_BROADCAST   (htonl(0xffffffff))
 

Definition at line 397 of file ip.h.

Referenced by arp_add().

#define IP_ADDR_LEN   4
 

Definition at line 14 of file ip.h.

Referenced by _ifrow_to_entry(), addr_bcast(), addr_btom(), addr_btos(), addr_net(), addr_pton(), addr_stob(), arp_main(), fr_to_fwc(), fr_to_ipfw(), fr_to_pr(), fwc_to_fr(), intf_set(), ip_ntoa(), ip_ntop(), ip_pton(), ipf_to_rule(), ipfw_to_fr(), pr_to_fr(), route_add(), route_delete(), route_get(), route_loop(), rule_to_ipf(), and START_TEST().

#define IP_ADDR_LOOPBACK   (htonl(0x7f000001))
 

Definition at line 398 of file ip.h.

Referenced by route_get().

#define IP_ADDR_MCAST_ALL   (htonl(0xe0000001))
 

Definition at line 399 of file ip.h.

#define IP_ADDR_MCAST_LOCAL   (htonl(0xe00000ff))
 

Definition at line 400 of file ip.h.

#define ip_aton   ip_pton
 

Definition at line 421 of file ip.h.

Referenced by __pyx_f_4dnet_ip_aton().

#define IP_BADCLASS  ) 
 

Value:

(((uint32_t)(i) & htonl(0xf0000000)) == \
                                 htonl(0xf0000000))

Definition at line 389 of file ip.h.

#define ip_cksum_carry  )     (x = (x >> 16) + (x & 0xffff), (~(x + (x >> 16)) & 0xffff))
 

Definition at line 428 of file ip.h.

Referenced by __pyx_f_4dnet_ip_cksum_carry(), ip6_checksum(), and ip_checksum().

#define IP_CLASSA  ) 
 

Value:

(((uint32_t)(i) & htonl(0x80000000)) == \
                                 htonl(0x00000000))

Definition at line 359 of file ip.h.

#define IP_CLASSA_HOST   (htonl(0x00ffffff))
 

Definition at line 363 of file ip.h.

#define IP_CLASSA_MAX   128
 

Definition at line 364 of file ip.h.

#define IP_CLASSA_NET   (htonl(0xff000000))
 

Definition at line 361 of file ip.h.

Referenced by route_get().

#define IP_CLASSA_NSHIFT   24
 

Definition at line 362 of file ip.h.

#define IP_CLASSB  ) 
 

Value:

(((uint32_t)(i) & htonl(0xc0000000)) == \
                                 htonl(0x80000000))

Definition at line 366 of file ip.h.

#define IP_CLASSB_HOST   (htonl(0x0000ffff))
 

Definition at line 370 of file ip.h.

#define IP_CLASSB_MAX   65536
 

Definition at line 371 of file ip.h.

#define IP_CLASSB_NET   (htonl(0xffff0000))
 

Definition at line 368 of file ip.h.

#define IP_CLASSB_NSHIFT   16
 

Definition at line 369 of file ip.h.

#define IP_CLASSC  ) 
 

Value:

(((uint32_t)(i) & htonl(0xe0000000)) == \
                                 htonl(0xc0000000))

Definition at line 373 of file ip.h.

#define IP_CLASSC_HOST   (htonl(0x000000ff))
 

Definition at line 377 of file ip.h.

#define IP_CLASSC_NET   (htonl(0xffffff00))
 

Definition at line 375 of file ip.h.

#define IP_CLASSC_NSHIFT   8
 

Definition at line 376 of file ip.h.

#define IP_CLASSD  ) 
 

Value:

(((uint32_t)(i) & htonl(0xf0000000)) == \
                                 htonl(0xe0000000))

Definition at line 379 of file ip.h.

#define IP_CLASSD_HOST   (htonl(0x0fffffff))
 

Definition at line 384 of file ip.h.

#define IP_CLASSD_NET   (htonl(0xf0000000))
 

Definition at line 382 of file ip.h.

#define IP_CLASSD_NSHIFT   28
 

Definition at line 383 of file ip.h.

#define IP_DF   0x4000
 

Definition at line 83 of file ip.h.

#define IP_EXPERIMENTAL  ) 
 

Value:

(((uint32_t)(i) & htonl(0xf0000000)) == \
                                 htonl(0xf0000000))

Definition at line 387 of file ip.h.

#define IP_HDR_LEN   20
 

Definition at line 17 of file ip.h.

Referenced by ip_checksum(), and ip_main().

#define IP_HDR_LEN_MAX   (IP_HDR_LEN + IP_OPT_LEN_MAX)
 

Definition at line 20 of file ip.h.

Referenced by ip_add_option().

#define IP_LEN_MAX   65535
 

Definition at line 22 of file ip.h.

Referenced by hex_main(), icmp_main(), ip_main(), send_main(), tcp_main(), and udp_main().

#define IP_LEN_MIN   IP_HDR_LEN
 

Definition at line 23 of file ip.h.

#define IP_LOCAL_GROUP  ) 
 

Value:

(((uint32_t)(i) & htonl(0xffffff00)) == \
                                 htonl(0xe0000000))

Definition at line 391 of file ip.h.

Referenced by route_get().

#define IP_MF   0x2000
 

Definition at line 84 of file ip.h.

Referenced by ip_checksum(), ip_send(), and off_aton().

#define IP_MULTICAST  )     IP_CLASSD(i)
 

Definition at line 385 of file ip.h.

#define IP_OFFMASK   0x1fff
 

Definition at line 85 of file ip.h.

Referenced by ip_checksum(), and off_aton().

#define IP_OPT_ADDEXT   (19|IP_OPT_COPY)
 

Definition at line 263 of file ip.h.

#define IP_OPT_CIPSO   (6|IP_OPT_COPY)
 

Definition at line 250 of file ip.h.

#define IP_OPT_CLASS  )     ((o) & 0x60)
 

Definition at line 272 of file ip.h.

#define IP_OPT_CONTROL   0x00
 

Definition at line 238 of file ip.h.

#define IP_OPT_COPIED  )     ((o) & 0x80)
 

Definition at line 271 of file ip.h.

#define IP_OPT_COPY   0x80
 

Definition at line 240 of file ip.h.

#define IP_OPT_DEBMEAS   0x40
 

Definition at line 239 of file ip.h.

#define IP_OPT_DPS   (23|IP_OPT_COPY)
 

Definition at line 267 of file ip.h.

#define IP_OPT_EIP   (17|IP_OPT_COPY)
 

Definition at line 261 of file ip.h.

#define IP_OPT_ENCODE   15
 

Definition at line 259 of file ip.h.

#define IP_OPT_EOL   0
 

Definition at line 244 of file ip.h.

#define IP_OPT_ESEC   (5|IP_OPT_COPY)
 

Definition at line 249 of file ip.h.

#define IP_OPT_FINN   (13|IP_OPT_COPY|IP_OPT_DEBMEAS)
 

Definition at line 257 of file ip.h.

#define IP_OPT_IMITD   (16|IP_OPT_COPY)
 

Definition at line 260 of file ip.h.

#define IP_OPT_LEN   2
 

Definition at line 18 of file ip.h.

#define IP_OPT_LEN_MAX   40
 

Definition at line 19 of file ip.h.

#define IP_OPT_LSRR   (3|IP_OPT_COPY)
 

Definition at line 247 of file ip.h.

#define IP_OPT_MAX   25
 

Definition at line 269 of file ip.h.

#define IP_OPT_MTUP   11
 

Definition at line 255 of file ip.h.

#define IP_OPT_MTUR   12
 

Definition at line 256 of file ip.h.

#define IP_OPT_NOP   1
 

Definition at line 245 of file ip.h.

Referenced by ip_add_option().

#define IP_OPT_NSAPA   (22|IP_OPT_COPY)
 

Definition at line 266 of file ip.h.

#define IP_OPT_NUMBER  )     ((o) & 0x1f)
 

Definition at line 273 of file ip.h.

#define IP_OPT_RESERVED1   0x20
 

Definition at line 241 of file ip.h.

#define IP_OPT_RESERVED2   0x60
 

Definition at line 242 of file ip.h.

#define IP_OPT_RR   7
 

Definition at line 251 of file ip.h.

#define IP_OPT_RTRALT   (20|IP_OPT_COPY)
 

Definition at line 264 of file ip.h.

#define IP_OPT_SATID   (8|IP_OPT_COPY)
 

Definition at line 252 of file ip.h.

#define IP_OPT_SDB   (21|IP_OPT_COPY)
 

Definition at line 265 of file ip.h.

#define IP_OPT_SEC   (2|IP_OPT_COPY)
 

Definition at line 246 of file ip.h.

#define IP_OPT_SEC_CONFID   0xf135
 

Definition at line 287 of file ip.h.

#define IP_OPT_SEC_EFTO   0x789a
 

Definition at line 288 of file ip.h.

#define IP_OPT_SEC_MMMM   0xbc4d
 

Definition at line 289 of file ip.h.

#define IP_OPT_SEC_PROG   0x5e26
 

Definition at line 290 of file ip.h.

#define IP_OPT_SEC_RESTR   0xaf13
 

Definition at line 291 of file ip.h.

#define IP_OPT_SEC_SECRET   0xd788
 

Definition at line 292 of file ip.h.

#define IP_OPT_SEC_TOPSECRET   0x6bc5
 

Definition at line 293 of file ip.h.

#define IP_OPT_SEC_UNCLASS   0x0000
 

Definition at line 286 of file ip.h.

#define IP_OPT_SSRR   (9|IP_OPT_COPY)
 

Definition at line 253 of file ip.h.

#define IP_OPT_TR   (18|IP_OPT_DEBMEAS)
 

Definition at line 262 of file ip.h.

#define IP_OPT_TS   (4|IP_OPT_DEBMEAS)
 

Definition at line 248 of file ip.h.

#define IP_OPT_TS_PRESPEC   3
 

Definition at line 320 of file ip.h.

#define IP_OPT_TS_TSADDR   1
 

Definition at line 319 of file ip.h.

#define IP_OPT_TS_TSONLY   0
 

Definition at line 318 of file ip.h.

#define IP_OPT_TYPEONLY  )     ((o) == IP_OPT_EOL || (o) == IP_OPT_NOP)
 

Definition at line 274 of file ip.h.

Referenced by ip_add_option().

#define IP_OPT_UMP   (24|IP_OPT_COPY)
 

Definition at line 268 of file ip.h.

#define IP_OPT_VISA   (14|IP_OPT_COPY)
 

Definition at line 258 of file ip.h.

#define IP_OPT_ZSU   10
 

Definition at line 254 of file ip.h.

#define ip_pack_hdr hdr,
tos,
len,
id,
off,
ttl,
p,
src,
dst   ) 
 

Value:

do {    \
        struct ip_hdr *ip_pack_p = (struct ip_hdr *)(hdr);              \
        ip_pack_p->ip_v = 4; ip_pack_p->ip_hl = 5;                      \
        ip_pack_p->ip_tos = tos; ip_pack_p->ip_len = htons(len);        \
        ip_pack_p->ip_id = htons(id); ip_pack_p->ip_off = htons(off);   \
        ip_pack_p->ip_ttl = ttl; ip_pack_p->ip_p = p;                   \
        ip_pack_p->ip_src = src; ip_pack_p->ip_dst = dst;               \
} while (0)

Definition at line 402 of file ip.h.

Referenced by __pyx_f_4dnet_ip_pack_hdr().

#define IP_PROTO_3PC   34
 

Definition at line 131 of file ip.h.

#define IP_PROTO_AH   51
 

Definition at line 147 of file ip.h.

#define IP_PROTO_AN   107
 

Definition at line 203 of file ip.h.

#define IP_PROTO_ANY0HOP   114
 

Definition at line 210 of file ip.h.

#define IP_PROTO_ANYENC   99
 

Definition at line 195 of file ip.h.

#define IP_PROTO_ANYHOST   61
 

Definition at line 157 of file ip.h.

#define IP_PROTO_ANYNET   63
 

Definition at line 159 of file ip.h.

#define IP_PROTO_ARGUS   13
 

Definition at line 110 of file ip.h.

#define IP_PROTO_ARIS   104
 

Definition at line 200 of file ip.h.

#define IP_PROTO_AX25   93
 

Definition at line 189 of file ip.h.

#define IP_PROTO_BBNRCC   10
 

Definition at line 107 of file ip.h.

#define IP_PROTO_BRSATMON   76
 

Definition at line 172 of file ip.h.

#define IP_PROTO_CBT   7
 

Definition at line 104 of file ip.h.

#define IP_PROTO_CFTP   62
 

Definition at line 158 of file ip.h.

#define IP_PROTO_CHAOS   16
 

Definition at line 113 of file ip.h.

#define IP_PROTO_CMTP   38
 

Definition at line 135 of file ip.h.

#define IP_PROTO_COMPAQPEER   110
 

Definition at line 206 of file ip.h.

#define IP_PROTO_CPHB   73
 

Definition at line 169 of file ip.h.

#define IP_PROTO_CPNX   72
 

Definition at line 168 of file ip.h.

#define IP_PROTO_CRTP   126
 

Definition at line 222 of file ip.h.

#define IP_PROTO_CRUDP   127
 

Definition at line 223 of file ip.h.

#define IP_PROTO_DCNMEAS   19
 

Definition at line 116 of file ip.h.

#define IP_PROTO_DDP   37
 

Definition at line 134 of file ip.h.

#define IP_PROTO_DDX   116
 

Definition at line 212 of file ip.h.

#define IP_PROTO_DGP   86
 

Definition at line 182 of file ip.h.

#define IP_PROTO_DISTFS   68
 

Definition at line 164 of file ip.h.

#define IP_PROTO_DSTOPTS   60
 

Definition at line 156 of file ip.h.

#define IP_PROTO_EGP   8
 

Definition at line 105 of file ip.h.

#define IP_PROTO_EIGRP   88
 

Definition at line 184 of file ip.h.

#define IP_PROTO_EMCON   14
 

Definition at line 111 of file ip.h.

#define IP_PROTO_ENA   49
 

Definition at line 145 of file ip.h.

#define IP_PROTO_ENCAP   98
 

Definition at line 194 of file ip.h.

#define IP_PROTO_EON   80
 

Definition at line 176 of file ip.h.

#define IP_PROTO_ESP   50
 

Definition at line 146 of file ip.h.

#define IP_PROTO_ETHERIP   97
 

Definition at line 193 of file ip.h.

#define IP_PROTO_EXPAK   64
 

Definition at line 160 of file ip.h.

#define IP_PROTO_FC   133
 

Definition at line 229 of file ip.h.

#define IP_PROTO_FIRE   125
 

Definition at line 221 of file ip.h.

#define IP_PROTO_FRAGMENT   44
 

Definition at line 141 of file ip.h.

#define IP_PROTO_GGP   3
 

Definition at line 100 of file ip.h.

#define IP_PROTO_GMTP   100
 

Definition at line 196 of file ip.h.

#define IP_PROTO_GRE   47
 

Definition at line 143 of file ip.h.

#define IP_PROTO_HMP   20
 

Definition at line 117 of file ip.h.

#define IP_PROTO_HOPOPTS   IP_PROTO_IP
 

Definition at line 97 of file ip.h.

#define IP_PROTO_IATP   117
 

Definition at line 213 of file ip.h.

#define IP_PROTO_ICMP   1
 

Definition at line 98 of file ip.h.

Referenced by arg_to_fr(), format_rule(), fr_to_ipfw(), fr_to_pr(), ip6_checksum(), ip_checksum(), ipfw_to_fr(), parse_rule(), pr_to_fr(), and print_rule().

#define IP_PROTO_ICMPV6   58
 

Definition at line 154 of file ip.h.

Referenced by ip6_checksum().

#define IP_PROTO_IDP   22
 

Definition at line 119 of file ip.h.

#define IP_PROTO_IDPR   35
 

Definition at line 132 of file ip.h.

#define IP_PROTO_IFMP   101
 

Definition at line 197 of file ip.h.

#define IP_PROTO_IGMP   2
 

Definition at line 99 of file ip.h.

Referenced by arg_to_fr(), ip6_checksum(), and ip_checksum().

#define IP_PROTO_IGP   9
 

Definition at line 106 of file ip.h.

#define IP_PROTO_IL   40
 

Definition at line 137 of file ip.h.

#define IP_PROTO_INLSP   52
 

Definition at line 148 of file ip.h.

#define IP_PROTO_IP   0
 

Definition at line 96 of file ip.h.

Referenced by ip_add_option().

#define IP_PROTO_IPCOMP   108
 

Definition at line 204 of file ip.h.

#define IP_PROTO_IPCV   71
 

Definition at line 167 of file ip.h.

#define IP_PROTO_IPIP   4
 

Definition at line 101 of file ip.h.

#define IP_PROTO_IPIPENCAP   94
 

Definition at line 190 of file ip.h.

#define IP_PROTO_IPLT   129
 

Definition at line 225 of file ip.h.

#define IP_PROTO_IPPC   67
 

Definition at line 163 of file ip.h.

#define IP_PROTO_IPV6   41
 

Definition at line 138 of file ip.h.

#define IP_PROTO_IPXIP   111
 

Definition at line 207 of file ip.h.

#define IP_PROTO_IRTP   28
 

Definition at line 125 of file ip.h.

#define IP_PROTO_ISIS   124
 

Definition at line 220 of file ip.h.

#define IP_PROTO_KRYPTOLAN   65
 

Definition at line 161 of file ip.h.

#define IP_PROTO_L2TP   115
 

Definition at line 211 of file ip.h.

#define IP_PROTO_LARP   91
 

Definition at line 187 of file ip.h.

#define IP_PROTO_LEAF1   25
 

Definition at line 122 of file ip.h.

#define IP_PROTO_LEAF2   26
 

Definition at line 123 of file ip.h.

#define IP_PROTO_MAX   255
 

Definition at line 233 of file ip.h.

#define IP_PROTO_MERITINP   32
 

Definition at line 129 of file ip.h.

#define IP_PROTO_MFPNSP   31
 

Definition at line 128 of file ip.h.

#define IP_PROTO_MHRP   48
 

Definition at line 144 of file ip.h.

#define IP_PROTO_MICP   95
 

Definition at line 191 of file ip.h.

#define IP_PROTO_MOBILE   55
 

Definition at line 151 of file ip.h.

#define IP_PROTO_MTP   92
 

Definition at line 188 of file ip.h.

#define IP_PROTO_MUX   18
 

Definition at line 115 of file ip.h.

#define IP_PROTO_NARP   54
 

Definition at line 150 of file ip.h.

#define IP_PROTO_NETBLT   30
 

Definition at line 127 of file ip.h.

#define IP_PROTO_NONE   59
 

Definition at line 155 of file ip.h.

#define IP_PROTO_NSFIGP   85
 

Definition at line 181 of file ip.h.

#define IP_PROTO_NVP   11
 

Definition at line 108 of file ip.h.

#define IP_PROTO_OSPF   89
 

Definition at line 185 of file ip.h.

#define IP_PROTO_PGM   113
 

Definition at line 209 of file ip.h.

#define IP_PROTO_PIM   103
 

Definition at line 199 of file ip.h.

#define IP_PROTO_PIPE   131
 

Definition at line 227 of file ip.h.

#define IP_PROTO_PNNI   102
 

Definition at line 198 of file ip.h.

#define IP_PROTO_PRM   21
 

Definition at line 118 of file ip.h.

#define IP_PROTO_PTP   123
 

Definition at line 219 of file ip.h.

#define IP_PROTO_PUP   12
 

Definition at line 109 of file ip.h.

#define IP_PROTO_PVP   75
 

Definition at line 171 of file ip.h.

#define IP_PROTO_QNX   106
 

Definition at line 202 of file ip.h.

#define IP_PROTO_RAW   255
 

Definition at line 231 of file ip.h.

#define IP_PROTO_RDP   27
 

Definition at line 124 of file ip.h.

#define IP_PROTO_RESERVED   IP_PROTO_RAW
 

Definition at line 232 of file ip.h.

#define IP_PROTO_ROUTING   43
 

Definition at line 140 of file ip.h.

#define IP_PROTO_RSVP   46
 

Definition at line 142 of file ip.h.

#define IP_PROTO_RSVPIGN   134
 

Definition at line 230 of file ip.h.

#define IP_PROTO_RVD   66
 

Definition at line 162 of file ip.h.

#define IP_PROTO_SATMON   69
 

Definition at line 165 of file ip.h.

#define IP_PROTO_SCCSP   96
 

Definition at line 192 of file ip.h.

#define IP_PROTO_SCPS   105
 

Definition at line 201 of file ip.h.

#define IP_PROTO_SCTP   132
 

Definition at line 228 of file ip.h.

#define IP_PROTO_SDRP   42
 

Definition at line 139 of file ip.h.

#define IP_PROTO_SEP   33
 

Definition at line 130 of file ip.h.

#define IP_PROTO_SKIP   57
 

Definition at line 153 of file ip.h.

#define IP_PROTO_SM   122
 

Definition at line 218 of file ip.h.

#define IP_PROTO_SMP   121
 

Definition at line 217 of file ip.h.

#define IP_PROTO_SNP   109
 

Definition at line 205 of file ip.h.

#define IP_PROTO_SPRITERPC   90
 

Definition at line 186 of file ip.h.

#define IP_PROTO_SPS   130
 

Definition at line 226 of file ip.h.

#define IP_PROTO_SRP   119
 

Definition at line 215 of file ip.h.

#define IP_PROTO_SSCOPMCE   128
 

Definition at line 224 of file ip.h.

#define IP_PROTO_ST   5
 

Definition at line 102 of file ip.h.

#define IP_PROTO_STP   118
 

Definition at line 214 of file ip.h.

#define IP_PROTO_SUNND   77
 

Definition at line 173 of file ip.h.

#define IP_PROTO_SVMTP   82
 

Definition at line 178 of file ip.h.

#define IP_PROTO_SWIPE   53
 

Definition at line 149 of file ip.h.

#define IP_PROTO_TCF   87
 

Definition at line 183 of file ip.h.

#define IP_PROTO_TCP   6
 

Definition at line 103 of file ip.h.

Referenced by arg_to_fr(), format_rule(), fr_to_ipfw(), fr_to_pr(), ip6_checksum(), ip_add_option(), ip_checksum(), ipfw_to_fr(), parse_rule(), pr_to_fr(), and print_rule().

#define IP_PROTO_TLSP   56
 

Definition at line 152 of file ip.h.

#define IP_PROTO_TP   29
 

Definition at line 126 of file ip.h.

#define IP_PROTO_TPPP   39
 

Definition at line 136 of file ip.h.

#define IP_PROTO_TRUNK1   23
 

Definition at line 120 of file ip.h.

#define IP_PROTO_TRUNK2   24
 

Definition at line 121 of file ip.h.

#define IP_PROTO_TTP   84
 

Definition at line 180 of file ip.h.

#define IP_PROTO_UDP   17
 

Definition at line 114 of file ip.h.

Referenced by arg_to_fr(), format_rule(), fr_to_ipfw(), fr_to_pr(), ip6_checksum(), ip_checksum(), ipfw_to_fr(), parse_rule(), pr_to_fr(), and print_rule().

#define IP_PROTO_UTI   120
 

Definition at line 216 of file ip.h.

#define IP_PROTO_VINES   83
 

Definition at line 179 of file ip.h.

#define IP_PROTO_VISA   70
 

Definition at line 166 of file ip.h.

#define IP_PROTO_VMTP   81
 

Definition at line 177 of file ip.h.

#define IP_PROTO_VRRP   112
 

Definition at line 208 of file ip.h.

#define IP_PROTO_WBEXPAK   79
 

Definition at line 175 of file ip.h.

#define IP_PROTO_WBMON   78
 

Definition at line 174 of file ip.h.

#define IP_PROTO_WSN   74
 

Definition at line 170 of file ip.h.

#define IP_PROTO_XNET   15
 

Definition at line 112 of file ip.h.

#define IP_PROTO_XTP   36
 

Definition at line 133 of file ip.h.

#define IP_RF   0x8000
 

Definition at line 82 of file ip.h.

#define IP_TOS_CE   0x01
 

Definition at line 65 of file ip.h.

#define IP_TOS_DEFAULT   0x00
 

Definition at line 59 of file ip.h.

#define IP_TOS_ECT   0x02
 

Definition at line 64 of file ip.h.

#define IP_TOS_LOWCOST   0x02
 

Definition at line 63 of file ip.h.

#define IP_TOS_LOWDELAY   0x10
 

Definition at line 60 of file ip.h.

#define IP_TOS_PREC_CRITIC_ECP   0xa0
 

Definition at line 75 of file ip.h.

#define IP_TOS_PREC_FLASH   0x60
 

Definition at line 73 of file ip.h.

#define IP_TOS_PREC_FLASHOVERRIDE   0x80
 

Definition at line 74 of file ip.h.

#define IP_TOS_PREC_IMMEDIATE   0x40
 

Definition at line 72 of file ip.h.

#define IP_TOS_PREC_INTERNETCONTROL   0xc0
 

Definition at line 76 of file ip.h.

#define IP_TOS_PREC_NETCONTROL   0xe0
 

Definition at line 77 of file ip.h.

#define IP_TOS_PREC_PRIORITY   0x20
 

Definition at line 71 of file ip.h.

#define IP_TOS_PREC_ROUTINE   0x00
 

Definition at line 70 of file ip.h.

#define IP_TOS_RELIABILITY   0x04
 

Definition at line 62 of file ip.h.

#define IP_TOS_THROUGHPUT   0x08
 

Definition at line 61 of file ip.h.

#define IP_TTL_DEFAULT   64
 

Definition at line 90 of file ip.h.

#define IP_TTL_MAX   255
 

Definition at line 91 of file ip.h.

Referenced by ip_main().


Typedef Documentation

typedef uint32_t ip_addr_t
 

Definition at line 25 of file ip.h.

typedef struct ip_handle ip_t
 

Definition at line 411 of file ip.h.


Function Documentation

ssize_t ip_add_option void *  buf,
size_t  len,
int  proto,
const void *  optbuf,
size_t  optlen
 

Definition at line 18 of file ip-util.c.

References errno, IP_HDR_LEN_MAX, ip_hdr::ip_hl, ip_hdr::ip_len, IP_OPT_NOP, IP_OPT_TYPEONLY, IP_PROTO_IP, IP_PROTO_TCP, memmove, memset, NULL, and tcp_hdr::th_off.

void ip_checksum void *  buf,
size_t  len
 

Definition at line 79 of file ip-util.c.

References icmp_hdr::icmp_cksum, ICMP_HDR_LEN, ip_cksum_add(), ip_cksum_carry, IP_HDR_LEN, ip_hdr::ip_hl, IP_MF, IP_OFFMASK, IP_PROTO_ICMP, IP_PROTO_IGMP, IP_PROTO_TCP, IP_PROTO_UDP, ip_hdr::ip_sum, TCP_HDR_LEN, tcp_hdr::th_sum, UDP_HDR_LEN, and udp_hdr::uh_sum.

Referenced by __pyx_f_4dnet_ip_checksum(), ip_main(), and ip_send().

int ip_cksum_add const void *  buf,
size_t  len,
int  cksum
 

Definition at line 134 of file ip-util.c.

Referenced by __pyx_f_4dnet_ip_cksum_add(), ip6_checksum(), and ip_checksum().

ip_t* ip_close ip_t i  ) 
 

Definition at line 223 of file ip-cooked.c.

References NULL.

Referenced by __pyx_f_4dnet_2ip___dealloc__(), ip_open(), send_main(), and START_TEST().

char* ip_ntoa const ip_addr_t ip  ) 
 

Definition at line 143 of file addr-util.c.

References addr_ntoa(), addr_pack, ADDR_TYPE_IP, IP_ADDR_BITS, and IP_ADDR_LEN.

Referenced by __pyx_f_4dnet_ip_ntoa().

char* ip_ntop const ip_addr_t ip,
char *  dst,
size_t  len
 

Definition at line 122 of file addr-util.c.

References IP_ADDR_LEN, NULL, and octet2dec.

Referenced by addr_ntop(), and ip6_ntop().

__BEGIN_DECLS ip_t* ip_open void   ) 
 

Definition at line 68 of file ip-cooked.c.

References errno, ip_close(), and NULL.

Referenced by __pyx_f_4dnet_2ip___init__(), send_main(), and START_TEST().

int ip_pton const char *  src,
ip_addr_t dst
 

Definition at line 152 of file addr-util.c.

References IP_ADDR_LEN, and strtol().

Referenced by addr_pton(), and ip6_pton().

ssize_t ip_send ip_t i,
const void *  buf,
size_t  len
 

Definition at line 141 of file ip-cooked.c.

References memset.

Referenced by __pyx_f_4dnet_2ip_send(), and send_main().


Variable Documentation

struct ip6_ext_hdr __packed__
 


Generated on Sun May 14 14:51:21 2006 by  doxygen 1.4.2