Annotation of embedaddon/libnet/doc/html/bpf_8h-source.html, revision 1.1

1.1     ! misho       1: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
        !             2: <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
        !             3: <title>libnet: bpf.h Source File</title>
        !             4: <link href="doxygen.css" rel="stylesheet" type="text/css">
        !             5: </head><body>
        !             6: <!-- Generated by Doxygen 1.3.4 -->
        !             7: <div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
        !             8: <h1>bpf.h</h1><div class="fragment"><pre>00001 <span class="comment">/*-</span>
        !             9: 00002 <span class="comment"> * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997</span>
        !            10: 00003 <span class="comment"> *  The Regents of the University of California.  All rights reserved.</span>
        !            11: 00004 <span class="comment"> *</span>
        !            12: 00005 <span class="comment"> * This code is derived from the Stanford/CMU enet packet filter,</span>
        !            13: 00006 <span class="comment"> * (net/enet.c) distributed as part of 4.3BSD, and code contributed</span>
        !            14: 00007 <span class="comment"> * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence </span>
        !            15: 00008 <span class="comment"> * Berkeley Laboratory.</span>
        !            16: 00009 <span class="comment"> *</span>
        !            17: 00010 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span>
        !            18: 00011 <span class="comment"> * modification, are permitted provided that the following conditions</span>
        !            19: 00012 <span class="comment"> * are met:</span>
        !            20: 00013 <span class="comment"> * 1. Redistributions of source code must retain the above copyright</span>
        !            21: 00014 <span class="comment"> *    notice, this list of conditions and the following disclaimer.</span>
        !            22: 00015 <span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span>
        !            23: 00016 <span class="comment"> *    notice, this list of conditions and the following disclaimer in the</span>
        !            24: 00017 <span class="comment"> *    documentation and/or other materials provided with the distribution.</span>
        !            25: 00018 <span class="comment"> * 3. All advertising materials mentioning features or use of this software</span>
        !            26: 00019 <span class="comment"> *    must display the following acknowledgement:</span>
        !            27: 00020 <span class="comment"> *      This product includes software developed by the University of</span>
        !            28: 00021 <span class="comment"> *      California, Berkeley and its contributors.</span>
        !            29: 00022 <span class="comment"> * 4. Neither the name of the University nor the names of its contributors</span>
        !            30: 00023 <span class="comment"> *    may be used to endorse or promote products derived from this software</span>
        !            31: 00024 <span class="comment"> *    without specific prior written permission.</span>
        !            32: 00025 <span class="comment"> *</span>
        !            33: 00026 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND</span>
        !            34: 00027 <span class="comment"> * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span>
        !            35: 00028 <span class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span>
        !            36: 00029 <span class="comment"> * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE</span>
        !            37: 00030 <span class="comment"> * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL</span>
        !            38: 00031 <span class="comment"> * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS</span>
        !            39: 00032 <span class="comment"> * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span>
        !            40: 00033 <span class="comment"> * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT</span>
        !            41: 00034 <span class="comment"> * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY</span>
        !            42: 00035 <span class="comment"> * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</span>
        !            43: 00036 <span class="comment"> * SUCH DAMAGE.</span>
        !            44: 00037 <span class="comment"> *</span>
        !            45: 00038 <span class="comment"> *      @(#)bpf.h       7.1 (Berkeley) 5/7/91</span>
        !            46: 00039 <span class="comment"> *</span>
        !            47: 00040 <span class="comment"> * @(#) $Header: /usr/local/CVS/libnet/include/bpf.h,v 1.1.1.1 2003/06/26 21:55:10 route Exp $ (LBL)</span>
        !            48: 00041 <span class="comment"> */</span>
        !            49: 00042 
        !            50: 00043 <span class="preprocessor">#ifndef BPF_MAJOR_VERSION</span>
        !            51: 00044 <span class="preprocessor"></span>
        !            52: 00045 <span class="comment">/* BSD style release date */</span>
        !            53: 00046 <span class="preprocessor">#define BPF_RELEASE 199606</span>
        !            54: 00047 <span class="preprocessor"></span>
        !            55: 00048 <span class="keyword">typedef</span> <span class="keywordtype">int</span> bpf_int32;
        !            56: 00049 <span class="keyword">typedef</span> u_int bpf_u_int32;
        !            57: 00050 
        !            58: 00051 <span class="comment">/*</span>
        !            59: 00052 <span class="comment"> * Alignment macros.  BPF_WORDALIGN rounds up to the next </span>
        !            60: 00053 <span class="comment"> * even multiple of BPF_ALIGNMENT. </span>
        !            61: 00054 <span class="comment"> */</span>
        !            62: 00055 <span class="preprocessor">#define BPF_ALIGNMENT sizeof(bpf_int32)</span>
        !            63: 00056 <span class="preprocessor"></span><span class="preprocessor">#define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&amp;~(BPF_ALIGNMENT-1))</span>
        !            64: 00057 <span class="preprocessor"></span>
        !            65: 00058 <span class="preprocessor">#define BPF_MAXINSNS 512</span>
        !            66: 00059 <span class="preprocessor"></span><span class="preprocessor">#define BPF_MAXBUFSIZE 0x8000</span>
        !            67: 00060 <span class="preprocessor"></span><span class="preprocessor">#define BPF_MINBUFSIZE 32</span>
        !            68: 00061 <span class="preprocessor"></span>
        !            69: 00062 <span class="comment">/*</span>
        !            70: 00063 <span class="comment"> *  Structure for BIOCSETF.</span>
        !            71: 00064 <span class="comment"> */</span>
        !            72: 00065 <span class="keyword">struct </span>bpf_program {
        !            73: 00066     u_int bf_len;
        !            74: 00067     <span class="keyword">struct </span>bpf_insn *bf_insns;
        !            75: 00068 };
        !            76: 00069  
        !            77: 00070 <span class="comment">/*</span>
        !            78: 00071 <span class="comment"> * Struct returned by BIOCGSTATS.</span>
        !            79: 00072 <span class="comment"> */</span>
        !            80: 00073 <span class="keyword">struct </span>bpf_stat {
        !            81: 00074     u_int bs_recv;      <span class="comment">/* number of packets received */</span>
        !            82: 00075     u_int bs_drop;      <span class="comment">/* number of packets dropped */</span>
        !            83: 00076 };
        !            84: 00077 
        !            85: 00078 <span class="comment">/*</span>
        !            86: 00079 <span class="comment"> * Struct return by BIOCVERSION.  This represents the version number of </span>
        !            87: 00080 <span class="comment"> * the filter language described by the instruction encodings below.</span>
        !            88: 00081 <span class="comment"> * bpf understands a program iff kernel_major == filter_major &amp;&amp;</span>
        !            89: 00082 <span class="comment"> * kernel_minor &gt;= filter_minor, that is, if the value returned by the</span>
        !            90: 00083 <span class="comment"> * running kernel has the same major number and a minor number equal</span>
        !            91: 00084 <span class="comment"> * equal to or less than the filter being downloaded.  Otherwise, the</span>
        !            92: 00085 <span class="comment"> * results are undefined, meaning an error may be returned or packets</span>
        !            93: 00086 <span class="comment"> * may be accepted haphazardly.</span>
        !            94: 00087 <span class="comment"> * It has nothing to do with the source code version.</span>
        !            95: 00088 <span class="comment"> */</span>
        !            96: 00089 <span class="keyword">struct </span>bpf_version {
        !            97: 00090     u_short bv_major;
        !            98: 00091     u_short bv_minor;
        !            99: 00092 };
        !           100: 00093 <span class="comment">/* Current version number of filter architecture. */</span>
        !           101: 00094 <span class="preprocessor">#define BPF_MAJOR_VERSION 1</span>
        !           102: 00095 <span class="preprocessor"></span><span class="preprocessor">#define BPF_MINOR_VERSION 1</span>
        !           103: 00096 <span class="preprocessor"></span>
        !           104: 00097 <span class="comment">/*</span>
        !           105: 00098 <span class="comment"> * BPF ioctls</span>
        !           106: 00099 <span class="comment"> *</span>
        !           107: 00100 <span class="comment"> * The first set is for compatibility with Sun's pcc style</span>
        !           108: 00101 <span class="comment"> * header files.  If your using gcc, we assume that you</span>
        !           109: 00102 <span class="comment"> * have run fixincludes so the latter set should work.</span>
        !           110: 00103 <span class="comment"> */</span>
        !           111: 00104 <span class="preprocessor">#if (defined(sun) || defined(ibm032)) &amp;&amp; !defined(__GNUC__)</span>
        !           112: 00105 <span class="preprocessor"></span><span class="preprocessor">#define BIOCGBLEN   _IOR(B,102, u_int)</span>
        !           113: 00106 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSBLEN   _IOWR(B,102, u_int)</span>
        !           114: 00107 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSETF    _IOW(B,103, struct bpf_program)</span>
        !           115: 00108 <span class="preprocessor"></span><span class="preprocessor">#define BIOCFLUSH   _IO(B,104)</span>
        !           116: 00109 <span class="preprocessor"></span><span class="preprocessor">#define BIOCPROMISC _IO(B,105)</span>
        !           117: 00110 <span class="preprocessor"></span><span class="preprocessor">#define BIOCGDLT    _IOR(B,106, u_int)</span>
        !           118: 00111 <span class="preprocessor"></span><span class="preprocessor">#define BIOCGETIF   _IOR(B,107, struct ifreq)</span>
        !           119: 00112 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSETIF   _IOW(B,108, struct ifreq)</span>
        !           120: 00113 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSRTIMEOUT   _IOW(B,109, struct timeval)</span>
        !           121: 00114 <span class="preprocessor"></span><span class="preprocessor">#define BIOCGRTIMEOUT   _IOR(B,110, struct timeval)</span>
        !           122: 00115 <span class="preprocessor"></span><span class="preprocessor">#define BIOCGSTATS  _IOR(B,111, struct bpf_stat)</span>
        !           123: 00116 <span class="preprocessor"></span><span class="preprocessor">#define BIOCIMMEDIATE   _IOW(B,112, u_int)</span>
        !           124: 00117 <span class="preprocessor"></span><span class="preprocessor">#define BIOCVERSION _IOR(B,113, struct bpf_version)</span>
        !           125: 00118 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSTCPF   _IOW(B,114, struct bpf_program)</span>
        !           126: 00119 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSUDPF   _IOW(B,115, struct bpf_program)</span>
        !           127: 00120 <span class="preprocessor"></span><span class="preprocessor">#else</span>
        !           128: 00121 <span class="preprocessor"></span><span class="preprocessor">#define BIOCGBLEN   _IOR('B',102, u_int)</span>
        !           129: 00122 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSBLEN   _IOWR('B',102, u_int)</span>
        !           130: 00123 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSETF    _IOW('B',103, struct bpf_program)</span>
        !           131: 00124 <span class="preprocessor"></span><span class="preprocessor">#define BIOCFLUSH   _IO('B',104)</span>
        !           132: 00125 <span class="preprocessor"></span><span class="preprocessor">#define BIOCPROMISC _IO('B',105)</span>
        !           133: 00126 <span class="preprocessor"></span><span class="preprocessor">#define BIOCGDLT    _IOR('B',106, u_int)</span>
        !           134: 00127 <span class="preprocessor"></span><span class="preprocessor">#define BIOCGETIF   _IOR('B',107, struct ifreq)</span>
        !           135: 00128 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSETIF   _IOW('B',108, struct ifreq)</span>
        !           136: 00129 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSRTIMEOUT   _IOW('B',109, struct timeval)</span>
        !           137: 00130 <span class="preprocessor"></span><span class="preprocessor">#define BIOCGRTIMEOUT   _IOR('B',110, struct timeval)</span>
        !           138: 00131 <span class="preprocessor"></span><span class="preprocessor">#define BIOCGSTATS  _IOR('B',111, struct bpf_stat)</span>
        !           139: 00132 <span class="preprocessor"></span><span class="preprocessor">#define BIOCIMMEDIATE   _IOW('B',112, u_int)</span>
        !           140: 00133 <span class="preprocessor"></span><span class="preprocessor">#define BIOCVERSION _IOR('B',113, struct bpf_version)</span>
        !           141: 00134 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSTCPF   _IOW('B',114, struct bpf_program)</span>
        !           142: 00135 <span class="preprocessor"></span><span class="preprocessor">#define BIOCSUDPF   _IOW('B',115, struct bpf_program)</span>
        !           143: 00136 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
        !           144: 00137 <span class="preprocessor"></span>
        !           145: 00138 <span class="comment">/*</span>
        !           146: 00139 <span class="comment"> * Structure prepended to each packet.</span>
        !           147: 00140 <span class="comment"> */</span>
        !           148: 00141 <span class="keyword">struct </span>bpf_hdr {
        !           149: 00142     <span class="keyword">struct </span>timeval  bh_tstamp;  <span class="comment">/* time stamp */</span>
        !           150: 00143     bpf_u_int32 bh_caplen;  <span class="comment">/* length of captured portion */</span>
        !           151: 00144     bpf_u_int32 bh_datalen; <span class="comment">/* original length of packet */</span>
        !           152: 00145     u_short     bh_hdrlen;  <span class="comment">/* length of bpf header (this struct</span>
        !           153: 00146 <span class="comment">                       plus alignment padding) */</span>
        !           154: 00147 };
        !           155: 00148 <span class="comment">/*</span>
        !           156: 00149 <span class="comment"> * Because the structure above is not a multiple of 4 bytes, some compilers</span>
        !           157: 00150 <span class="comment"> * will insist on inserting padding; hence, sizeof(struct bpf_hdr) won't work.</span>
        !           158: 00151 <span class="comment"> * Only the kernel needs to know about it; applications use bh_hdrlen.</span>
        !           159: 00152 <span class="comment"> */</span>
        !           160: 00153 <span class="preprocessor">#ifdef KERNEL</span>
        !           161: 00154 <span class="preprocessor"></span><span class="preprocessor">#define SIZEOF_BPF_HDR 18</span>
        !           162: 00155 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
        !           163: 00156 <span class="preprocessor"></span>
        !           164: 00157 <span class="comment">/*</span>
        !           165: 00158 <span class="comment"> * Data-link level type codes.</span>
        !           166: 00159 <span class="comment"> */</span>
        !           167: 00160 <span class="preprocessor">#define DLT_NULL    0   </span><span class="comment">/* no link-layer encapsulation */</span>
        !           168: 00161 <span class="preprocessor">#define DLT_EN10MB  1   </span><span class="comment">/* Ethernet (10Mb) */</span>
        !           169: 00162 <span class="preprocessor">#define DLT_EN3MB   2   </span><span class="comment">/* Experimental Ethernet (3Mb) */</span>
        !           170: 00163 <span class="preprocessor">#define DLT_AX25    3   </span><span class="comment">/* Amateur Radio AX.25 */</span>
        !           171: 00164 <span class="preprocessor">#define DLT_PRONET  4   </span><span class="comment">/* Proteon ProNET Token Ring */</span>
        !           172: 00165 <span class="preprocessor">#define DLT_CHAOS   5   </span><span class="comment">/* Chaos */</span>
        !           173: 00166 <span class="preprocessor">#define DLT_IEEE802 6   </span><span class="comment">/* IEEE 802 Networks */</span>
        !           174: 00167 <span class="preprocessor">#define DLT_ARCNET  7   </span><span class="comment">/* ARCNET */</span>
        !           175: 00168 <span class="preprocessor">#define DLT_SLIP    8   </span><span class="comment">/* Serial Line IP */</span>
        !           176: 00169 <span class="preprocessor">#define DLT_PPP     9   </span><span class="comment">/* Point-to-point Protocol */</span>
        !           177: 00170 <span class="preprocessor">#define DLT_FDDI    10  </span><span class="comment">/* FDDI */</span>
        !           178: 00171 <span class="preprocessor">#define DLT_ATM_RFC1483 11  </span><span class="comment">/* LLC/SNAP encapsulated atm */</span>
        !           179: 00172 <span class="preprocessor">#define DLT_RAW     12  </span><span class="comment">/* raw IP */</span>
        !           180: 00173 <span class="preprocessor">#define DLT_SLIP_BSDOS  13  </span><span class="comment">/* BSD/OS Serial Line IP */</span>
        !           181: 00174 <span class="preprocessor">#define DLT_PPP_BSDOS   14  </span><span class="comment">/* BSD/OS Point-to-point Protocol */</span>
        !           182: 00175 
        !           183: 00176 <span class="comment">/*</span>
        !           184: 00177 <span class="comment"> * The instruction encondings.</span>
        !           185: 00178 <span class="comment"> */</span>
        !           186: 00179 <span class="comment">/* instruction classes */</span>
        !           187: 00180 <span class="preprocessor">#define BPF_CLASS(code) ((code) &amp; 0x07)</span>
        !           188: 00181 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_LD      0x00</span>
        !           189: 00182 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_LDX     0x01</span>
        !           190: 00183 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_ST      0x02</span>
        !           191: 00184 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_STX     0x03</span>
        !           192: 00185 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_ALU     0x04</span>
        !           193: 00186 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_JMP     0x05</span>
        !           194: 00187 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_RET     0x06</span>
        !           195: 00188 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_MISC    0x07</span>
        !           196: 00189 <span class="preprocessor"></span>
        !           197: 00190 <span class="comment">/* ld/ldx fields */</span>
        !           198: 00191 <span class="preprocessor">#define BPF_SIZE(code)  ((code) &amp; 0x18)</span>
        !           199: 00192 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_W       0x00</span>
        !           200: 00193 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_H       0x08</span>
        !           201: 00194 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_B       0x10</span>
        !           202: 00195 <span class="preprocessor"></span><span class="preprocessor">#define BPF_MODE(code)  ((code) &amp; 0xe0)</span>
        !           203: 00196 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_IMM     0x00</span>
        !           204: 00197 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_ABS     0x20</span>
        !           205: 00198 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_IND     0x40</span>
        !           206: 00199 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_MEM     0x60</span>
        !           207: 00200 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_LEN     0x80</span>
        !           208: 00201 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_MSH     0xa0</span>
        !           209: 00202 <span class="preprocessor"></span>
        !           210: 00203 <span class="comment">/* alu/jmp fields */</span>
        !           211: 00204 <span class="preprocessor">#define BPF_OP(code)    ((code) &amp; 0xf0)</span>
        !           212: 00205 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_ADD     0x00</span>
        !           213: 00206 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_SUB     0x10</span>
        !           214: 00207 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_MUL     0x20</span>
        !           215: 00208 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_DIV     0x30</span>
        !           216: 00209 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_OR      0x40</span>
        !           217: 00210 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_AND     0x50</span>
        !           218: 00211 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_LSH     0x60</span>
        !           219: 00212 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_RSH     0x70</span>
        !           220: 00213 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_NEG     0x80</span>
        !           221: 00214 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_JA      0x00</span>
        !           222: 00215 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_JEQ     0x10</span>
        !           223: 00216 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_JGT     0x20</span>
        !           224: 00217 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_JGE     0x30</span>
        !           225: 00218 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_JSET    0x40</span>
        !           226: 00219 <span class="preprocessor"></span><span class="preprocessor">#define BPF_SRC(code)   ((code) &amp; 0x08)</span>
        !           227: 00220 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_K       0x00</span>
        !           228: 00221 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_X       0x08</span>
        !           229: 00222 <span class="preprocessor"></span>
        !           230: 00223 <span class="comment">/* ret - BPF_K and BPF_X also apply */</span>
        !           231: 00224 <span class="preprocessor">#define BPF_RVAL(code)  ((code) &amp; 0x18)</span>
        !           232: 00225 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_A       0x10</span>
        !           233: 00226 <span class="preprocessor"></span>
        !           234: 00227 <span class="comment">/* misc */</span>
        !           235: 00228 <span class="preprocessor">#define BPF_MISCOP(code) ((code) &amp; 0xf8)</span>
        !           236: 00229 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_TAX     0x00</span>
        !           237: 00230 <span class="preprocessor"></span><span class="preprocessor">#define     BPF_TXA     0x80</span>
        !           238: 00231 <span class="preprocessor"></span>
        !           239: 00232 <span class="comment">/*</span>
        !           240: 00233 <span class="comment"> * The instruction data structure.</span>
        !           241: 00234 <span class="comment"> */</span>
        !           242: 00235 <span class="keyword">struct </span>bpf_insn {
        !           243: 00236     u_short code;
        !           244: 00237     u_char  jt;
        !           245: 00238     u_char  jf;
        !           246: 00239     bpf_int32 k;
        !           247: 00240 };
        !           248: 00241 
        !           249: 00242 <span class="comment">/*</span>
        !           250: 00243 <span class="comment"> * Macros for insn array initializers.</span>
        !           251: 00244 <span class="comment"> */</span>
        !           252: 00245 <span class="preprocessor">#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k }</span>
        !           253: 00246 <span class="preprocessor"></span><span class="preprocessor">#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k }</span>
        !           254: 00247 <span class="preprocessor"></span>
        !           255: 00248 <span class="preprocessor">#ifdef KERNEL</span>
        !           256: 00249 <span class="preprocessor"></span><span class="keyword">extern</span> u_int bpf_filter();
        !           257: 00250 <span class="keyword">extern</span> <span class="keywordtype">void</span> bpfattach();
        !           258: 00251 <span class="keyword">extern</span> <span class="keywordtype">void</span> bpf_tap();
        !           259: 00252 <span class="keyword">extern</span> <span class="keywordtype">void</span> bpf_mtap();
        !           260: 00253 <span class="preprocessor">#else</span>
        !           261: 00254 <span class="preprocessor"></span><span class="preprocessor">#if __STDC__</span>
        !           262: 00255 <span class="preprocessor"></span><span class="keyword">extern</span> u_int bpf_filter(<span class="keyword">struct</span> bpf_insn *, u_char *, u_int, u_int);
        !           263: 00256 <span class="preprocessor">#endif</span>
        !           264: 00257 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
        !           265: 00258 <span class="preprocessor"></span>
        !           266: 00259 <span class="comment">/*</span>
        !           267: 00260 <span class="comment"> * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST).</span>
        !           268: 00261 <span class="comment"> */</span>
        !           269: 00262 <span class="preprocessor">#define BPF_MEMWORDS 16</span>
        !           270: 00263 <span class="preprocessor"></span>
        !           271: 00264 <span class="preprocessor">#endif</span>
        !           272: </pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:37 2004 for libnet by
        !           273: <a href="http://www.doxygen.org/index.html">
        !           274: <img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
        !           275: </a>1.3.4 </small></address>
        !           276: </body>
        !           277: </html>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>