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