xref: /freebsd/tests/atf_python/sys/netpfil/ipfw/insn_headers.py (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1from enum import Enum
2
3
4class IpFwOpcode(Enum):
5    O_NOP = 0
6    O_IP_SRC = 1
7    O_IP_SRC_MASK = 2
8    O_IP_SRC_ME = 3
9    O_IP_SRC_SET = 4
10    O_IP_DST = 5
11    O_IP_DST_MASK = 6
12    O_IP_DST_ME = 7
13    O_IP_DST_SET = 8
14    O_IP_SRCPORT = 9
15    O_IP_DSTPORT = 10
16    O_PROTO = 11
17    O_MACADDR2 = 12
18    O_MAC_TYPE = 13
19    O_LAYER2 = 14
20    O_IN = 15
21    O_FRAG = 16
22    O_RECV = 17
23    O_XMIT = 18
24    O_VIA = 19
25    O_IPOPT = 20
26    O_IPLEN = 21
27    O_IPID = 22
28    O_IPTOS = 23
29    O_IPPRECEDENCE = 24
30    O_IPTTL = 25
31    O_IPVER = 26
32    O_UID = 27
33    O_GID = 28
34    O_ESTAB = 29
35    O_TCPFLAGS = 30
36    O_TCPWIN = 31
37    O_TCPSEQ = 32
38    O_TCPACK = 33
39    O_ICMPTYPE = 34
40    O_TCPOPTS = 35
41    O_VERREVPATH = 36
42    O_VERSRCREACH = 37
43    O_PROBE_STATE = 38
44    O_KEEP_STATE = 39
45    O_LIMIT = 40
46    O_LIMIT_PARENT = 41
47    O_LOG = 42
48    O_PROB = 43
49    O_CHECK_STATE = 44
50    O_ACCEPT = 45
51    O_DENY = 46
52    O_REJECT = 47
53    O_COUNT = 48
54    O_SKIPTO = 49
55    O_PIPE = 50
56    O_QUEUE = 51
57    O_DIVERT = 52
58    O_TEE = 53
59    O_FORWARD_IP = 54
60    O_FORWARD_MAC = 55
61    O_NAT = 56
62    O_REASS = 57
63    O_IPSEC = 58
64    O_IP_SRC_LOOKUP = 59
65    O_IP_DST_LOOKUP = 60
66    O_ANTISPOOF = 61
67    O_JAIL = 62
68    O_ALTQ = 63
69    O_DIVERTED = 64
70    O_TCPDATALEN = 65
71    O_IP6_SRC = 66
72    O_IP6_SRC_ME = 67
73    O_IP6_SRC_MASK = 68
74    O_IP6_DST = 69
75    O_IP6_DST_ME = 70
76    O_IP6_DST_MASK = 71
77    O_FLOW6ID = 72
78    O_ICMP6TYPE = 73
79    O_EXT_HDR = 74
80    O_IP6 = 75
81    O_NETGRAPH = 76
82    O_NGTEE = 77
83    O_IP4 = 78
84    O_UNREACH6 = 79
85    O_TAG = 80
86    O_TAGGED = 81
87    O_SETFIB = 82
88    O_FIB = 83
89    O_SOCKARG = 84
90    O_CALLRETURN = 85
91    O_FORWARD_IP6 = 86
92    O_DSCP = 87
93    O_SETDSCP = 88
94    O_IP_FLOW_LOOKUP = 89
95    O_EXTERNAL_ACTION = 90
96    O_EXTERNAL_INSTANCE = 91
97    O_EXTERNAL_DATA = 92
98    O_SKIP_ACTION = 93
99    O_TCPMSS = 94
100    O_MAC_SRC_LOOKUP = 95
101    O_MAC_DST_LOOKUP = 96
102    O_SETMARK = 97
103    O_MARK = 98
104    O_LAST_OPCODE = 99
105
106
107class Op3CmdType(Enum):
108    IP_FW_TABLE_XADD = 86
109    IP_FW_TABLE_XDEL = 87
110    IP_FW_TABLE_XGETSIZE = 88
111    IP_FW_TABLE_XLIST = 89
112    IP_FW_TABLE_XDESTROY = 90
113    IP_FW_TABLES_XLIST = 92
114    IP_FW_TABLE_XINFO = 93
115    IP_FW_TABLE_XFLUSH = 94
116    IP_FW_TABLE_XCREATE = 95
117    IP_FW_TABLE_XMODIFY = 96
118    IP_FW_XGET = 97
119    IP_FW_XADD = 98
120    IP_FW_XDEL = 99
121    IP_FW_XMOVE = 100
122    IP_FW_XZERO = 101
123    IP_FW_XRESETLOG = 102
124    IP_FW_SET_SWAP = 103
125    IP_FW_SET_MOVE = 104
126    IP_FW_SET_ENABLE = 105
127    IP_FW_TABLE_XFIND = 106
128    IP_FW_XIFLIST = 107
129    IP_FW_TABLES_ALIST = 108
130    IP_FW_TABLE_XSWAP = 109
131    IP_FW_TABLE_VLIST = 110
132    IP_FW_NAT44_XCONFIG = 111
133    IP_FW_NAT44_DESTROY = 112
134    IP_FW_NAT44_XGETCONFIG = 113
135    IP_FW_NAT44_LIST_NAT = 114
136    IP_FW_NAT44_XGETLOG = 115
137    IP_FW_DUMP_SOPTCODES = 116
138    IP_FW_DUMP_SRVOBJECTS = 117
139    IP_FW_NAT64STL_CREATE = 130
140    IP_FW_NAT64STL_DESTROY = 131
141    IP_FW_NAT64STL_CONFIG = 132
142    IP_FW_NAT64STL_LIST = 133
143    IP_FW_NAT64STL_STATS = 134
144    IP_FW_NAT64STL_RESET_STATS = 135
145    IP_FW_NAT64LSN_CREATE = 140
146    IP_FW_NAT64LSN_DESTROY = 141
147    IP_FW_NAT64LSN_CONFIG = 142
148    IP_FW_NAT64LSN_LIST = 143
149    IP_FW_NAT64LSN_STATS = 144
150    IP_FW_NAT64LSN_LIST_STATES = 145
151    IP_FW_NAT64LSN_RESET_STATS = 146
152    IP_FW_NPTV6_CREATE = 150
153    IP_FW_NPTV6_DESTROY = 151
154    IP_FW_NPTV6_CONFIG = 152
155    IP_FW_NPTV6_LIST = 153
156    IP_FW_NPTV6_STATS = 154
157    IP_FW_NPTV6_RESET_STATS = 155
158    IP_FW_NAT64CLAT_CREATE = 160
159    IP_FW_NAT64CLAT_DESTROY = 161
160    IP_FW_NAT64CLAT_CONFIG = 162
161    IP_FW_NAT64CLAT_LIST = 163
162    IP_FW_NAT64CLAT_STATS = 164
163    IP_FW_NAT64CLAT_RESET_STATS = 165
164
165
166class IcmpRejectCode(Enum):
167    ICMP_UNREACH_NET = 0
168    ICMP_UNREACH_HOST = 1
169    ICMP_UNREACH_PROTOCOL = 2
170    ICMP_UNREACH_PORT = 3
171    ICMP_UNREACH_NEEDFRAG = 4
172    ICMP_UNREACH_SRCFAIL = 5
173    ICMP_UNREACH_NET_UNKNOWN = 6
174    ICMP_UNREACH_HOST_UNKNOWN = 7
175    ICMP_UNREACH_ISOLATED = 8
176    ICMP_UNREACH_NET_PROHIB = 9
177    ICMP_UNREACH_HOST_PROHIB = 10
178    ICMP_UNREACH_TOSNET = 11
179    ICMP_UNREACH_TOSHOST = 12
180    ICMP_UNREACH_FILTER_PROHIB = 13
181    ICMP_UNREACH_HOST_PRECEDENCE = 14
182    ICMP_UNREACH_PRECEDENCE_CUTOFF = 15
183    ICMP_REJECT_RST = 256
184    ICMP_REJECT_ABORT = 257
185
186
187class Icmp6RejectCode(Enum):
188    ICMP6_DST_UNREACH_NOROUTE = 0
189    ICMP6_DST_UNREACH_ADMIN = 1
190    ICMP6_DST_UNREACH_BEYONDSCOPE = 2
191    ICMP6_DST_UNREACH_NOTNEIGHBOR = 2
192    ICMP6_DST_UNREACH_ADDR = 3
193    ICMP6_DST_UNREACH_NOPORT = 4
194    ICMP6_DST_UNREACH_POLICY = 5
195    ICMP6_DST_UNREACH_REJECT = 6
196    ICMP6_DST_UNREACH_SRCROUTE = 7
197    ICMP6_UNREACH_RST = 256
198    ICMP6_UNREACH_ABORT = 257
199