32 #ifndef __LIBNET_STRUCTURES_H 
   33 #define __LIBNET_STRUCTURES_H 
   35 #if ((__WIN32__) && !(__CYGWIN__)) 
   40 typedef struct libnet_port_list_chain libnet_plist_t;
 
   41 struct libnet_port_list_chain
 
   54 #if (!defined(__WIN32__) || (__CYGWIN__)) 
   55     uint64_t packets_sent;             
 
   56     uint64_t packet_errors;            
 
   57     uint64_t bytes_written;            
 
   60     __int64 packet_errors;              
 
   61     __int64 bytes_written;              
 
   70 typedef int32_t libnet_ptag_t;
 
   71 #define LIBNET_PTAG_INITIALIZER         0 
   77 struct libnet_protocol_block
 
   97 #define LIBNET_PBLOCK_ARP_H             0x01     
   98 #define LIBNET_PBLOCK_DHCPV4_H          0x02     
   99 #define LIBNET_PBLOCK_DNSV4_H           0x03     
  100 #define LIBNET_PBLOCK_ETH_H             0x04     
  101 #define LIBNET_PBLOCK_ICMPV4_H          0x05     
  102 #define LIBNET_PBLOCK_ICMPV4_ECHO_H     0x06     
  103 #define LIBNET_PBLOCK_ICMPV4_MASK_H     0x07     
  104 #define LIBNET_PBLOCK_ICMPV4_UNREACH_H  0x08     
  105 #define LIBNET_PBLOCK_ICMPV4_TIMXCEED_H 0x09     
  106 #define LIBNET_PBLOCK_ICMPV4_REDIRECT_H 0x0a     
  107 #define LIBNET_PBLOCK_ICMPV4_TS_H       0x0b     
  108 #define LIBNET_PBLOCK_IGMP_H            0x0c     
  109 #define LIBNET_PBLOCK_IPV4_H            0x0d     
  110 #define LIBNET_PBLOCK_IPO_H             0x0e     
  111 #define LIBNET_PBLOCK_IPDATA            0x0f     
  112 #define LIBNET_PBLOCK_OSPF_H            0x10     
  113 #define LIBNET_PBLOCK_OSPF_HELLO_H      0x11     
  114 #define LIBNET_PBLOCK_OSPF_DBD_H        0x12     
  115 #define LIBNET_PBLOCK_OSPF_LSR_H        0x13     
  116 #define LIBNET_PBLOCK_OSPF_LSU_H        0x14     
  117 #define LIBNET_PBLOCK_OSPF_LSA_H        0x15     
  118 #define LIBNET_PBLOCK_OSPF_AUTH_H       0x16     
  119 #define LIBNET_PBLOCK_OSPF_CKSUM        0x17     
  120 #define LIBNET_PBLOCK_LS_RTR_H          0x18     
  121 #define LIBNET_PBLOCK_LS_NET_H          0x19     
  122 #define LIBNET_PBLOCK_LS_SUM_H          0x1a     
  123 #define LIBNET_PBLOCK_LS_AS_EXT_H       0x1b     
  124 #define LIBNET_PBLOCK_NTP_H             0x1c     
  125 #define LIBNET_PBLOCK_RIP_H             0x1d     
  126 #define LIBNET_PBLOCK_TCP_H             0x1e     
  127 #define LIBNET_PBLOCK_TCPO_H            0x1f     
  128 #define LIBNET_PBLOCK_TCPDATA           0x20     
  129 #define LIBNET_PBLOCK_UDP_H             0x21     
  130 #define LIBNET_PBLOCK_VRRP_H            0x22     
  131 #define LIBNET_PBLOCK_DATA_H            0x23     
  132 #define LIBNET_PBLOCK_CDP_H             0x24     
  133 #define LIBNET_PBLOCK_IPSEC_ESP_HDR_H   0x25     
  134 #define LIBNET_PBLOCK_IPSEC_ESP_FTR_H   0x26     
  135 #define LIBNET_PBLOCK_IPSEC_AH_H        0x27     
  136 #define LIBNET_PBLOCK_802_1Q_H          0x28     
  137 #define LIBNET_PBLOCK_802_2_H           0x29     
  138 #define LIBNET_PBLOCK_802_2SNAP_H       0x2a     
  139 #define LIBNET_PBLOCK_802_3_H           0x2b     
  140 #define LIBNET_PBLOCK_STP_CONF_H        0x2c     
  141 #define LIBNET_PBLOCK_STP_TCN_H         0x2d     
  142 #define LIBNET_PBLOCK_ISL_H             0x2e     
  143 #define LIBNET_PBLOCK_IPV6_H            0x2f     
  144 #define LIBNET_PBLOCK_802_1X_H          0x30     
  145 #define LIBNET_PBLOCK_RPC_CALL_H        0x31     
  146 #define LIBNET_PBLOCK_MPLS_H            0x32     
  147 #define LIBNET_PBLOCK_FDDI_H            0x33     
  148 #define LIBNET_PBLOCK_TOKEN_RING_H      0x34     
  149 #define LIBNET_PBLOCK_BGP4_HEADER_H     0x35     
  150 #define LIBNET_PBLOCK_BGP4_OPEN_H       0x36     
  151 #define LIBNET_PBLOCK_BGP4_UPDATE_H     0x37     
  152 #define LIBNET_PBLOCK_BGP4_NOTIFICATION_H 0x38   
  153 #define LIBNET_PBLOCK_GRE_H             0x39     
  154 #define LIBNET_PBLOCK_GRE_SRE_H         0x3a     
  155 #define LIBNET_PBLOCK_IPV6_FRAG_H       0x3b     
  156 #define LIBNET_PBLOCK_IPV6_ROUTING_H    0x3c     
  157 #define LIBNET_PBLOCK_IPV6_DESTOPTS_H   0x3d     
  158 #define LIBNET_PBLOCK_IPV6_HBHOPTS_H    0x3e     
  159 #define LIBNET_PBLOCK_SEBEK_H           0x3f     
  160 #define LIBNET_PBLOCK_HSRP_H            0x40     
  161 #define LIBNET_PBLOCK_ICMPV6_H          0x41     
  162 #define LIBNET_PBLOCK_ICMPV6_ECHO_H     0x46     
  163 #define LIBNET_PBLOCK_ICMPV6_UNREACH_H  0x42     
  164 #define LIBNET_PBLOCK_ICMPV6_NDP_NSOL_H 0x43     
  165 #define LIBNET_PBLOCK_ICMPV6_NDP_NADV_H 0x44     
  166 #define LIBNET_PBLOCK_ICMPV6_NDP_OPT_H  0x45     
  169 #define LIBNET_PBLOCK_DO_CHECKSUM       0x01     
  175     struct libnet_protocol_block *next; 
 
  176     struct libnet_protocol_block *prev; 
 
  178 typedef struct libnet_protocol_block libnet_pblock_t;
 
  186 struct libnet_context
 
  188 #if ((__WIN32__) && !(__CYGWIN__))  
  195 #define LIBNET_NONE     0xf8             
  196 #define LIBNET_LINK     0x00             
  197 #define LIBNET_RAW4     0x01             
  198 #define LIBNET_RAW6     0x02             
  200 #define LIBNET_LINK_ADV 0x08             
  201 #define LIBNET_RAW4_ADV 0x09             
  202 #define LIBNET_RAW6_ADV 0x0a             
  203 #define LIBNET_ADV_MASK 0x08             
  206     libnet_pblock_t *protocol_blocks;   
 
  207     libnet_pblock_t *pblock_end;        
 
  218 # define DLT_EN10MB      1        
  221 # define DLT_IEEE802     6        
  229     libnet_ptag_t ptag_state;           
 
  230     char label[LIBNET_LABEL_SIZE];      
 
  235 typedef struct libnet_context libnet_t;
 
  242 typedef struct _libnet_context_queue libnet_cq_t;
 
  243 struct _libnet_context_queue
 
  250 struct _libnet_context_queue_descriptor
 
  254     libnet_cq_t *current;               
 
  256 typedef struct _libnet_context_queue_descriptor libnet_cqd_t;