00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef __LIBNET_HEADERS_H
00033 #define __LIBNET_HEADERS_H
00034
00035
00036
00037
00038
00039
00040
00041
00042 #define LIBNET_802_1Q_H 0x12
00043 #define LIBNET_802_1X_H 0x04
00044 #define LIBNET_802_2_H 0x03
00045 #define LIBNET_802_2SNAP_H 0x08
00046 #define LIBNET_802_3_H 0x0e
00047 #define LIBNET_ARP_H 0x08
00048 #define LIBNET_ARP_ETH_IP_H 0x1c
00049 #define LIBNET_BGP4_HEADER_H 0x13
00050 #define LIBNET_BGP4_OPEN_H 0x0a
00051 #define LIBNET_BGP4_UPDATE_H 0x04
00052 #define LIBNET_BGP4_NOTIFICATION_H 0x02
00053 #define LIBNET_CDP_H 0x08
00054 #define LIBNET_DHCPV4_H 0xf0
00055 #define LIBNET_UDP_DNSV4_H 0x0c
00056 #define LIBNET_TCP_DNSV4_H 0x0e
00057 #define LIBNET_ETH_H 0x0e
00058 #define LIBNET_FDDI_H 0x15
00059 #define LIBNET_ICMPV4_H 0x04
00060 #define LIBNET_ICMPV4_ECHO_H 0x08
00061 #define LIBNET_ICMPV4_MASK_H 0x0c
00062 #define LIBNET_ICMPV4_UNREACH_H 0x08
00063 #define LIBNET_ICMPV4_TIMXCEED_H 0x08
00064 #define LIBNET_ICMPV4_REDIRECT_H 0x08
00065 #define LIBNET_ICMPV4_TS_H 0x14
00066 #define LIBNET_ICMPV6_H 0x08
00067 #define LIBNET_IGMP_H 0x08
00068 #define LIBNET_IPV4_H 0x14
00069 #define LIBNET_IPV6_H 0x28
00070 #define LIBNET_IPV6_FRAG_H 0x08
00071 #define LIBNET_IPV6_ROUTING_H 0x04
00072 #define LIBNET_IPV6_DESTOPTS_H 0x02
00073 #define LIBNET_IPV6_HBHOPTS_H 0x02
00074 #define LIBNET_IPSEC_ESP_HDR_H 0x0c
00075 #define LIBNET_IPSEC_ESP_FTR_H 0x02
00076 #define LIBNET_IPSEC_AH_H 0x10
00077 #define LIBNET_ISL_H 0x1a
00078 #define LIBNET_GRE_H 0x04
00079 #define LIBNET_GRE_SRE_H 0x04
00080 #define LIBNET_MPLS_H 0x04
00081 #define LIBNET_OSPF_H 0x10
00082 #define LIBNET_OSPF_HELLO_H 0x18
00083 #define LIBNET_OSPF_DBD_H 0x08
00084 #define LIBNET_OSPF_LSR_H 0x0c
00085 #define LIBNET_OSPF_LSU_H 0x04
00086 #define LIBNET_OSPF_LSA_H 0x14
00087 #define LIBNET_OSPF_AUTH_H 0x08
00088 #define LIBNET_OSPF_CKSUM 0x10
00089 #define LIBNET_OSPF_LS_RTR_H 0x10
00090 #define LIBNET_OSPF_LS_NET_H 0x08
00091 #define LIBNET_OSPF_LS_SUM_H 0x0c
00092 #define LIBNET_OSPF_LS_AS_EXT_H 0x10
00093 #define LIBNET_NTP_H 0x30
00094 #define LIBNET_RIP_H 0x18
00095 #define LIBNET_RPC_CALL_H 0x28
00098 #define LIBNET_RPC_CALL_TCP_H 0x2c
00101 #define LIBNET_SEBEK_H 0x30
00102 #define LIBNET_STP_CONF_H 0x23
00103 #define LIBNET_STP_TCN_H 0x04
00104 #define LIBNET_TOKEN_RING_H 0x16
00105 #define LIBNET_TCP_H 0x14
00106 #define LIBNET_UDP_H 0x08
00107 #define LIBNET_VRRP_H 0x08
00108 #define LIBNET_HSRP_H 0x14
00110
00111
00112
00113
00114 struct libnet_802_1q_hdr
00115 {
00116 u_int8_t vlan_dhost[ETHER_ADDR_LEN];
00117 u_int8_t vlan_shost[ETHER_ADDR_LEN];
00118 u_int16_t vlan_tpi;
00119 u_int16_t vlan_priority_c_vid;
00120 #define LIBNET_802_1Q_PRIMASK 0x0007
00121 #define LIBNET_802_1Q_CFIMASK 0x0001
00122 #define LIBNET_802_1Q_VIDMASK 0x0fff
00123 u_int16_t vlan_len;
00124 };
00125
00126
00127
00128
00129
00130 struct libnet_802_1x_hdr
00131 {
00132 u_int8_t dot1x_version;
00133 u_int8_t dot1x_type;
00134 #define LIBNET_802_1X_PACKET 0x00
00135 #define LIBNET_802_1X_START 0x01
00136 #define LIBNET_802_1X_LOGOFF 0x02
00137 #define LIBNET_802_1X_KEY 0x03
00138 #define LIBNET_802_1X_ENCASFAL 0x04
00139 u_int16_t dot1x_length;
00140 };
00141
00142
00143
00144
00145
00146
00147 struct libnet_802_2_hdr
00148 {
00149 u_int8_t llc_dsap;
00150 u_int8_t llc_ssap;
00151 #define LIBNET_SAP_STP 0x42
00152 #define LIBNET_SAP_SNAP 0xaa
00153 u_int8_t llc_control;
00154 };
00155
00156
00157
00158
00159
00160
00161
00162 struct libnet_802_2snap_hdr
00163 {
00164 u_int8_t snap_dsap;
00165 u_int8_t snap_ssap;
00166 u_int8_t snap_control;
00167 u_int8_t snap_oui[3];
00168 u_int16_t snap_type;
00169 };
00170
00171
00172
00173
00174
00175
00176
00177 struct libnet_802_3_hdr
00178 {
00179 u_int8_t _802_3_dhost[ETHER_ADDR_LEN];
00180 u_int8_t _802_3_shost[ETHER_ADDR_LEN];
00181 u_int16_t _802_3_len;
00182 };
00183
00184
00185
00186
00187
00188
00189
00190 struct libnet_arp_hdr
00191 {
00192 u_int16_t ar_hrd;
00193 #define ARPHRD_NETROM 0
00194 #define ARPHRD_ETHER 1
00195 #define ARPHRD_EETHER 2
00196 #define ARPHRD_AX25 3
00197 #define ARPHRD_PRONET 4
00198 #define ARPHRD_CHAOS 5
00199 #define ARPHRD_IEEE802 6
00200 #define ARPHRD_ARCNET 7
00201 #define ARPHRD_APPLETLK 8
00202 #define ARPHRD_LANSTAR 9
00203 #define ARPHRD_DLCI 15
00204 #define ARPHRD_ATM 19
00205 #define ARPHRD_METRICOM 23
00206 #define ARPHRD_IPSEC 31
00207 u_int16_t ar_pro;
00208 u_int8_t ar_hln;
00209 u_int8_t ar_pln;
00210 u_int16_t ar_op;
00211 #define ARPOP_REQUEST 1
00212 #define ARPOP_REPLY 2
00213 #define ARPOP_REVREQUEST 3
00214 #define ARPOP_REVREPLY 4
00215 #define ARPOP_INVREQUEST 8
00216 #define ARPOP_INVREPLY 9
00217
00218 };
00219
00220
00221
00222
00223
00224
00225 struct libnet_bgp4_header_hdr
00226 {
00227 #define LIBNET_BGP4_MARKER_SIZE 16
00228 u_int8_t marker[LIBNET_BGP4_MARKER_SIZE];
00229 u_int16_t len;
00230 u_int8_t type;
00231 #define LIBNET_BGP4_OPEN 1
00232 #define LIBNET_BGP4_UPDATE 2
00233 #define LIBNET_BGP4_NOTIFICATION 3
00234 #define LIBNET_BGP4_KEEPALIVE 4
00235 };
00236
00237
00238
00239
00240
00241
00242 struct libnet_bgp4_open_hdr
00243 {
00244 u_int8_t version;
00245 u_int16_t src_as;
00246 u_int16_t hold_time;
00247 u_int32_t bgp_id;
00248 u_int8_t opt_len;
00249 };
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259 struct libnet_bgp4_notification_hdr
00260 {
00261 #define LIBNET_BGP4_MESSAGE_HEADER_ERROR 1
00262 #define LIBNET_BGP4_OPEN_MESSAGE_ERROR 2
00263 #define LIBNET_BGP4_UPDATE_MESSAGE_ERROR 3
00264 #define LIBNET_BGP4_HOLD_TIMER_EXPIRED 4
00265 #define LIBNET_BGP4_FINITE_STATE__ERROR 5
00266 #define LIBNET_BGP4_CEASE 6
00267 u_int8_t err_code;
00268
00269
00270 #define LIBNET_BGP4_CONNECTION_NOT_SYNCHRONIZED 1
00271 #define LIBNET_BGP4_BAD_MESSAGE_LENGTH 2
00272 #define LIBNET_BGP4_BAD_MESSAGE_TYPE 3
00273
00274 #define LIBNET_BGP4_UNSUPPORTED_VERSION_NUMBER 1
00275 #define LIBNET_BGP4_BAD_PEER_AS 2
00276 #define LIBNET_BGP4_BAD_BGP_IDENTIFIER 3
00277 #define LIBNET_BGP4_UNSUPPORTED_OPTIONAL_PARAMETER 4
00278 #define LIBNET_BGP4_AUTHENTICATION_FAILURE 5
00279 #define LIBNET_BGP4_UNACCEPTABLE_HOLD_TIME 6
00280
00281 #define LIBNET_BGP4_MALFORMED_ATTRIBUTE_LIST
00282 #define LIBNET_BGP4_UNRECOGNIZED_WELL_KNOWN_ATTRIBUTE
00283 #define LIBNET_BGP4_MISSING_WELL_KNOWN_ATTRIBUTE
00284 #define LIBNET_BGP4_ATTRIBUTE_FLAGS_ERROR
00285 #define LIBNET_BGP4_ATTRIBUTE_LENGTH_ERROR
00286 #define LIBNET_BGP4_INVALID_ORIGIN_ATTRIBUTE
00287 #define LIBNET_BGP4_AS_ROUTING_LOOP
00288 #define LIBNET_BGP4_INVALID_NEXT_HOP_ATTRIBUTE
00289 #define LIBNET_BGP4_OPTIONAL_ATTRIBUTE_ERROR
00290 #define LIBNET_BGP4_INVALID_NETWORK_FIELD
00291 #define LIBNET_BGP4_MALFORMED_AS_PATH
00292 u_int8_t err_subcode;
00293 };
00294
00295
00296
00297
00298
00299
00300
00301 #define LIBNET_PROTO_CDP 200
00302
00303
00304
00305
00306
00307
00308 struct libnet_cdp_hdr
00309 {
00310 u_int8_t cdp_version;
00311 u_int8_t cdp_ttl;
00312 u_int16_t cdp_sum;
00313 u_int16_t cdp_type;
00314 #define LIBNET_CDP_DEVID 0x1
00315 #define LIBNET_CDP_ADDRESS 0x2
00316 #define LIBNET_CDP_PORTID 0x3
00317 #define LIBNET_CDP_CAPABIL 0x4
00318 #define LIBNET_CDP_VERSION 0x5
00319 #define LIBNET_CDP_PLATFORM 0x6
00320 #define LIBNET_CDP_IPPREFIX 0x7
00321 u_int16_t cdp_len;
00322
00323
00324
00325 #define LIBNET_CDP_CAP_L3R 0x01
00326 #define LIBNET_CDP_CAP_L2B 0x02
00327 #define LIBNET_CDP_CAP_L2SRB 0x04
00328 #define LIBNET_CDP_CAP_L2S 0x08
00329 #define LIBNET_CDP_CAP_SR 0x10
00330 #define LIBNET_CDP_CAP_NOI 0x20
00331 #define LIBNET_CDP_CAP_L1F 0x40
00332 };
00333
00334
00335
00336
00337
00338 struct libnet_cdp_value_hdr
00339 {
00340 u_int16_t cdp_type;
00341 u_int16_t cdp_len;
00342 };
00343
00344
00345
00346
00347
00348
00349
00350 struct libnet_dhcpv4_hdr
00351 {
00352 u_int8_t dhcp_opcode;
00353 #define LIBNET_DHCP_REQUEST 0x1
00354 #define LIBNET_DHCP_REPLY 0x2
00355 u_int8_t dhcp_htype;
00356 u_int8_t dhcp_hlen;
00357 u_int8_t dhcp_hopcount;
00358 u_int32_t dhcp_xid;
00359 u_int16_t dhcp_secs;
00360 u_int16_t dhcp_flags;
00361 u_int32_t dhcp_cip;
00362 u_int32_t dhcp_yip;
00363 u_int32_t dhcp_sip;
00364 u_int32_t dhcp_gip;
00365 u_int8_t dhcp_chaddr[16];
00366 u_int8_t dhcp_sname[64];
00367 u_int8_t dhcp_file[128];
00368 u_int32_t dhcp_magic;
00369 #define DHCP_MAGIC 0x63825363
00370 #define LIBNET_BOOTP_MIN_LEN 0x12c
00371 #define LIBNET_DHCP_PAD 0x00
00372 #define LIBNET_DHCP_SUBNETMASK 0x01
00373 #define LIBNET_DHCP_TIMEOFFSET 0x02
00374 #define LIBNET_DHCP_ROUTER 0x03
00375 #define LIBNET_DHCP_TIMESERVER 0x04
00376 #define LIBNET_DHCP_NAMESERVER 0x05
00377 #define LIBNET_DHCP_DNS 0x06
00378 #define LIBNET_DHCP_LOGSERV 0x07
00379 #define LIBNET_DHCP_COOKIESERV 0x08
00380 #define LIBNET_DHCP_LPRSERV 0x09
00381 #define LIBNET_DHCP_IMPSERV 0x0a
00382 #define LIBNET_DHCP_RESSERV 0x0b
00383 #define LIBNET_DHCP_HOSTNAME 0x0c
00384 #define LIBNET_DHCP_BOOTFILESIZE 0x0d
00385 #define LIBNET_DHCP_DUMPFILE 0x0e
00386 #define LIBNET_DHCP_DOMAINNAME 0x0f
00387 #define LIBNET_DHCP_SWAPSERV 0x10
00388 #define LIBNET_DHCP_ROOTPATH 0x11
00389 #define LIBNET_DHCP_EXTENPATH 0x12
00390 #define LIBNET_DHCP_IPFORWARD 0x13
00391 #define LIBNET_DHCP_SRCROUTE 0x14
00392 #define LIBNET_DHCP_POLICYFILTER 0x15
00393 #define LIBNET_DHCP_MAXASMSIZE 0x16
00394 #define LIBNET_DHCP_IPTTL 0x17
00395 #define LIBNET_DHCP_MTUTIMEOUT 0x18
00396 #define LIBNET_DHCP_MTUTABLE 0x19
00397 #define LIBNET_DHCP_MTUSIZE 0x1a
00398 #define LIBNET_DHCP_LOCALSUBNETS 0x1b
00399 #define LIBNET_DHCP_BROADCASTADDR 0x1c
00400 #define LIBNET_DHCP_DOMASKDISCOV 0x1d
00401 #define LIBNET_DHCP_MASKSUPPLY 0x1e
00402 #define LIBNET_DHCP_DOROUTEDISC 0x1f
00403 #define LIBNET_DHCP_ROUTERSOLICIT 0x20
00404 #define LIBNET_DHCP_STATICROUTE 0x21
00405 #define LIBNET_DHCP_TRAILERENCAP 0x22
00406 #define LIBNET_DHCP_ARPTIMEOUT 0x23
00407 #define LIBNET_DHCP_ETHERENCAP 0x24
00408 #define LIBNET_DHCP_TCPTTL 0x25
00409 #define LIBNET_DHCP_TCPKEEPALIVE 0x26
00410 #define LIBNET_DHCP_TCPALIVEGARBAGE 0x27
00411 #define LIBNET_DHCP_NISDOMAIN 0x28
00412 #define LIBNET_DHCP_NISSERVERS 0x29
00413 #define LIBNET_DHCP_NISTIMESERV 0x2a
00414 #define LIBNET_DHCP_VENDSPECIFIC 0x2b
00415 #define LIBNET_DHCP_NBNS 0x2c
00416 #define LIBNET_DHCP_NBDD 0x2d
00417 #define LIBNET_DHCP_NBTCPIP 0x2e
00418 #define LIBNET_DHCP_NBTCPSCOPE 0x2f
00419 #define LIBNET_DHCP_XFONT 0x30
00420 #define LIBNET_DHCP_XDISPLAYMGR 0x31
00421 #define LIBNET_DHCP_DISCOVERADDR 0x32
00422 #define LIBNET_DHCP_LEASETIME 0x33
00423 #define LIBNET_DHCP_OPTIONOVERLOAD 0x34
00424 #define LIBNET_DHCP_MESSAGETYPE 0x35
00425 #define LIBNET_DHCP_SERVIDENT 0x36
00426 #define LIBNET_DHCP_PARAMREQUEST 0x37
00427 #define LIBNET_DHCP_MESSAGE 0x38
00428 #define LIBNET_DHCP_MAXMSGSIZE 0x39
00429 #define LIBNET_DHCP_RENEWTIME 0x3a
00430 #define LIBNET_DHCP_REBINDTIME 0x3b
00431 #define LIBNET_DHCP_CLASSSID 0x3c
00432 #define LIBNET_DHCP_CLIENTID 0x3d
00433 #define LIBNET_DHCP_NISPLUSDOMAIN 0x40
00434 #define LIBNET_DHCP_NISPLUSSERVERS 0x41
00435 #define LIBNET_DHCP_MOBILEIPAGENT 0x44
00436 #define LIBNET_DHCP_SMTPSERVER 0x45
00437 #define LIBNET_DHCP_POP3SERVER 0x46
00438 #define LIBNET_DHCP_NNTPSERVER 0x47
00439 #define LIBNET_DHCP_WWWSERVER 0x48
00440 #define LIBNET_DHCP_FINGERSERVER 0x49
00441 #define LIBNET_DHCP_IRCSERVER 0x4a
00442 #define LIBNET_DHCP_STSERVER 0x4b
00443 #define LIBNET_DHCP_STDASERVER 0x4c
00444 #define LIBNET_DHCP_END 0xff
00445
00446 #define LIBNET_DHCP_MSGDISCOVER 0x01
00447 #define LIBNET_DHCP_MSGOFFER 0x02
00448 #define LIBNET_DHCP_MSGREQUEST 0x03
00449 #define LIBNET_DHCP_MSGDECLINE 0x04
00450 #define LIBNET_DHCP_MSGACK 0x05
00451 #define LIBNET_DHCP_MSGNACK 0x06
00452 #define LIBNET_DHCP_MSGRELEASE 0x07
00453 #define LIBNET_DHCP_MSGINFORM 0x08
00454 };
00455
00456
00457
00458 #define LIBNET_DNS_H LIBNET_UDP_DNSV4_H
00459
00460
00461
00462
00463
00464 struct libnet_dnsv4_hdr
00465 {
00466 u_int16_t h_len;
00467 u_int16_t id;
00468 u_int16_t flags;
00469 u_int16_t num_q;
00470 u_int16_t num_answ_rr;
00471 u_int16_t num_auth_rr;
00472 u_int16_t num_addi_rr;
00473 };
00474
00475 #define LIBNET_DNS_H LIBNET_UDP_DNSV4_H
00476 struct libnet_dnsv4udp_hdr
00477 {
00478 u_int16_t id;
00479 u_int16_t flags;
00480 u_int16_t num_q;
00481 u_int16_t num_answ_rr;
00482 u_int16_t num_auth_rr;
00483 u_int16_t num_addi_rr;
00484 };
00485
00486
00487
00488
00489
00490 struct libnet_ethernet_hdr
00491 {
00492 u_int8_t ether_dhost[ETHER_ADDR_LEN];
00493 u_int8_t ether_shost[ETHER_ADDR_LEN];
00494 u_int16_t ether_type;
00495 };
00496
00497 #ifndef ETHERTYPE_PUP
00498 #define ETHERTYPE_PUP 0x0200
00499 #endif
00500 #ifndef ETHERTYPE_IP
00501 #define ETHERTYPE_IP 0x0800
00502 #endif
00503 #ifndef ETHERTYPE_ARP
00504 #define ETHERTYPE_ARP 0x0806
00505 #endif
00506 #ifndef ETHERTYPE_REVARP
00507 #define ETHERTYPE_REVARP 0x8035
00508 #endif
00509 #ifndef ETHERTYPE_VLAN
00510 #define ETHERTYPE_VLAN 0x8100
00511 #endif
00512 #ifndef ETHERTYPE_EAP
00513 #define ETHERTYPE_EAP 0x888e
00514 #endif
00515 #ifndef ETHERTYPE_MPLS
00516 #define ETHERTYPE_MPLS 0x8847
00517 #endif
00518 #ifndef ETHERTYPE_LOOPBACK
00519 #define ETHERTYPE_LOOPBACK 0x9000
00520 #endif
00521
00522 struct libnet_ether_addr
00523 {
00524 u_int8_t ether_addr_octet[6];
00525 };
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536 struct libnet_fddi_hdr
00537 {
00538 u_int8_t fddi_frame_control;
00539 #define LIBNET_FDDI_LLC_FRAME 0x10
00540 #define LIBNET_FDDI_48BIT_ADDR 0x40
00541 #define LIBNET_FDDI_FC_REQD LIBNET_FDDI_LLC_FRAME | LIBNET_FDDI_48BIT_ADDR
00542 u_int8_t fddi_dhost[FDDI_ADDR_LEN];
00543 u_int8_t fddi_shost[FDDI_ADDR_LEN];
00544 u_int8_t fddi_llc_dsap;
00545 u_int8_t fddi_llc_ssap;
00546 u_int8_t fddi_llc_control_field;
00547 u_int8_t fddi_llc_org_code[LIBNET_ORG_CODE_SIZE];
00548 u_int8_t fddi_type;
00549 u_int8_t fddi_type1;
00550 #define FDDI_TYPE_IP 0x0800
00551 #define FDDI_TYPE_ARP 0x0806
00552 #define FDDI_TYPE_REVARP 0x8035
00553 };
00554
00555
00556 struct libnet_fddi_addr
00557 {
00558 u_int8_t fddi_addr_octet[6];
00559 };
00560
00561
00562
00563
00564
00565
00566
00567 struct libnet_gre_hdr
00568 {
00569 u_int16_t flags_ver;
00570 #define GRE_CSUM 0x8000
00571 #define GRE_ROUTING 0x4000
00572 #define GRE_KEY 0x2000
00573 #define GRE_SEQ 0x1000
00574 #define GRE_STRICT 0x0800
00575 #define GRE_REC 0x0700
00576 #define GRE_ACK 0x0080
00577
00578 #define GRE_FLAGS_MASK 0x00F8
00579 #define GRE_VERSION_MASK 0x0007
00580
00581 #define GRE_VERSION_0 0x0000
00582 #define GRE_VERSION_1 0x0001
00583
00584 u_int16_t type;
00585 #define GRE_SNA 0x0004
00586 #define GRE_OSI_NETWORK_LAYER 0x00FE
00587 #define GRE_PUP 0x0200
00588 #define GRE_XNS 0x0600
00589 #define GRE_IP 0x0800
00590 #define GRE_CHAOS 0x0804
00591 #define GRE_RFC_826_ARP 0x0806
00592 #define GRE_FRAME_RELAY_ARP 0x0808
00593 #define GRE_VINES 0x0BAD
00594 #define GRE_VINES_ECHO 0x0BAE
00595 #define GRE_VINES_LOOPBACK 0x0BAF
00596 #define GRE_DECNET 0x6003
00597 #define GRE_TRANSPARENT_ETHERNET_BRIDGING 0x6558
00598 #define GRE_RAW_FRAME_RELAY 0x6559
00599 #define GRE_APOLLO_DOMAIN 0x8019
00600 #define GRE_ETHERTALK 0x809B
00601 #define GRE_NOVELL_IPX 0x8137
00602 #define GRE_RFC_1144_TCP_IP_COMPRESSION 0x876B
00603 #define GRE_IP_AUTONOMOUS_SYSTEMS 0x876C
00604 #define GRE_SECURE_DATA 0x876D
00605 #define GRE_PPP 0x880b
00606
00607 union {
00608 struct {
00609 u_int16_t sum;
00610 u_int16_t offset;
00611 u_int32_t key;
00612 u_int32_t seq;
00613 } _gre;
00614
00615 struct {
00616 u_int16_t payload_s;
00617 u_int16_t callID;
00618 u_int32_t seq;
00619 u_int32_t ack;
00620 } _egre;
00621 }_data;
00622
00623 #define gre_sum _data._gre.sum
00624 #define gre_offset _data._gre.offset
00625 #define gre_key _data._gre.key
00626 #define gre_seq _data._gre.seq
00627
00628 #define egre_payload_s _data._egre.payload_s
00629 #define egre_callID _data._egre.callID
00630 #define egre_seq _data._egre.seq
00631 #define egre_ack _data._egre.ack
00632 };
00633
00634
00635 #ifndef IPPROTO_GRE
00636 #define IPPROTO_GRE 47
00637 #endif
00638
00639
00640
00641
00642
00643
00644 struct libnet_gre_sre_hdr
00645 {
00646 u_int16_t af;
00647 u_int8_t sre_offset;
00648 u_int8_t sre_length;
00649 u_int8_t *routing;
00650 };
00651
00652
00653
00654
00655
00656
00657
00658 struct libnet_ipv4_hdr
00659 {
00660 #if (LIBNET_LIL_ENDIAN)
00661 u_int8_t ip_hl:4,
00662 ip_v:4;
00663 #endif
00664 #if (LIBNET_BIG_ENDIAN)
00665 u_int8_t ip_v:4,
00666 ip_hl:4;
00667 #endif
00668 u_int8_t ip_tos;
00669 #ifndef IPTOS_LOWDELAY
00670 #define IPTOS_LOWDELAY 0x10
00671 #endif
00672 #ifndef IPTOS_THROUGHPUT
00673 #define IPTOS_THROUGHPUT 0x08
00674 #endif
00675 #ifndef IPTOS_RELIABILITY
00676 #define IPTOS_RELIABILITY 0x04
00677 #endif
00678 #ifndef IPTOS_LOWCOST
00679 #define IPTOS_LOWCOST 0x02
00680 #endif
00681 u_int16_t ip_len;
00682 u_int16_t ip_id;
00683 u_int16_t ip_off;
00684 #ifndef IP_RF
00685 #define IP_RF 0x8000
00686 #endif
00687 #ifndef IP_DF
00688 #define IP_DF 0x4000
00689 #endif
00690 #ifndef IP_MF
00691 #define IP_MF 0x2000
00692 #endif
00693 #ifndef IP_OFFMASK
00694 #define IP_OFFMASK 0x1fff
00695 #endif
00696 u_int8_t ip_ttl;
00697 u_int8_t ip_p;
00698 u_int16_t ip_sum;
00699 struct in_addr ip_src, ip_dst;
00700 };
00701
00702
00703
00704
00705 #ifndef IPOPT_EOL
00706 #define IPOPT_EOL 0
00707 #endif
00708 #ifndef IPOPT_NOP
00709 #define IPOPT_NOP 1
00710 #endif
00711 #ifndef IPOPT_RR
00712 #define IPOPT_RR 7
00713 #endif
00714 #ifndef IPOPT_TS
00715 #define IPOPT_TS 68
00716 #endif
00717 #ifndef IPOPT_SECURITY
00718 #define IPOPT_SECURITY 130
00719 #endif
00720 #ifndef IPOPT_LSRR
00721 #define IPOPT_LSRR 131
00722 #endif
00723 #ifndef IPOPT_SATID
00724 #define IPOPT_SATID 136
00725 #endif
00726 #ifndef IPOPT_SSRR
00727 #define IPOPT_SSRR 137
00728 #endif
00729
00730
00731
00732
00733 struct libnet_in6_addr
00734 {
00735 union
00736 {
00737 u_int8_t __u6_addr8[16];
00738 u_int16_t __u6_addr16[8];
00739 u_int32_t __u6_addr32[4];
00740 } __u6_addr;
00741 };
00742 #define libnet_s6_addr __u6_addr.__u6_addr8
00743
00744
00745
00746
00747
00748
00749 struct libnet_ipv6_hdr
00750 {
00751 u_int8_t ip_flags[4];
00752 u_int16_t ip_len;
00753 u_int8_t ip_nh;
00754 u_int8_t ip_hl;
00755 struct libnet_in6_addr ip_src, ip_dst;
00756
00757 };
00758
00759
00760
00761
00762
00763
00764 #define LIBNET_IPV6_NH_FRAGMENT 44
00765 struct libnet_ipv6_frag_hdr
00766 {
00767 u_int8_t ip_nh;
00768 u_int8_t ip_reserved;
00769 u_int16_t ip_frag;
00770 u_int32_t ip_id;
00771 };
00772
00773
00774
00775
00776
00777
00778 #define LIBNET_IPV6_NH_ROUTING 43
00779 struct libnet_ipv6_routing_hdr
00780 {
00781 u_int8_t ip_nh;
00782 u_int8_t ip_len;
00783 u_int8_t ip_rtype;
00784 u_int8_t ip_segments;
00785
00786 };
00787
00788
00789
00790
00791
00792
00793 #define LIBNET_IPV6_NH_DESTOPTS 60
00794 struct libnet_ipv6_destopts_hdr
00795 {
00796 u_int8_t ip_nh;
00797 u_int8_t ip_len;
00798
00799 };
00800
00801
00802
00803
00804
00805
00806 #define LIBNET_IPV6_NH_HBH 0
00807 struct libnet_ipv6_hbhopts_hdr
00808 {
00809 u_int8_t ip_nh;
00810 u_int8_t ip_len;
00811
00812 };
00813
00814
00815
00816
00817
00818
00819 #ifndef IPPROTO_ICMP6
00820 #define IPPROTO_ICMP6 0x3a
00821 #endif
00822 struct libnet_icmpv6_hdr
00823 {
00824 u_int8_t icmp_type;
00825 #ifndef ICMP6_ECHO
00826 #define ICMP6_ECHO 128
00827 #endif
00828 #ifndef ICMP6_ECHOREPLY
00829 #define ICMP6_ECHOREPLY 129
00830 #endif
00831 #ifndef ICMP6_UNREACH
00832 #define ICMP6_UNREACH 1
00833 #endif
00834 #ifndef ICMP6_PKTTOOBIG
00835 #define ICMP6_PKTTOOBIG 2
00836 #endif
00837 #ifndef ICMP6_TIMXCEED
00838 #define ICMP6_TIMXCEED 3
00839 #endif
00840 #ifndef ICMP6_PARAMPROB
00841 #define ICMP6_PARAMPROB 4
00842 #endif
00843 u_int8_t icmp_code;
00844 u_int16_t icmp_sum;
00845 u_int16_t id;
00846 u_int16_t seq;
00847 };
00848
00849
00850
00851
00852
00853
00854
00855
00856 struct libnet_icmpv4_hdr
00857 {
00858 u_int8_t icmp_type;
00859 #ifndef ICMP_ECHOREPLY
00860 #define ICMP_ECHOREPLY 0
00861 #endif
00862 #ifndef ICMP_UNREACH
00863 #define ICMP_UNREACH 3
00864 #endif
00865 #ifndef ICMP_SOURCEQUENCH
00866 #define ICMP_SOURCEQUENCH 4
00867 #endif
00868 #ifndef ICMP_REDIRECT
00869 #define ICMP_REDIRECT 5
00870 #endif
00871 #ifndef ICMP_ECHO
00872 #define ICMP_ECHO 8
00873 #endif
00874 #ifndef ICMP_ROUTERADVERT
00875 #define ICMP_ROUTERADVERT 9
00876 #endif
00877 #ifndef ICMP_ROUTERSOLICIT
00878 #define ICMP_ROUTERSOLICIT 10
00879 #endif
00880 #ifndef ICMP_TIMXCEED
00881 #define ICMP_TIMXCEED 11
00882 #endif
00883 #ifndef ICMP_PARAMPROB
00884 #define ICMP_PARAMPROB 12
00885 #endif
00886 #ifndef ICMP_TSTAMP
00887 #define ICMP_TSTAMP 13
00888 #endif
00889 #ifndef ICMP_TSTAMPREPLY
00890 #define ICMP_TSTAMPREPLY 14
00891 #endif
00892 #ifndef ICMP_IREQ
00893 #define ICMP_IREQ 15
00894 #endif
00895 #ifndef ICMP_IREQREPLY
00896 #define ICMP_IREQREPLY 16
00897 #endif
00898 #ifndef ICMP_MASKREQ
00899 #define ICMP_MASKREQ 17
00900 #endif
00901 #ifndef ICMP_MASKREPLY
00902 #define ICMP_MASKREPLY 18
00903 #endif
00904 u_int8_t icmp_code;
00905 #ifndef ICMP_UNREACH_NET
00906 #define ICMP_UNREACH_NET 0
00907 #endif
00908 #ifndef ICMP_UNREACH_HOST
00909 #define ICMP_UNREACH_HOST 1
00910 #endif
00911 #ifndef ICMP_UNREACH_PROTOCOL
00912 #define ICMP_UNREACH_PROTOCOL 2
00913 #endif
00914 #ifndef ICMP_UNREACH_PORT
00915 #define ICMP_UNREACH_PORT 3
00916 #endif
00917 #ifndef ICMP_UNREACH_NEEDFRAG
00918 #define ICMP_UNREACH_NEEDFRAG 4
00919 #endif
00920 #ifndef ICMP_UNREACH_SRCFAIL
00921 #define ICMP_UNREACH_SRCFAIL 5
00922 #endif
00923 #ifndef ICMP_UNREACH_NET_UNKNOWN
00924 #define ICMP_UNREACH_NET_UNKNOWN 6
00925 #endif
00926 #ifndef ICMP_UNREACH_HOST_UNKNOWN
00927 #define ICMP_UNREACH_HOST_UNKNOWN 7
00928 #endif
00929 #ifndef ICMP_UNREACH_ISOLATED
00930 #define ICMP_UNREACH_ISOLATED 8
00931 #endif
00932 #ifndef ICMP_UNREACH_NET_PROHIB
00933 #define ICMP_UNREACH_NET_PROHIB 9
00934 #endif
00935 #ifndef ICMP_UNREACH_HOST_PROHIB
00936 #define ICMP_UNREACH_HOST_PROHIB 10
00937 #endif
00938 #ifndef ICMP_UNREACH_TOSNET
00939 #define ICMP_UNREACH_TOSNET 11
00940 #endif
00941 #ifndef ICMP_UNREACH_TOSHOST
00942 #define ICMP_UNREACH_TOSHOST 12
00943 #endif
00944 #ifndef ICMP_UNREACH_FILTER_PROHIB
00945 #define ICMP_UNREACH_FILTER_PROHIB 13
00946 #endif
00947 #ifndef ICMP_UNREACH_HOST_PRECEDENCE
00948 #define ICMP_UNREACH_HOST_PRECEDENCE 14
00949 #endif
00950 #ifndef ICMP_UNREACH_PRECEDENCE_CUTOFF
00951 #define ICMP_UNREACH_PRECEDENCE_CUTOFF 15
00952 #endif
00953 #ifndef ICMP_REDIRECT_NET
00954 #define ICMP_REDIRECT_NET 0
00955 #endif
00956 #ifndef ICMP_REDIRECT_HOST
00957 #define ICMP_REDIRECT_HOST 1
00958 #endif
00959 #ifndef ICMP_REDIRECT_TOSNET
00960 #define ICMP_REDIRECT_TOSNET 2
00961 #endif
00962 #ifndef ICMP_REDIRECT_TOSHOST
00963 #define ICMP_REDIRECT_TOSHOST 3
00964 #endif
00965 #ifndef ICMP_TIMXCEED_INTRANS
00966 #define ICMP_TIMXCEED_INTRANS 0
00967 #endif
00968 #ifndef ICMP_TIMXCEED_REASS
00969 #define ICMP_TIMXCEED_REASS 1
00970 #endif
00971 #ifndef ICMP_PARAMPROB_OPTABSENT
00972 #define ICMP_PARAMPROB_OPTABSENT 1
00973 #endif
00974
00975 u_int16_t icmp_sum;
00976
00977 union
00978 {
00979 struct
00980 {
00981 u_int16_t id;
00982 u_int16_t seq;
00983 } echo;
00984
00985 #undef icmp_id
00986 #undef icmp_seq
00987 #define icmp_id hun.echo.id
00988 #define icmp_seq hun.echo.seq
00989
00990 u_int32_t gateway;
00991 struct
00992 {
00993 u_int16_t pad;
00994 u_int16_t mtu;
00995 } frag;
00996 } hun;
00997 union
00998 {
00999 struct
01000 {
01001 n_time its_otime;
01002 n_time its_rtime;
01003 n_time its_ttime;
01004 } ts;
01005 struct
01006 {
01007 struct libnet_ipv4_hdr idi_ip;
01008
01009 } ip;
01010 u_int32_t mask;
01011 int8_t data[1];
01012
01013 #undef icmp_mask
01014 #define icmp_mask dun.mask
01015 #undef icmp_data
01016 #define icmp_data dun.data
01017
01018 #undef icmp_otime
01019 #define icmp_otime dun.ts.its_otime
01020 #undef icmp_rtime
01021 #define icmp_rtime dun.ts.its_rtime
01022 #undef icmp_ttime
01023 #define icmp_ttime dun.ts.its_ttime
01024 }dun;
01025 };
01026
01027
01028
01029
01030
01031
01032
01033 struct libnet_igmp_hdr
01034 {
01035 u_int8_t igmp_type;
01036 #ifndef IGMP_MEMBERSHIP_QUERY
01037 #define IGMP_MEMBERSHIP_QUERY 0x11
01038 #endif
01039 #ifndef IGMP_V1_MEMBERSHIP_REPORT
01040 #define IGMP_V1_MEMBERSHIP_REPORT 0x12
01041 #endif
01042 #ifndef IGMP_V2_MEMBERSHIP_REPORT
01043 #define IGMP_V2_MEMBERSHIP_REPORT 0x16
01044 #endif
01045 #ifndef IGMP_LEAVE_GROUP
01046 #define IGMP_LEAVE_GROUP 0x17
01047 #endif
01048 u_int8_t igmp_code;
01049 u_int16_t igmp_sum;
01050 struct in_addr igmp_group;
01051 };
01052
01053
01054
01055
01056
01057
01058
01059
01060
01061 #ifndef IPPROTO_ESP
01062 #define IPPROTO_ESP 50
01063 #endif
01064 struct libnet_esp_hdr
01065 {
01066 u_int32_t esp_spi;
01067 u_int32_t esp_seq;
01068 u_int32_t esp_iv;
01069 };
01070
01071 struct libnet_esp_ftr
01072 {
01073 u_int8_t esp_pad_len;
01074 u_int8_t esp_nh;
01075 int8_t *esp_auth;
01076 };
01077
01078 #ifndef IPPROTO_AH
01079 #define IPPROTO_AH 51
01080 #endif
01081 struct libnet_ah_hdr
01082 {
01083 u_int8_t ah_nh;
01084 u_int8_t ah_len;
01085 u_int16_t ah_res;
01086 u_int32_t ah_spi;
01087 u_int32_t ah_seq;
01088 u_int32_t ah_auth;
01089 };
01090
01091
01092
01093
01094
01095
01096 #define LIBNET_PROTO_ISL 201
01097
01098
01099
01100
01101
01102 struct libnet_isl_hdr
01103 {
01104 u_int8_t isl_dhost[5];
01105 #if (LIBNET_LIL_ENDIAN)
01106 u_int8_t isl_type:4,
01107 isl_user:4;
01108 #endif
01109 #if (LIBNET_BIG_ENDIAN)
01110 u_int8_t isl_user:4,
01111 isl_type:4;
01112 #endif
01113 u_int8_t isl_shost[6];
01114 u_int16_t isl_len;
01115 u_int8_t isl_snap[6];
01116 u_int16_t isl_vid;
01117 u_int16_t isl_index;
01118 u_int16_t isl_reserved;
01119
01120 };
01121
01122 #ifndef IPPROTO_OSPF
01123 #define IPPROTO_OSPF 89
01124 #endif
01125 #define IPPROTO_OSPF_LSA 890
01126 #define LIBNET_MODX 4102
01127
01128
01129
01130
01131
01132 #define LIBNET_OPT_EBIT 0x02
01133 #define LIBNET_OPT_MCBIT 0x04
01134 #define LIBNET_OPT_NPBIT 0x08
01135 #define LIBNET_OPT_EABIT 0x10
01136 #define LIBNET_OPT_DCBIT 0x20
01137
01138
01139
01140
01141
01142
01143
01144 struct libnet_mpls_hdr
01145 {
01146 u_int32_t mpls_les;
01147 #define LIBNET_MPLS_BOS_ON 1
01148 #define LIBNET_MPLS_BOS_OFF 0
01149 };
01150
01151
01152
01153
01154
01155
01156 struct libnet_ntp_hdr_l_fp
01157 {
01158 u_int32_t integer;
01159 u_int32_t fraction;
01160 };
01161
01162 struct libnet_ntp_hdr_s_fp
01163 {
01164 u_int16_t integer;
01165 u_int16_t fraction;
01166 };
01167
01168
01169 struct libnet_ntp_hdr
01170 {
01171 u_int8_t ntp_li_vn_mode;
01172 #define LIBNET_NTP_LI_NW 0x0
01173 #define LIBNET_NTP_LI_AS 0x1
01174 #define LIBNET_NTP_LI_DS 0x2
01175 #define LIBNET_NTP_LI_AC 0x3
01176
01177 #define LIBNET_NTP_VN_2 0x2
01178 #define LIBNET_NTP_VN_3 0x3
01179 #define LIBNET_NTP_VN_4 0x4
01180
01181 #define LIBNET_NTP_MODE_R 0x0
01182 #define LIBNET_NTP_MODE_A 0x1
01183 #define LIBNET_NTP_MODE_P 0x2
01184 #define LIBNET_NTP_MODE_C 0x3
01185 #define LIBNET_NTP_MODE_S 0x4
01186 #define LIBNET_NTP_MODE_B 0x5
01187 #define LIBNET_NTP_MODE_RC 0x6
01188 #define LIBNET_NTP_MODE_RP 0x7
01189 u_int8_t ntp_stratum;
01190 #define LIBNET_NTP_STRATUM_UNAVAIL 0x0
01191 #define LIBNET_NTP_STRATUM_PRIMARY 0x1
01192
01193
01194 u_int8_t ntp_poll;
01195 u_int8_t ntp_precision;
01196 struct libnet_ntp_hdr_s_fp ntp_delay;
01197 struct libnet_ntp_hdr_s_fp ntp_dispersion;
01198 u_int32_t ntp_reference_id;
01199 #define LIBNET_NTP_REF_LOCAL 0x4c4f434c
01200 #define LIBNET_NTP_REF_PPS 0x50505300
01201 #define LIBNET_NTP_REF_ACTS 0x41435453
01202 #define LIBNET_NTP_REF_USNO 0x55534e4f
01203 #define LIBNET_NTP_REF_PTB 0x50544200
01204 #define LIBNET_NTP_REF_TDF 0x54444600
01205 #define LIBNET_NTP_REF_DCF 0x44434600
01206 #define LIBNET_NTP_REF_MSF 0x4d534600
01207 #define LIBNET_NTP_REF_WWV 0x57575600
01208 #define LIBNET_NTP_REF_WWVB 0x57575642
01209 #define LIBNET_NTP_REF_WWVH 0x57575648
01210 #define LIBNET_NTP_REF_CHU 0x43485500
01211 #define LIBNET_NTP_REF_LORC 0x4c4f5243
01212 #define LIBNET_NTP_REF_OMEG 0x4f4d4547
01213 #define LIBNET_NTP_REF_GPS 0x47505300
01214 #define LIBNET_NTP_REF_GOES 0x474f4553
01215 struct libnet_ntp_hdr_l_fp ntp_ref_ts;
01216 struct libnet_ntp_hdr_l_fp ntp_orig_ts;
01217 struct libnet_ntp_hdr_l_fp ntp_rec_ts;
01218 struct libnet_ntp_hdr_l_fp ntp_xmt_ts;
01219 };
01220
01221
01222
01223
01224
01225
01226
01227 struct libnet_ospf_hdr
01228 {
01229 u_int8_t ospf_v;
01230 #define OSPFVERSION 2
01231 u_int8_t ospf_type;
01232 #define LIBNET_OSPF_UMD 0
01233 #define LIBNET_OSPF_HELLO 1
01234 #define LIBNET_OSPF_DBD 2
01235 #define LIBNET_OSPF_LSR 3
01236 #define LIBNET_OSPF_LSU 4
01237 #define LIBNET_OSPF_LSA 5
01238 u_int16_t ospf_len;
01239 struct in_addr ospf_rtr_id;
01240 struct in_addr ospf_area_id;
01241 u_int16_t ospf_sum;
01242 u_int16_t ospf_auth_type;
01243 #define LIBNET_OSPF_AUTH_NULL 0
01244 #define LIBNET_OSPF_AUTH_SIMPLE 1
01245 #define LIBNET_OSPF_AUTH_MD5 2
01246 };
01247
01248
01249
01250
01251
01252
01253
01254 struct libnet_auth_hdr
01255 {
01256 u_int16_t ospf_auth_null;
01257 u_int8_t ospf_auth_keyid;
01258 u_int8_t ospf_auth_len;
01259 u_int ospf_auth_seq;
01260 };
01261
01262
01263
01264
01265
01266
01267
01268 struct libnet_ospf_hello_hdr
01269 {
01270 struct in_addr hello_nmask;
01271 u_int16_t hello_intrvl;
01272 u_int8_t hello_opts;
01273 u_int8_t hello_rtr_pri;
01274 u_int hello_dead_intvl;
01275 struct in_addr hello_des_rtr;
01276 struct in_addr hello_bkup_rtr;
01277 struct in_addr hello_nbr;
01278 };
01279
01280
01281
01282
01283
01284 struct libnet_dbd_hdr
01285 {
01286 u_int16_t dbd_mtu_len;
01287 u_int8_t dbd_opts;
01288 u_int8_t dbd_type;
01289 #define LIBNET_DBD_IBI 0x01
01290 #define LIBNET_DBD_MBIT 0x02
01291 #define LIBNET_DBD_MSBIT 0x04
01292 u_int dbd_seq;
01293 };
01294
01295
01296
01297
01298
01299 #define LIBNET_LS_TYPE_RTR 1
01300 #define LIBNET_LS_TYPE_NET 2
01301 #define LIBNET_LS_TYPE_IP 3
01302 #define LIBNET_LS_TYPE_ASBR 4
01303 #define LIBNET_LS_TYPE_ASEXT 5
01304
01305
01306
01307
01308
01309 struct libnet_lsr_hdr
01310 {
01311 u_int lsr_type;
01312 u_int lsr_lsid;
01313 struct in_addr lsr_adrtr;
01314 };
01315
01316
01317
01318
01319
01320 struct libnet_lsu_hdr
01321 {
01322 u_int lsu_num;
01323 };
01324
01325
01326
01327
01328
01329 struct libnet_lsa_hdr
01330 {
01331 u_int16_t lsa_age;
01332 u_int8_t lsa_opts;
01333 u_int8_t lsa_type;
01334 u_int lsa_id;
01335 struct in_addr lsa_adv;
01336 u_int lsa_seq;
01337 u_int16_t lsa_sum;
01338 u_int16_t lsa_len;
01339 };
01340
01341
01342
01343
01344
01345
01346
01347
01348 struct libnet_rtr_lsa_hdr
01349 {
01350 u_int16_t rtr_flags;
01351 #define LIBNET_RTR_FLAGS_W 0x0100
01352 #define LIBNET_RTR_FLAGS_E 0x0200
01353 #define LIBNET_RTR_FLAGS_B 0x0400
01354 u_int16_t rtr_num;
01355 u_int rtr_link_id;
01356 #define LIBNET_LINK_ID_NBR_ID 1
01357 #define LIBNET_LINK_ID_IP_DES 2
01358 #define LIBNET_LINK_ID_SUB 3
01359 u_int rtr_link_data;
01360 u_int8_t rtr_type;
01361 #define LIBNET_RTR_TYPE_PTP 1
01362 #define LIBNET_RTR_TYPE_TRANS 2
01363 #define LIBNET_RTR_TYPE_STUB 3
01364 #define RTR_TYPE_VRTL 4
01365 u_int8_t rtr_tos_num;
01366 u_int16_t rtr_metric;
01367 };
01368
01369
01370
01371
01372
01373 struct libnet_net_lsa_hdr
01374 {
01375 struct in_addr net_nmask;
01376 u_int net_rtr_id;
01377 };
01378
01379
01380
01381
01382
01383 struct libnet_sum_lsa_hdr
01384 {
01385 struct in_addr sum_nmask;
01386 u_int sum_metric;
01387 u_int sum_tos_metric;
01388 };
01389
01390
01391
01392
01393
01394
01395 struct libnet_as_lsa_hdr
01396 {
01397 struct in_addr as_nmask;
01398 u_int as_metric;
01399 #define LIBNET_AS_E_BIT_ON 0x80000000
01400 struct in_addr as_fwd_addr;
01401 u_int as_rte_tag;
01402 };
01403
01404
01405
01406
01407
01408
01409
01410 struct libnet_rip_hdr
01411 {
01412 u_int8_t rip_cmd;
01413 #define RIPCMD_REQUEST 1
01414 #define RIPCMD_RESPONSE 2
01415 #define RIPCMD_TRACEON 3
01416 #define RIPCMD_TRACEOFF 4
01417 #define RIPCMD_POLL 5
01418 #define RIPCMD_POLLENTRY 6
01419 #define RIPCMD_MAX 7
01420 u_int8_t rip_ver;
01421 #define RIPVER_0 0
01422 #define RIPVER_1 1
01423 #define RIPVER_2 2
01424 u_int16_t rip_rd;
01425 u_int16_t rip_af;
01426 u_int16_t rip_rt;
01427 u_int32_t rip_addr;
01428 u_int32_t rip_mask;
01429 u_int32_t rip_next_hop;
01430 u_int32_t rip_metric;
01431 };
01432
01433
01434
01435
01436
01437 #define LIBNET_RPC_CALL 0
01438 #define LIBNET_RPC_REPLY 1
01439 #define LIBNET_RPC_VERS 2
01440 #define LIBNET_RPC_LAST_FRAG 0x80000000
01441
01442
01443
01444
01445 #define LIBNET_PMAP_PROGRAM 100000
01446 #define LIBNET_PMAP_PROC_NULL 0
01447 #define LIBNET_PMAP_PROC_SET 1
01448 #define LIBNET_PMAP_PROC_UNSET 2
01449 #define LIBNET_PMAP_PROC_GETADDR 3
01450 #define LIBNET_PMAP_PROC_DUMP 4
01451 #define LIBNET_PMAP_PROC_CALLIT 5
01452 #define LIBNET_PMAP_PROC_BCAST 5
01453 #define LIBNET_PMAP_PROC_GETTIME 6
01454 #define LIBNET_PMAP_PROC_UADDR2TADDR 7
01455 #define LIBNET_PMAP_PROC_TADDR2UADDR 8
01456 #define LIBNET_PMAP_PROC_GETVERSADDR 9
01457 #define LIBNET_PMAP_PROC_INDIRECT 10
01458 #define LIBNET_PMAP_PROC_GETADDRLIST 11
01459 #define LIBNET_PMAP_PROC_GETSTAT 12
01460
01461
01462
01463 struct libnet_rpc_opaque_auth
01464 {
01465 u_int32_t rpc_auth_flavor;
01466 u_int32_t rpc_auth_length;
01467 #if 0
01468 u_int8_t *rpc_auth_data;
01469 #endif
01470 };
01471
01472 struct libnet_rpc_call
01473 {
01474 u_int32_t rpc_rpcvers;
01475 u_int32_t rpc_prognum;
01476 u_int32_t rpc_vers;
01477 u_int32_t rpc_procedure;
01478 struct libnet_rpc_opaque_auth rpc_credentials;
01479 struct libnet_rpc_opaque_auth rpc_verifier;
01480 };
01481
01482 struct libnet_rpc_call_hdr
01483 {
01484 u_int32_t rpc_xid;
01485 u_int32_t rpc_type;
01486 struct libnet_rpc_call rpc_call;
01487 };
01488
01489 struct libnet_rpc_call_tcp_hdr
01490 {
01491 u_int32_t rpc_record_marking;
01492 struct libnet_rpc_call_hdr rpc_common;
01493 };
01494
01495
01496
01497
01498
01499
01500 struct libnet_stp_conf_hdr
01501 {
01502 u_int16_t stp_id;
01503 u_int8_t stp_version;
01504 u_int8_t stp_bpdu_type;
01505 u_int8_t stp_flags;
01506 u_int8_t stp_rootid[8];
01507 u_int32_t stp_rootpc;
01508 u_int8_t stp_bridgeid[8];
01509 u_int16_t stp_portid;
01510 u_int16_t stp_mage;
01511 u_int16_t stp_maxage;
01512 u_int16_t stp_hellot;
01513 u_int16_t stp_fdelay;
01514 };
01515
01516
01517
01518
01519
01520
01521
01522 struct libnet_stp_tcn_hdr
01523 {
01524 u_int16_t stp_id;
01525 u_int8_t stp_version;
01526 u_int8_t stp_bpdu_type;
01527 };
01528
01529
01530
01531
01532
01533
01534
01535 struct libnet_tcp_hdr
01536 {
01537 u_int16_t th_sport;
01538 u_int16_t th_dport;
01539 u_int32_t th_seq;
01540 u_int32_t th_ack;
01541 #if (LIBNET_LIL_ENDIAN)
01542 u_int8_t th_x2:4,
01543 th_off:4;
01544 #endif
01545 #if (LIBNET_BIG_ENDIAN)
01546 u_int8_t th_off:4,
01547 th_x2:4;
01548 #endif
01549 u_int8_t th_flags;
01550 #ifndef TH_FIN
01551 #define TH_FIN 0x01
01552 #endif
01553 #ifndef TH_SYN
01554 #define TH_SYN 0x02
01555 #endif
01556 #ifndef TH_RST
01557 #define TH_RST 0x04
01558 #endif
01559 #ifndef TH_PUSH
01560 #define TH_PUSH 0x08
01561 #endif
01562 #ifndef TH_ACK
01563 #define TH_ACK 0x10
01564 #endif
01565 #ifndef TH_URG
01566 #define TH_URG 0x20
01567 #endif
01568 #ifndef TH_ECE
01569 #define TH_ECE 0x40
01570 #endif
01571 #ifndef TH_CWR
01572 #define TH_CWR 0x80
01573 #endif
01574 u_int16_t th_win;
01575 u_int16_t th_sum;
01576 u_int16_t th_urp;
01577 };
01578
01579
01580
01581
01582 struct libnet_token_ring_hdr
01583 {
01584 u_int8_t token_ring_access_control;
01585 #define LIBNET_TOKEN_RING_FRAME 0x10
01586 u_int8_t token_ring_frame_control;
01587 #define LIBNET_TOKEN_RING_LLC_FRAME 0x40
01588 u_int8_t token_ring_dhost[TOKEN_RING_ADDR_LEN];
01589 u_int8_t token_ring_shost[TOKEN_RING_ADDR_LEN];
01590 u_int8_t token_ring_llc_dsap;
01591 u_int8_t token_ring_llc_ssap;
01592 u_int8_t token_ring_llc_control_field;
01593 u_int8_t token_ring_llc_org_code[LIBNET_ORG_CODE_SIZE];
01594 u_int16_t token_ring_type;
01595 #define TOKEN_RING_TYPE_IP 0x0800
01596 #define TOKEN_RING_TYPE_ARP 0x0806
01597 #define TOKEN_RING_TYPE_REVARP 0x8035
01598 };
01599
01600 struct libnet_token_ring_addr
01601 {
01602 u_int8_t token_ring_addr_octet[6];
01603 };
01604
01605
01606
01607
01608
01609
01610 struct libnet_udp_hdr
01611 {
01612 u_int16_t uh_sport;
01613 u_int16_t uh_dport;
01614 u_int16_t uh_ulen;
01615 u_int16_t uh_sum;
01616 };
01617
01618
01619
01620
01621
01622 struct libnet_sebek_hdr
01623 {
01624 u_int32_t magic;
01625 u_int16_t version;
01626 #define SEBEK_PROTO_VERSION 1
01627 u_int16_t type;
01628 #define SEBEK_TYPE_READ 0
01629 #define SEBEK_TYPE_WRITE 1
01630 u_int32_t counter;
01631 u_int32_t time_sec;
01632 u_int32_t time_usec;
01633 u_int32_t pid;
01634 u_int32_t uid;
01635 u_int32_t fd;
01636 #define SEBEK_CMD_LENGTH 12
01637 u_int8_t cmd[SEBEK_CMD_LENGTH];
01638 u_int32_t length;
01639 };
01640
01641
01642
01643
01644
01645
01646
01647 #ifndef IPPROTO_VRRP
01648 #define IPPROTO_VRRP 112
01649 #endif
01650 struct libnet_vrrp_hdr
01651 {
01652 #if (LIBNET_LIL_ENDIAN)
01653 u_int8_t vrrp_v:4,
01654 vrrp_t:4;
01655 #endif
01656 #if (LIBNET_BIG_ENDIAN)
01657 u_int8_t vrrp_t:4,
01658 vrrp_v:4;
01659 #endif
01660 #define LIBNET_VRRP_VERSION_01 0x1
01661 #define LIBNET_VRRP_VERSION_02 0x2
01662 #define LIBNET_VRRP_TYPE_ADVERT 0x1
01663 u_int8_t vrrp_vrouter_id;
01664 u_int8_t vrrp_priority;
01665 u_int8_t vrrp_ip_count;
01666 u_int8_t vrrp_auth_type;
01667 #define LIBNET_VRRP_AUTH_NONE 0x1
01668 #define LIBNET_VRRP_AUTH_PASSWD 0x2
01669 #define LIBNET_VRRP_AUTH_IPAH 0x3
01670 u_int8_t vrrp_advert_int;
01671 u_int16_t vrrp_sum;
01672
01673
01674 };
01675
01676
01677
01678
01679
01680
01681 struct libnet_hsrp_hdr
01682 {
01683 #define LIBNET_HSRP_VERSION 0x0
01684 u_int8_t version;
01685 #define LIBNET_HSRP_TYPE_HELLO 0x0
01686 #define LIBNET_HSRP_TYPE_COUP 0x1
01687 #define LIBNET_HSRP_TYPE_RESIGN 0x2
01688 u_int8_t opcode;
01689 #define LIBNET_HSRP_STATE_INITIAL 0x0
01690 #define LIBNET_HSRP_STATE_LEARN 0x1
01691 #define LIBNET_HSRP_STATE_LISTEN 0x2
01692 #define LIBNET_HSRP_STATE_SPEAK 0x4
01693 #define LIBNET_HSRP_STATE_STANDBY 0x8
01694 #define LIBNET_HSRP_STATE_ACTIVE 0x10
01695 u_int8_t state;
01696 u_int8_t hello_time;
01697 u_int8_t hold_time;
01698 u_int8_t priority;
01699 u_int8_t group;
01700 u_int8_t reserved;
01701 #define HSRP_AUTHDATA_LENGTH 8
01702 u_int8_t authdata[HSRP_AUTHDATA_LENGTH];
01703 u_int32_t virtual_ip;
01704 };
01705
01706 #endif
01707
01708