123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934 |
- #ifndef BPF_MAJOR_VERSION
- #ifdef __cplusplus
- extern "C" {
- #endif
- #define BPF_RELEASE 199606
- #ifdef MSDOS
- typedef long bpf_int32;
- typedef unsigned long bpf_u_int32;
- #else
- typedef int bpf_int32;
- typedef u_int bpf_u_int32;
- #endif
- #ifndef __NetBSD__
- #define BPF_ALIGNMENT sizeof(bpf_int32)
- #else
- #define BPF_ALIGNMENT sizeof(long)
- #endif
- #define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1))
- #define BPF_MAXBUFSIZE 0x8000
- #define BPF_MINBUFSIZE 32
- struct bpf_program {
- u_int bf_len;
- struct bpf_insn *bf_insns;
- };
-
- struct bpf_version {
- u_short bv_major;
- u_short bv_minor;
- };
- #define BPF_MAJOR_VERSION 1
- #define BPF_MINOR_VERSION 1
- #define DLT_NULL 0
- #define DLT_EN10MB 1
- #define DLT_EN3MB 2
- #define DLT_AX25 3
- #define DLT_PRONET 4
- #define DLT_CHAOS 5
- #define DLT_IEEE802 6
- #define DLT_ARCNET 7
- #define DLT_SLIP 8
- #define DLT_PPP 9
- #define DLT_FDDI 10
- #define DLT_ATM_RFC1483 11
- #ifdef __OpenBSD__
- #define DLT_RAW 14
- #else
- #define DLT_RAW 12
- #endif
- #if defined(__NetBSD__) || defined(__FreeBSD__)
- #ifndef DLT_SLIP_BSDOS
- #define DLT_SLIP_BSDOS 13
- #define DLT_PPP_BSDOS 14
- #endif
- #else
- #define DLT_SLIP_BSDOS 15
- #define DLT_PPP_BSDOS 16
- #endif
- #define DLT_ATM_CLIP 19
- #define DLT_REDBACK_SMARTEDGE 32
- #define DLT_PPP_SERIAL 50
- #define DLT_PPP_ETHER 51
- #define DLT_SYMANTEC_FIREWALL 99
- #define DLT_C_HDLC 104
- #define DLT_CHDLC DLT_C_HDLC
- #define DLT_IEEE802_11 105
- #define DLT_FRELAY 107
- #ifdef __OpenBSD__
- #define DLT_LOOP 12
- #else
- #define DLT_LOOP 108
- #endif
- #ifdef __OpenBSD__
- #define DLT_ENC 13
- #else
- #define DLT_ENC 109
- #endif
- #define DLT_LINUX_SLL 113
- #define DLT_LTALK 114
- #define DLT_ECONET 115
- #define DLT_IPFILTER 116
- #ifdef __OpenBSD__
- #define DLT_OLD_PFLOG 17
- #define DLT_PFSYNC 18
- #endif
- #define DLT_PFLOG 117
- #define DLT_CISCO_IOS 118
- #define DLT_PRISM_HEADER 119
- #define DLT_AIRONET_HEADER 120
- #define DLT_HHDLC 121
- #define DLT_IP_OVER_FC 122
- #define DLT_SUNATM 123
- #define DLT_RIO 124
- #define DLT_PCI_EXP 125
- #define DLT_AURORA 126
- #define DLT_IEEE802_11_RADIO 127
- #define DLT_TZSP 128
- #define DLT_ARCNET_LINUX 129
- #define DLT_JUNIPER_MLPPP 130
- #define DLT_JUNIPER_MLFR 131
- #define DLT_JUNIPER_ES 132
- #define DLT_JUNIPER_GGSN 133
- #define DLT_JUNIPER_MFR 134
- #define DLT_JUNIPER_ATM2 135
- #define DLT_JUNIPER_SERVICES 136
- #define DLT_JUNIPER_ATM1 137
- #define DLT_APPLE_IP_OVER_IEEE1394 138
- #define DLT_MTP2_WITH_PHDR 139
- #define DLT_MTP2 140
- #define DLT_MTP3 141
- #define DLT_SCCP 142
- #define DLT_DOCSIS 143
- #define DLT_LINUX_IRDA 144
- #define DLT_IBM_SP 145
- #define DLT_IBM_SN 146
- #define DLT_USER0 147
- #define DLT_USER1 148
- #define DLT_USER2 149
- #define DLT_USER3 150
- #define DLT_USER4 151
- #define DLT_USER5 152
- #define DLT_USER6 153
- #define DLT_USER7 154
- #define DLT_USER8 155
- #define DLT_USER9 156
- #define DLT_USER10 157
- #define DLT_USER11 158
- #define DLT_USER12 159
- #define DLT_USER13 160
- #define DLT_USER14 161
- #define DLT_USER15 162
- #define DLT_IEEE802_11_RADIO_AVS 163
- #define DLT_JUNIPER_MONITOR 164
- #define DLT_BACNET_MS_TP 165
- #define DLT_PPP_PPPD 166
- #define DLT_PPP_WITH_DIRECTION DLT_PPP_PPPD
- #define DLT_LINUX_PPP_WITHDIRECTION DLT_PPP_PPPD
- #define DLT_JUNIPER_PPPOE 167
- #define DLT_JUNIPER_PPPOE_ATM 168
- #define DLT_GPRS_LLC 169
- #define DLT_GPF_T 170
- #define DLT_GPF_F 171
- #define DLT_GCOM_T1E1 172
- #define DLT_GCOM_SERIAL 173
- #define DLT_JUNIPER_PIC_PEER 174
- #define DLT_ERF_ETH 175
- #define DLT_ERF_POS 176
- #define DLT_LINUX_LAPD 177
- #define DLT_JUNIPER_ETHER 178
- #define DLT_JUNIPER_PPP 179
- #define DLT_JUNIPER_FRELAY 180
- #define DLT_JUNIPER_CHDLC 181
- #define DLT_MFR 182
- #define DLT_JUNIPER_VP 183
- #define DLT_A429 184
- #define DLT_A653_ICM 185
- #define DLT_USB 186
- #define DLT_BLUETOOTH_HCI_H4 187
- #define DLT_IEEE802_16_MAC_CPS 188
- #define DLT_USB_LINUX 189
- #define DLT_CAN20B 190
- #define DLT_IEEE802_15_4_LINUX 191
- #define DLT_PPI 192
- #define DLT_IEEE802_16_MAC_CPS_RADIO 193
- #define DLT_JUNIPER_ISM 194
- #define DLT_IEEE802_15_4 195
- #define DLT_SITA 196
- #define DLT_ERF 197
- #define DLT_RAIF1 198
- #define DLT_IPMB 199
- #define DLT_JUNIPER_ST 200
- #define DLT_BLUETOOTH_HCI_H4_WITH_PHDR 201
- #define DLT_AX25_KISS 202
- #define DLT_LAPD 203
- #define DLT_PPP_WITH_DIR 204
- #define DLT_C_HDLC_WITH_DIR 205
- #define DLT_FRELAY_WITH_DIR 206
- #define DLT_LAPB_WITH_DIR 207
- #define DLT_IPMB_LINUX 209
- #define DLT_FLEXRAY 210
- #define DLT_MOST 211
- #define DLT_LIN 212
- #define DLT_X2E_SERIAL 213
- #define DLT_X2E_XORAYA 214
- #define DLT_IEEE802_15_4_NONASK_PHY 215
- #define DLT_CLASS(x) ((x) & 0x03ff0000)
- #define DLT_CLASS_NETBSD_RAWAF 0x02240000
- #define DLT_NETBSD_RAWAF(af) (DLT_CLASS_NETBSD_RAWAF | (af))
- #define DLT_NETBSD_RAWAF_AF(x) ((x) & 0x0000ffff)
- #define DLT_IS_NETBSD_RAWAF(x) (DLT_CLASS(x) == DLT_CLASS_NETBSD_RAWAF)
- #define BPF_CLASS(code) ((code) & 0x07)
- #define BPF_LD 0x00
- #define BPF_LDX 0x01
- #define BPF_ST 0x02
- #define BPF_STX 0x03
- #define BPF_ALU 0x04
- #define BPF_JMP 0x05
- #define BPF_RET 0x06
- #define BPF_MISC 0x07
- #define BPF_SIZE(code) ((code) & 0x18)
- #define BPF_W 0x00
- #define BPF_H 0x08
- #define BPF_B 0x10
- #define BPF_MODE(code) ((code) & 0xe0)
- #define BPF_IMM 0x00
- #define BPF_ABS 0x20
- #define BPF_IND 0x40
- #define BPF_MEM 0x60
- #define BPF_LEN 0x80
- #define BPF_MSH 0xa0
- #define BPF_OP(code) ((code) & 0xf0)
- #define BPF_ADD 0x00
- #define BPF_SUB 0x10
- #define BPF_MUL 0x20
- #define BPF_DIV 0x30
- #define BPF_OR 0x40
- #define BPF_AND 0x50
- #define BPF_LSH 0x60
- #define BPF_RSH 0x70
- #define BPF_NEG 0x80
- #define BPF_JA 0x00
- #define BPF_JEQ 0x10
- #define BPF_JGT 0x20
- #define BPF_JGE 0x30
- #define BPF_JSET 0x40
- #define BPF_SRC(code) ((code) & 0x08)
- #define BPF_K 0x00
- #define BPF_X 0x08
- #define BPF_RVAL(code) ((code) & 0x18)
- #define BPF_A 0x10
- #define BPF_MISCOP(code) ((code) & 0xf8)
- #define BPF_TAX 0x00
- #define BPF_TXA 0x80
- struct bpf_insn {
- u_short code;
- u_char jt;
- u_char jf;
- bpf_u_int32 k;
- };
- #define BPF_STMT(code, k) { (u_short)(code), 0, 0, k }
- #define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k }
- #if __STDC__ || defined(__cplusplus)
- extern int bpf_validate(const struct bpf_insn *, int);
- extern u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);
- #else
- extern int bpf_validate();
- extern u_int bpf_filter();
- #endif
- #define BPF_MEMWORDS 16
- #ifdef __cplusplus
- }
- #endif
- #endif
|