| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: bpf.h,v 1.73 2018/09/03 15:16:11 christos Exp $ */ | | 1 | /* $NetBSD: bpf.h,v 1.74 2019/02/26 10:30:28 msaitoh Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1990, 1991, 1993 | | 4 | * Copyright (c) 1990, 1991, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from the Stanford/CMU enet packet filter, | | 7 | * This code is derived from the Stanford/CMU enet packet filter, |
8 | * (net/enet.c) distributed as part of 4.3BSD, and code contributed | | 8 | * (net/enet.c) distributed as part of 4.3BSD, and code contributed |
9 | * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence | | 9 | * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence |
10 | * Berkeley Laboratory. | | 10 | * Berkeley Laboratory. |
11 | * | | 11 | * |
12 | * Redistribution and use in source and binary forms, with or without | | 12 | * Redistribution and use in source and binary forms, with or without |
13 | * modification, are permitted provided that the following conditions | | 13 | * modification, are permitted provided that the following conditions |
14 | * are met: | | 14 | * are met: |
| @@ -111,55 +111,55 @@ struct bpf_version { | | | @@ -111,55 +111,55 @@ struct bpf_version { |
111 | u_short bv_minor; | | 111 | u_short bv_minor; |
112 | }; | | 112 | }; |
113 | /* Current version number of filter architecture. */ | | 113 | /* Current version number of filter architecture. */ |
114 | #define BPF_MAJOR_VERSION 1 | | 114 | #define BPF_MAJOR_VERSION 1 |
115 | #define BPF_MINOR_VERSION 1 | | 115 | #define BPF_MINOR_VERSION 1 |
116 | | | 116 | |
117 | /* | | 117 | /* |
118 | * BPF ioctls | | 118 | * BPF ioctls |
119 | * | | 119 | * |
120 | * The first set is for compatibility with Sun's pcc style | | 120 | * The first set is for compatibility with Sun's pcc style |
121 | * header files. If your using gcc, we assume that you | | 121 | * header files. If your using gcc, we assume that you |
122 | * have run fixincludes so the latter set should work. | | 122 | * have run fixincludes so the latter set should work. |
123 | */ | | 123 | */ |
124 | #define BIOCGBLEN _IOR('B',102, u_int) | | 124 | #define BIOCGBLEN _IOR('B', 102, u_int) |
125 | #define BIOCSBLEN _IOWR('B',102, u_int) | | 125 | #define BIOCSBLEN _IOWR('B', 102, u_int) |
126 | #define BIOCSETF _IOW('B',103, struct bpf_program) | | 126 | #define BIOCSETF _IOW('B', 103, struct bpf_program) |
127 | #define BIOCFLUSH _IO('B',104) | | 127 | #define BIOCFLUSH _IO('B', 104) |
128 | #define BIOCPROMISC _IO('B',105) | | 128 | #define BIOCPROMISC _IO('B', 105) |
129 | #define BIOCGDLT _IOR('B',106, u_int) | | 129 | #define BIOCGDLT _IOR('B', 106, u_int) |
130 | #define BIOCGETIF _IOR('B',107, struct ifreq) | | 130 | #define BIOCGETIF _IOR('B', 107, struct ifreq) |
131 | #define BIOCSETIF _IOW('B',108, struct ifreq) | | 131 | #define BIOCSETIF _IOW('B', 108, struct ifreq) |
132 | #ifdef COMPAT_50 | | 132 | #ifdef COMPAT_50 |
133 | #include <compat/sys/time.h> | | 133 | #include <compat/sys/time.h> |
134 | #define BIOCSORTIMEOUT _IOW('B',109, struct timeval50) | | 134 | #define BIOCSORTIMEOUT _IOW('B', 109, struct timeval50) |
135 | #define BIOCGORTIMEOUT _IOR('B',110, struct timeval50) | | 135 | #define BIOCGORTIMEOUT _IOR('B', 110, struct timeval50) |
136 | #endif | | 136 | #endif |
137 | #define BIOCGSTATS _IOR('B',111, struct bpf_stat) | | 137 | #define BIOCGSTATS _IOR('B', 111, struct bpf_stat) |
138 | #define BIOCGSTATSOLD _IOR('B',111, struct bpf_stat_old) | | 138 | #define BIOCGSTATSOLD _IOR('B', 111, struct bpf_stat_old) |
139 | #define BIOCIMMEDIATE _IOW('B',112, u_int) | | 139 | #define BIOCIMMEDIATE _IOW('B', 112, u_int) |
140 | #define BIOCVERSION _IOR('B',113, struct bpf_version) | | 140 | #define BIOCVERSION _IOR('B', 113, struct bpf_version) |
141 | #define BIOCSTCPF _IOW('B',114, struct bpf_program) | | 141 | #define BIOCSTCPF _IOW('B', 114, struct bpf_program) |
142 | #define BIOCSUDPF _IOW('B',115, struct bpf_program) | | 142 | #define BIOCSUDPF _IOW('B', 115, struct bpf_program) |
143 | #define BIOCGHDRCMPLT _IOR('B',116, u_int) | | 143 | #define BIOCGHDRCMPLT _IOR('B', 116, u_int) |
144 | #define BIOCSHDRCMPLT _IOW('B',117, u_int) | | 144 | #define BIOCSHDRCMPLT _IOW('B', 117, u_int) |
145 | #define BIOCSDLT _IOW('B',118, u_int) | | 145 | #define BIOCSDLT _IOW('B', 118, u_int) |
146 | #define BIOCGDLTLIST _IOWR('B',119, struct bpf_dltlist) | | 146 | #define BIOCGDLTLIST _IOWR('B', 119, struct bpf_dltlist) |
147 | #define BIOCGDIRECTION _IOR('B',120, u_int) | | 147 | #define BIOCGDIRECTION _IOR('B', 120, u_int) |
148 | #define BIOCSDIRECTION _IOW('B',121, u_int) | | 148 | #define BIOCSDIRECTION _IOW('B', 121, u_int) |
149 | #define BIOCSRTIMEOUT _IOW('B',122, struct timeval) | | 149 | #define BIOCSRTIMEOUT _IOW('B', 122, struct timeval) |
150 | #define BIOCGRTIMEOUT _IOR('B',123, struct timeval) | | 150 | #define BIOCGRTIMEOUT _IOR('B', 123, struct timeval) |
151 | #define BIOCGFEEDBACK _IOR('B',124, u_int) | | 151 | #define BIOCGFEEDBACK _IOR('B', 124, u_int) |
152 | #define BIOCSFEEDBACK _IOW('B',125, u_int) | | 152 | #define BIOCSFEEDBACK _IOW('B', 125, u_int) |
153 | #define BIOCFEEDBACK BIOCSFEEDBACK /* FreeBSD name */ | | 153 | #define BIOCFEEDBACK BIOCSFEEDBACK /* FreeBSD name */ |
154 | | | 154 | |
155 | /* Obsolete */ | | 155 | /* Obsolete */ |
156 | #define BIOCGSEESENT BIOCGDIRECTION | | 156 | #define BIOCGSEESENT BIOCGDIRECTION |
157 | #define BIOCSSEESENT BIOCSDIRECTION | | 157 | #define BIOCSSEESENT BIOCSDIRECTION |
158 | | | 158 | |
159 | /* | | 159 | /* |
160 | * Packet directions. | | 160 | * Packet directions. |
161 | * BPF_D_IN = 0, BPF_D_INOUT =1 for backward compatibility of BIOC[GS]SEESENT. | | 161 | * BPF_D_IN = 0, BPF_D_INOUT =1 for backward compatibility of BIOC[GS]SEESENT. |
162 | */ | | 162 | */ |
163 | #define BPF_D_IN 0 /* See incoming packets */ | | 163 | #define BPF_D_IN 0 /* See incoming packets */ |
164 | #define BPF_D_INOUT 1 /* See incoming and outgoing packets */ | | 164 | #define BPF_D_INOUT 1 /* See incoming and outgoing packets */ |
165 | #define BPF_D_OUT 2 /* See outgoing packets */ | | 165 | #define BPF_D_OUT 2 /* See outgoing packets */ |