<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>libnet: libnet-structures.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.3 --> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <h1>libnet-structures.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> * $Id: libnet-structures.h,v 1.19 2004/11/09 07:05:07 mike Exp $</span> <a name="l00003"></a>00003 <span class="comment"> *</span> <a name="l00004"></a>00004 <span class="comment"> * libnet-structures.h - Network routine library structures header file</span> <a name="l00005"></a>00005 <span class="comment"> *</span> <a name="l00006"></a>00006 <span class="comment"> * Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com></span> <a name="l00007"></a>00007 <span class="comment"> * All rights reserved.</span> <a name="l00008"></a>00008 <span class="comment"> *</span> <a name="l00009"></a>00009 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span> <a name="l00010"></a>00010 <span class="comment"> * modification, are permitted provided that the following conditions</span> <a name="l00011"></a>00011 <span class="comment"> * are met:</span> <a name="l00012"></a>00012 <span class="comment"> * 1. Redistributions of source code must retain the above copyright</span> <a name="l00013"></a>00013 <span class="comment"> * notice, this list of conditions and the following disclaimer.</span> <a name="l00014"></a>00014 <span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span> <a name="l00015"></a>00015 <span class="comment"> * notice, this list of conditions and the following disclaimer in the</span> <a name="l00016"></a>00016 <span class="comment"> * documentation and/or other materials provided with the distribution.</span> <a name="l00017"></a>00017 <span class="comment"> *</span> <a name="l00018"></a>00018 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND</span> <a name="l00019"></a>00019 <span class="comment"> * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span> <a name="l00020"></a>00020 <span class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span> <a name="l00021"></a>00021 <span class="comment"> * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE</span> <a name="l00022"></a>00022 <span class="comment"> * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL</span> <a name="l00023"></a>00023 <span class="comment"> * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS</span> <a name="l00024"></a>00024 <span class="comment"> * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span> <a name="l00025"></a>00025 <span class="comment"> * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT</span> <a name="l00026"></a>00026 <span class="comment"> * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY</span> <a name="l00027"></a>00027 <span class="comment"> * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</span> <a name="l00028"></a>00028 <span class="comment"> * SUCH DAMAGE.</span> <a name="l00029"></a>00029 <span class="comment"> *</span> <a name="l00030"></a>00030 <span class="comment"> */</span> <a name="l00031"></a>00031 <a name="l00032"></a>00032 <span class="preprocessor">#ifndef __LIBNET_STRUCTURES_H</span> <a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#define __LIBNET_STRUCTURES_H</span> <a name="l00034"></a>00034 <span class="preprocessor"></span> <a name="l00035"></a>00035 <span class="preprocessor">#if ((__WIN32__) && !(__CYGWIN__))</span> <a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#include "Packet32.h"</span> <a name="l00037"></a>00037 <span class="preprocessor">#endif</span> <a name="l00038"></a>00038 <span class="preprocessor"></span> <a name="l00039"></a>00039 <span class="comment">/* port list chain structure */</span> <a name="l00040"></a>00040 <span class="keyword">typedef</span> <span class="keyword">struct </span>libnet_port_list_chain libnet_plist_t; <a name="l00041"></a>00041 <span class="keyword">struct </span>libnet_port_list_chain <a name="l00042"></a>00042 { <a name="l00043"></a>00043 u_int16_t node; <span class="comment">/* node number */</span> <a name="l00044"></a>00044 u_int16_t bport; <span class="comment">/* beggining port */</span> <a name="l00045"></a>00045 u_int16_t eport; <span class="comment">/* terminating port */</span> <a name="l00046"></a>00046 u_int8_t id; <span class="comment">/* global array offset */</span> <a name="l00047"></a>00047 libnet_plist_t *next; <span class="comment">/* next node in the list */</span> <a name="l00048"></a>00048 }; <a name="l00049"></a>00049 <a name="l00050"></a>00050 <a name="l00051"></a>00051 <span class="comment">/* libnet statistics structure */</span> <a name="l00052"></a>00052 <span class="keyword">struct </span><a class="code" href="libnet-functions_8h.html#886dc359d6add4b0608e8611af7e1b35">libnet_stats</a> <a name="l00053"></a>00053 { <a name="l00054"></a>00054 <span class="preprocessor">#if (!defined(__WIN32__) || (__CYGWIN__))</span> <a name="l00055"></a>00055 <span class="preprocessor"></span> u_int64_t packets_sent; <span class="comment">/* packets sent */</span> <a name="l00056"></a>00056 u_int64_t packet_errors; <span class="comment">/* packets errors */</span> <a name="l00057"></a>00057 u_int64_t bytes_written; <span class="comment">/* bytes written */</span> <a name="l00058"></a>00058 <span class="preprocessor">#else</span> <a name="l00059"></a>00059 <span class="preprocessor"></span> __int64 packets_sent; <span class="comment">/* packets sent */</span> <a name="l00060"></a>00060 __int64 packet_errors; <span class="comment">/* packets errors */</span> <a name="l00061"></a>00061 __int64 bytes_written; <span class="comment">/* bytes written */</span> <a name="l00062"></a>00062 <span class="preprocessor">#endif</span> <a name="l00063"></a>00063 <span class="preprocessor"></span>}; <a name="l00064"></a>00064 <a name="l00065"></a>00065 <a name="l00066"></a>00066 <span class="comment">/*</span> <a name="l00067"></a>00067 <span class="comment"> * Libnet ptags are how we identify specific protocol blocks inside the</span> <a name="l00068"></a>00068 <span class="comment"> * list.</span> <a name="l00069"></a>00069 <span class="comment"> */</span> <a name="l00070"></a>00070 <span class="keyword">typedef</span> int32_t libnet_ptag_t; <a name="l00071"></a>00071 <span class="preprocessor">#define LIBNET_PTAG_INITIALIZER 0</span> <a name="l00072"></a>00072 <span class="preprocessor"></span> <a name="l00073"></a>00073 <a name="l00074"></a>00074 <span class="comment">/*</span> <a name="l00075"></a>00075 <span class="comment"> * Libnet generic protocol block memory object. Sort of a poor man's mbuf.</span> <a name="l00076"></a>00076 <span class="comment"> */</span> <a name="l00077"></a>00077 <span class="keyword">struct </span>libnet_protocol_block <a name="l00078"></a>00078 { <a name="l00079"></a>00079 u_int8_t *buf; <span class="comment">/* protocol buffer */</span> <a name="l00080"></a>00080 u_int32_t b_len; <span class="comment">/* length of buf */</span> <a name="l00081"></a>00081 u_int16_t h_len; <span class="comment">/* header length (for checksumming) */</span> <a name="l00082"></a>00082 <span class="comment">/* Unused for IPV4_H block types.</span> <a name="l00083"></a>00083 <span class="comment"> * For protocols that sit on top of IP, it should be the the amount of</span> <a name="l00084"></a>00084 <span class="comment"> * buf that is the header, and will be included in the checksum.</span> <a name="l00085"></a>00085 <span class="comment"> */</span> <a name="l00086"></a>00086 u_int32_t ip_offset; <span class="comment">/* offset from end of pkt to beginning of IP header for csums */</span> <a name="l00087"></a>00087 <span class="comment">/* Unused for IPV4_H block types.</span> <a name="l00088"></a>00088 <span class="comment"> * For protocols that sit on top of IP (UDP, ICMP, ...), they often</span> <a name="l00089"></a>00089 <span class="comment"> * include some information from the IP header (in the form of a "pseudo</span> <a name="l00090"></a>00090 <span class="comment"> * header") in their own checksum calculation. To build that</span> <a name="l00091"></a>00091 <span class="comment"> * pseudo-header, thet need to find the real header.</span> <a name="l00092"></a>00092 <span class="comment"> */</span> <a name="l00093"></a>00093 u_int32_t copied; <span class="comment">/* bytes copied - the amount of data copied into buf */</span> <a name="l00094"></a>00094 <span class="comment">/* Used and updated by libnet_pblock_append(). */</span> <a name="l00095"></a>00095 u_int8_t type; <span class="comment">/* type of pblock */</span> <a name="l00096"></a>00096 <span class="comment">/* this needs to be updated every time a new packet builder is added */</span> <a name="l00097"></a>00097 <span class="preprocessor">#define LIBNET_PBLOCK_ARP_H 0x01 </span><span class="comment">/* ARP header */</span> <a name="l00098"></a>00098 <span class="preprocessor">#define LIBNET_PBLOCK_DHCPV4_H 0x02 </span><span class="comment">/* DHCP v4 header */</span> <a name="l00099"></a>00099 <span class="preprocessor">#define LIBNET_PBLOCK_DNSV4_H 0x03 </span><span class="comment">/* DNS v4 header */</span> <a name="l00100"></a>00100 <span class="preprocessor">#define LIBNET_PBLOCK_ETH_H 0x04 </span><span class="comment">/* Ethernet header */</span> <a name="l00101"></a>00101 <span class="preprocessor">#define LIBNET_PBLOCK_ICMPV4_H 0x05 </span><span class="comment">/* ICMP v4 base header */</span> <a name="l00102"></a>00102 <span class="preprocessor">#define LIBNET_PBLOCK_ICMPV4_ECHO_H 0x06 </span><span class="comment">/* ICMP v4 echo header */</span> <a name="l00103"></a>00103 <span class="preprocessor">#define LIBNET_PBLOCK_ICMPV4_MASK_H 0x07 </span><span class="comment">/* ICMP v4 mask header */</span> <a name="l00104"></a>00104 <span class="preprocessor">#define LIBNET_PBLOCK_ICMPV4_UNREACH_H 0x08 </span><span class="comment">/* ICMP v4 unreach header */</span> <a name="l00105"></a>00105 <span class="preprocessor">#define LIBNET_PBLOCK_ICMPV4_TIMXCEED_H 0x09 </span><span class="comment">/* ICMP v4 exceed header */</span> <a name="l00106"></a>00106 <span class="preprocessor">#define LIBNET_PBLOCK_ICMPV4_REDIRECT_H 0x0a </span><span class="comment">/* ICMP v4 redirect header */</span> <a name="l00107"></a>00107 <span class="preprocessor">#define LIBNET_PBLOCK_ICMPV4_TS_H 0x0b </span><span class="comment">/* ICMP v4 timestamp header */</span> <a name="l00108"></a>00108 <span class="preprocessor">#define LIBNET_PBLOCK_IGMP_H 0x0c </span><span class="comment">/* IGMP header */</span> <a name="l00109"></a>00109 <span class="preprocessor">#define LIBNET_PBLOCK_IPV4_H 0x0d </span><span class="comment">/* IP v4 header */</span> <a name="l00110"></a>00110 <span class="preprocessor">#define LIBNET_PBLOCK_IPO_H 0x0e </span><span class="comment">/* IP v4 options */</span> <a name="l00111"></a>00111 <span class="preprocessor">#define LIBNET_PBLOCK_IPDATA 0x0f </span><span class="comment">/* IP data */</span> <a name="l00112"></a>00112 <span class="preprocessor">#define LIBNET_PBLOCK_OSPF_H 0x10 </span><span class="comment">/* OSPF base header */</span> <a name="l00113"></a>00113 <span class="preprocessor">#define LIBNET_PBLOCK_OSPF_HELLO_H 0x11 </span><span class="comment">/* OSPF hello header */</span> <a name="l00114"></a>00114 <span class="preprocessor">#define LIBNET_PBLOCK_OSPF_DBD_H 0x12 </span><span class="comment">/* OSPF dbd header */</span> <a name="l00115"></a>00115 <span class="preprocessor">#define LIBNET_PBLOCK_OSPF_LSR_H 0x13 </span><span class="comment">/* OSPF lsr header */</span> <a name="l00116"></a>00116 <span class="preprocessor">#define LIBNET_PBLOCK_OSPF_LSU_H 0x14 </span><span class="comment">/* OSPF lsu header */</span> <a name="l00117"></a>00117 <span class="preprocessor">#define LIBNET_PBLOCK_OSPF_LSA_H 0x15 </span><span class="comment">/* OSPF lsa header */</span> <a name="l00118"></a>00118 <span class="preprocessor">#define LIBNET_PBLOCK_OSPF_AUTH_H 0x16 </span><span class="comment">/* OSPF auth header */</span> <a name="l00119"></a>00119 <span class="preprocessor">#define LIBNET_PBLOCK_OSPF_CKSUM 0x17 </span><span class="comment">/* OSPF checksum header */</span> <a name="l00120"></a>00120 <span class="preprocessor">#define LIBNET_PBLOCK_LS_RTR_H 0x18 </span><span class="comment">/* linkstate rtr header */</span> <a name="l00121"></a>00121 <span class="preprocessor">#define LIBNET_PBLOCK_LS_NET_H 0x19 </span><span class="comment">/* linkstate net header */</span> <a name="l00122"></a>00122 <span class="preprocessor">#define LIBNET_PBLOCK_LS_SUM_H 0x1a </span><span class="comment">/* linkstate as sum header */</span> <a name="l00123"></a>00123 <span class="preprocessor">#define LIBNET_PBLOCK_LS_AS_EXT_H 0x1b </span><span class="comment">/* linkstate as ext header */</span> <a name="l00124"></a>00124 <span class="preprocessor">#define LIBNET_PBLOCK_NTP_H 0x1c </span><span class="comment">/* NTP header */</span> <a name="l00125"></a>00125 <span class="preprocessor">#define LIBNET_PBLOCK_RIP_H 0x1d </span><span class="comment">/* RIP header */</span> <a name="l00126"></a>00126 <span class="preprocessor">#define LIBNET_PBLOCK_TCP_H 0x1e </span><span class="comment">/* TCP header */</span> <a name="l00127"></a>00127 <span class="preprocessor">#define LIBNET_PBLOCK_TCPO_H 0x1f </span><span class="comment">/* TCP options */</span> <a name="l00128"></a>00128 <span class="preprocessor">#define LIBNET_PBLOCK_TCPDATA 0x20 </span><span class="comment">/* TCP data */</span> <a name="l00129"></a>00129 <span class="preprocessor">#define LIBNET_PBLOCK_UDP_H 0x21 </span><span class="comment">/* UDP header */</span> <a name="l00130"></a>00130 <span class="preprocessor">#define LIBNET_PBLOCK_VRRP_H 0x22 </span><span class="comment">/* VRRP header */</span> <a name="l00131"></a>00131 <span class="preprocessor">#define LIBNET_PBLOCK_DATA_H 0x23 </span><span class="comment">/* generic data */</span> <a name="l00132"></a>00132 <span class="preprocessor">#define LIBNET_PBLOCK_CDP_H 0x24 </span><span class="comment">/* CDP header */</span> <a name="l00133"></a>00133 <span class="preprocessor">#define LIBNET_PBLOCK_IPSEC_ESP_HDR_H 0x25 </span><span class="comment">/* IPSEC ESP header */</span> <a name="l00134"></a>00134 <span class="preprocessor">#define LIBNET_PBLOCK_IPSEC_ESP_FTR_H 0x26 </span><span class="comment">/* IPSEC ESP footer */</span> <a name="l00135"></a>00135 <span class="preprocessor">#define LIBNET_PBLOCK_IPSEC_AH_H 0x27 </span><span class="comment">/* IPSEC AH header */</span> <a name="l00136"></a>00136 <span class="preprocessor">#define LIBNET_PBLOCK_802_1Q_H 0x28 </span><span class="comment">/* 802.1q header */</span> <a name="l00137"></a>00137 <span class="preprocessor">#define LIBNET_PBLOCK_802_2_H 0x29 </span><span class="comment">/* 802.2 header */</span> <a name="l00138"></a>00138 <span class="preprocessor">#define LIBNET_PBLOCK_802_2SNAP_H 0x2a </span><span class="comment">/* 802.2 SNAP header */</span> <a name="l00139"></a>00139 <span class="preprocessor">#define LIBNET_PBLOCK_802_3_H 0x2b </span><span class="comment">/* 802.3 header */</span> <a name="l00140"></a>00140 <span class="preprocessor">#define LIBNET_PBLOCK_STP_CONF_H 0x2c </span><span class="comment">/* STP configuration header */</span> <a name="l00141"></a>00141 <span class="preprocessor">#define LIBNET_PBLOCK_STP_TCN_H 0x2d </span><span class="comment">/* STP TCN header */</span> <a name="l00142"></a>00142 <span class="preprocessor">#define LIBNET_PBLOCK_ISL_H 0x2e </span><span class="comment">/* ISL header */</span> <a name="l00143"></a>00143 <span class="preprocessor">#define LIBNET_PBLOCK_IPV6_H 0x2f </span><span class="comment">/* IP v6 header */</span> <a name="l00144"></a>00144 <span class="preprocessor">#define LIBNET_PBLOCK_802_1X_H 0x30 </span><span class="comment">/* 802.1x header */</span> <a name="l00145"></a>00145 <span class="preprocessor">#define LIBNET_PBLOCK_RPC_CALL_H 0x31 </span><span class="comment">/* RPC Call header */</span> <a name="l00146"></a>00146 <span class="preprocessor">#define LIBNET_PBLOCK_MPLS_H 0x32 </span><span class="comment">/* MPLS header */</span> <a name="l00147"></a>00147 <span class="preprocessor">#define LIBNET_PBLOCK_FDDI_H 0x33 </span><span class="comment">/* FDDI header */</span> <a name="l00148"></a>00148 <span class="preprocessor">#define LIBNET_PBLOCK_TOKEN_RING_H 0x34 </span><span class="comment">/* TOKEN RING header */</span> <a name="l00149"></a>00149 <span class="preprocessor">#define LIBNET_PBLOCK_BGP4_HEADER_H 0x35 </span><span class="comment">/* BGP4 header */</span> <a name="l00150"></a>00150 <span class="preprocessor">#define LIBNET_PBLOCK_BGP4_OPEN_H 0x36 </span><span class="comment">/* BGP4 open header */</span> <a name="l00151"></a>00151 <span class="preprocessor">#define LIBNET_PBLOCK_BGP4_UPDATE_H 0x37 </span><span class="comment">/* BGP4 update header */</span> <a name="l00152"></a>00152 <span class="preprocessor">#define LIBNET_PBLOCK_BGP4_NOTIFICATION_H 0x38 </span><span class="comment">/* BGP4 notification header */</span> <a name="l00153"></a>00153 <span class="preprocessor">#define LIBNET_PBLOCK_GRE_H 0x39 </span><span class="comment">/* GRE header */</span> <a name="l00154"></a>00154 <span class="preprocessor">#define LIBNET_PBLOCK_GRE_SRE_H 0x3a </span><span class="comment">/* GRE SRE header */</span> <a name="l00155"></a>00155 <span class="preprocessor">#define LIBNET_PBLOCK_IPV6_FRAG_H 0x3b </span><span class="comment">/* IPv6 frag header */</span> <a name="l00156"></a>00156 <span class="preprocessor">#define LIBNET_PBLOCK_IPV6_ROUTING_H 0x3c </span><span class="comment">/* IPv6 routing header */</span> <a name="l00157"></a>00157 <span class="preprocessor">#define LIBNET_PBLOCK_IPV6_DESTOPTS_H 0x3d </span><span class="comment">/* IPv6 dest opts header */</span> <a name="l00158"></a>00158 <span class="preprocessor">#define LIBNET_PBLOCK_IPV6_HBHOPTS_H 0x3e </span><span class="comment">/* IPv6 hop/hop opts header */</span> <a name="l00159"></a>00159 <span class="preprocessor">#define LIBNET_PBLOCK_SEBEK_H 0x3f </span><span class="comment">/* Sebek header */</span> <a name="l00160"></a>00160 <span class="preprocessor">#define LIBNET_PBLOCK_HSRP_H 0x40 </span><span class="comment">/* HSRP header */</span> <a name="l00161"></a>00161 u_int8_t flags; <span class="comment">/* control flags */</span> <a name="l00162"></a>00162 <span class="preprocessor">#define LIBNET_PBLOCK_DO_CHECKSUM 0x01 </span><span class="comment">/* needs a checksum */</span> <a name="l00163"></a>00163 libnet_ptag_t ptag; <span class="comment">/* protocol block tag */</span> <a name="l00164"></a>00164 <span class="keyword">struct </span>libnet_protocol_block *next; <span class="comment">/* next pblock */</span> <a name="l00165"></a>00165 <span class="keyword">struct </span>libnet_protocol_block *prev; <span class="comment">/* prev pblock */</span> <a name="l00166"></a>00166 }; <a name="l00167"></a>00167 <span class="keyword">typedef</span> <span class="keyword">struct </span>libnet_protocol_block libnet_pblock_t; <a name="l00168"></a>00168 <a name="l00169"></a>00169 <a name="l00170"></a>00170 <span class="comment">/*</span> <a name="l00171"></a>00171 <span class="comment"> * Libnet context</span> <a name="l00172"></a>00172 <span class="comment"> * Opaque structure. Nothing in here should ever been touched first hand by</span> <a name="l00173"></a>00173 <span class="comment"> * the applications programmer.</span> <a name="l00174"></a>00174 <span class="comment"> */</span> <a name="l00175"></a>00175 <span class="keyword">struct </span>libnet_context <a name="l00176"></a>00176 { <a name="l00177"></a>00177 <span class="preprocessor">#if ((__WIN32__) && !(__CYGWIN__)) </span> <a name="l00178"></a>00178 <span class="preprocessor"></span> SOCKET fd; <a name="l00179"></a>00179 LPADAPTER lpAdapter; <a name="l00180"></a>00180 <span class="preprocessor">#else</span> <a name="l00181"></a>00181 <span class="preprocessor"></span> <span class="keywordtype">int</span> fd; <span class="comment">/* file descriptor of packet device */</span> <a name="l00182"></a>00182 <span class="preprocessor">#endif</span> <a name="l00183"></a>00183 <span class="preprocessor"></span> <span class="keywordtype">int</span> injection_type; <span class="comment">/* raw (ipv4 or ipv6) or link */</span> <a name="l00184"></a>00184 <span class="preprocessor">#define LIBNET_LINK 0x00 </span><span class="comment">/* link-layer interface */</span> <a name="l00185"></a>00185 <span class="preprocessor">#define LIBNET_RAW4 0x01 </span><span class="comment">/* raw socket interface (ipv4) */</span> <a name="l00186"></a>00186 <span class="preprocessor">#define LIBNET_RAW6 0x02 </span><span class="comment">/* raw socket interface (ipv6) */</span> <a name="l00187"></a>00187 <span class="comment">/* the following should actually set a flag in the flags variable above */</span> <a name="l00188"></a>00188 <span class="preprocessor">#define LIBNET_LINK_ADV 0x08 </span><span class="comment">/* advanced mode link-layer */</span> <a name="l00189"></a>00189 <span class="preprocessor">#define LIBNET_RAW4_ADV 0x09 </span><span class="comment">/* advanced mode raw socket (ipv4) */</span> <a name="l00190"></a>00190 <span class="preprocessor">#define LIBNET_RAW6_ADV 0x0a </span><span class="comment">/* advanced mode raw socket (ipv6) */</span> <a name="l00191"></a>00191 <span class="preprocessor">#define LIBNET_ADV_MASK 0x08 </span><span class="comment">/* mask to determine adv mode */</span> <a name="l00192"></a>00192 <a name="l00193"></a>00193 libnet_pblock_t *protocol_blocks; <span class="comment">/* protocol headers / data */</span> <a name="l00194"></a>00194 libnet_pblock_t *pblock_end; <span class="comment">/* last node in list */</span> <a name="l00195"></a>00195 u_int32_t n_pblocks; <span class="comment">/* number of pblocks */</span> <a name="l00196"></a>00196 <a name="l00197"></a>00197 <span class="keywordtype">int</span> link_type; <span class="comment">/* link-layer type */</span> <a name="l00198"></a>00198 <span class="keywordtype">int</span> link_offset; <span class="comment">/* link-layer header size */</span> <a name="l00199"></a>00199 <span class="keywordtype">int</span> aligner; <span class="comment">/* used to align packets */</span> <a name="l00200"></a>00200 <span class="keywordtype">char</span> *device; <span class="comment">/* device name */</span> <a name="l00201"></a>00201 <a name="l00202"></a>00202 <span class="keyword">struct </span><a class="code" href="libnet-functions_8h.html#886dc359d6add4b0608e8611af7e1b35">libnet_stats</a> stats; <span class="comment">/* statistics */</span> <a name="l00203"></a>00203 libnet_ptag_t ptag_state; <span class="comment">/* state holder for pblock tag */</span> <a name="l00204"></a>00204 <span class="keywordtype">char</span> label[LIBNET_LABEL_SIZE]; <span class="comment">/* textual label for cq interface */</span> <a name="l00205"></a>00205 <a name="l00206"></a>00206 <span class="keywordtype">char</span> err_buf[<a class="code" href="libnet-macros_8h.html#2d720375e2ef5a85a62d6069283a5223">LIBNET_ERRBUF_SIZE</a>]; <span class="comment">/* error buffer */</span> <a name="l00207"></a>00207 u_int32_t total_size; <span class="comment">/* total size */</span> <a name="l00208"></a>00208 }; <a name="l00209"></a>00209 <span class="keyword">typedef</span> <span class="keyword">struct </span>libnet_context libnet_t; <a name="l00210"></a>00210 <a name="l00211"></a>00211 <span class="comment">/*</span> <a name="l00212"></a>00212 <span class="comment"> * Libnet context queue structure</span> <a name="l00213"></a>00213 <span class="comment"> * Opaque structure. Nothing in here should ever been touched first hand by</span> <a name="l00214"></a>00214 <span class="comment"> * the applications programmer.</span> <a name="l00215"></a>00215 <span class="comment"> */</span> <a name="l00216"></a>00216 <span class="keyword">typedef</span> <span class="keyword">struct </span>_libnet_context_queue libnet_cq_t; <a name="l00217"></a>00217 <span class="keyword">struct </span>_libnet_context_queue <a name="l00218"></a>00218 { <a name="l00219"></a>00219 libnet_t *context; <span class="comment">/* pointer to libnet context */</span> <a name="l00220"></a>00220 libnet_cq_t *next; <span class="comment">/* next node in the list */</span> <a name="l00221"></a>00221 libnet_cq_t *prev; <span class="comment">/* previous node in the list */</span> <a name="l00222"></a>00222 }; <a name="l00223"></a>00223 <a name="l00224"></a>00224 <span class="keyword">struct </span>_libnet_context_queue_descriptor <a name="l00225"></a>00225 { <a name="l00226"></a>00226 u_int32_t node; <span class="comment">/* number of nodes in the list */</span> <a name="l00227"></a>00227 u_int32_t cq_lock; <span class="comment">/* lock status */</span> <a name="l00228"></a>00228 libnet_cq_t *current; <span class="comment">/* current context */</span> <a name="l00229"></a>00229 }; <a name="l00230"></a>00230 <span class="keyword">typedef</span> <span class="keyword">struct </span>_libnet_context_queue_descriptor libnet_cqd_t; <a name="l00231"></a>00231 <a name="l00232"></a>00232 <span class="preprocessor">#endif </span><span class="comment">/* __LIBNET_STRUCTURES_H */</span> <a name="l00233"></a>00233 <a name="l00234"></a>00234 <span class="comment">/* EOF */</span> </pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 9 16:16:39 2009 for libnet by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address> </body> </html>