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_t * | ip_open (void) |
ssize_t | ip_send (ip_t *i, const void *buf, size_t len) |
ip_t * | ip_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__ |
|
|
|
Definition at line 396 of file ip.h. Referenced by arp_add(), arp_delete(), route_delete(), route_get(), route_loop(), and route_msg(). |
|
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(). |
|
Definition at line 397 of file ip.h. Referenced by arp_add(). |
|
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(). |
|
Definition at line 398 of file ip.h. Referenced by route_get(). |
|
|
|
|
|
Definition at line 421 of file ip.h. Referenced by __pyx_f_4dnet_ip_aton(). |
|
Value: (((uint32_t)(i) & htonl(0xf0000000)) == \ htonl(0xf0000000)) |
|
Definition at line 428 of file ip.h. Referenced by __pyx_f_4dnet_ip_cksum_carry(), ip6_checksum(), and ip_checksum(). |
|
Value: (((uint32_t)(i) & htonl(0x80000000)) == \ htonl(0x00000000)) |
|
|
|
|
|
Definition at line 361 of file ip.h. Referenced by route_get(). |
|
|
|
Value: (((uint32_t)(i) & htonl(0xc0000000)) == \ htonl(0x80000000)) |
|
|
|
|
|
|
|
|
|
Value: (((uint32_t)(i) & htonl(0xe0000000)) == \ htonl(0xc0000000)) |
|
|
|
|
|
|
|
Value: (((uint32_t)(i) & htonl(0xf0000000)) == \ htonl(0xe0000000)) |
|
|
|
|
|
|
|
|
|
Value: (((uint32_t)(i) & htonl(0xf0000000)) == \ htonl(0xf0000000)) |
|
Definition at line 17 of file ip.h. Referenced by ip_checksum(), and ip_main(). |
|
Definition at line 20 of file ip.h. Referenced by ip_add_option(). |
|
Definition at line 22 of file ip.h. Referenced by hex_main(), icmp_main(), ip_main(), send_main(), tcp_main(), and udp_main(). |
|
|
|
Value: (((uint32_t)(i) & htonl(0xffffff00)) == \ htonl(0xe0000000)) Definition at line 391 of file ip.h. Referenced by route_get(). |
|
Definition at line 84 of file ip.h. Referenced by ip_checksum(), ip_send(), and off_aton(). |
|
|
|
Definition at line 85 of file ip.h. Referenced by ip_checksum(), and off_aton(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 245 of file ip.h. Referenced by ip_add_option(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 274 of file ip.h. Referenced by ip_add_option(). |
|
|
|
|
|
|
|
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(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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(). |
|
Definition at line 154 of file ip.h. Referenced by ip6_checksum(). |
|
|
|
|
|
|
|
Definition at line 99 of file ip.h. Referenced by arg_to_fr(), ip6_checksum(), and ip_checksum(). |
|
|
|
|
|
|
|
Definition at line 96 of file ip.h. Referenced by ip_add_option(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
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(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 91 of file ip.h. Referenced by ip_main(). |
|
|
|
|
|
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. |
|
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(). |
|
Definition at line 134 of file ip-util.c. Referenced by __pyx_f_4dnet_ip_cksum_add(), ip6_checksum(), and ip_checksum(). |
|
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(). |
|
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(). |
|
Definition at line 122 of file addr-util.c. References IP_ADDR_LEN, NULL, and octet2dec. Referenced by addr_ntop(), and ip6_ntop(). |
|
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(). |
|
Definition at line 152 of file addr-util.c. References IP_ADDR_LEN, and strtol(). Referenced by addr_pton(), and ip6_pton(). |
|
Definition at line 141 of file ip-cooked.c. References memset. Referenced by __pyx_f_4dnet_2ip_send(), and send_main(). |
|
|