]>
Commit | Line | Data |
---|---|---|
cb323159 A |
1 | def enum(*sequential, **named): |
2 | enums = dict(zip(sequential, range(len(sequential))), **named) | |
3 | reverse = dict((value, key) for key, value in enums.iteritems()) | |
4 | enums['reverse_mapping'] = reverse | |
5 | return type('Enum', (), enums) | |
6 | ||
7 | Mbuf_Type = enum( | |
8 | 'MT_FREE', | |
9 | 'MT_DATA', | |
10 | 'MT_HEADER', | |
11 | 'MT_SOCKET', | |
12 | 'MT_PCB', | |
13 | 'MT_RTABLE', | |
14 | 'MT_HTABLE', | |
15 | 'MT_ATABLE', | |
16 | 'MT_SONAME', | |
17 | 'MT_SOOPTS', | |
18 | 'MT_FTABLE', | |
19 | 'MT_RIGHTS', | |
20 | 'MT_IFADDR', | |
21 | 'MT_CONTROL', | |
22 | 'MT_OOBDATA', | |
23 | 'MT_TAG', | |
24 | 'MT_LAST') | |
25 | ||
26 | M_EXT = 0x0001 | |
27 | M_PKTHDR = 0x0002 | |
28 | M_EOR = 0x0004 | |
29 | M_PROTO1 = 0x0008 | |
30 | M_PROTO2 = 0x0010 | |
31 | M_PROTO3 = 0x0020 | |
32 | M_LOOP = 0x0040 | |
33 | M_PROTO5 = 0x0080 | |
34 | ||
35 | M_BCAST = 0x0100 | |
36 | M_MCAST = 0x0200 | |
37 | M_FRAG = 0x0400 | |
38 | M_FIRSTFRAG = 0x0800 | |
39 | M_LASTFRAG = 0x1000 | |
40 | M_PROMISC = 0x2000 | |
41 | M_HASFCS = 0x4000 | |
42 | M_TAGHDR = 0x8000 | |
43 | ||
44 | dlil_if_flags_strings = ["DLIF_INUSE", | |
45 | "DLIF_REUSE", | |
46 | "DLIF_DEBUG" | |
47 | ] | |
48 | ||
39236c6e A |
49 | if_capenable_strings = ["RXCSUM", |
50 | "TXCSUM", | |
51 | "VLAN_MTU", | |
52 | "VLAN_HWTAGGING", | |
53 | "JUMBO_MTU", | |
54 | "TSO4", | |
55 | "TSO6", | |
56 | "LRO", | |
57 | "AV", | |
cc8bc92a A |
58 | "TXSTATUS", |
59 | "CHANNEL_IO", | |
60 | "HW_TIMESTAMP", | |
61 | "SW_TIMESTAMP", | |
62 | "CSUM_PARTIAL", | |
63 | "CSUM_ZERO_INVERT" | |
39236c6e A |
64 | ] |
65 | ||
66 | if_flags_strings = ["UP", | |
67 | "BROADCAST", | |
68 | "DEBUG", | |
69 | "LOOPBACK", | |
70 | "POINTOPOINT", | |
71 | "NOTRAILERS (deprecated)", | |
72 | "RUNNING", | |
73 | "NOARP", | |
74 | "PROMISC", | |
75 | "ALLMULTI", | |
76 | "OACTIVE", | |
77 | "SIMPLEX", | |
78 | "LINK0", | |
79 | "LINK1", | |
80 | "LINK2-ALTPHYS", | |
81 | "MULTICAST" | |
82 | ] | |
83 | ||
cb323159 A |
84 | if_refflags_strings = ["IFRF_EMBRYONIC", |
85 | "IFRF_ATTACHED", | |
86 | "IFRF_DETACHING" | |
87 | ] | |
88 | ||
39236c6e A |
89 | if_eflags_strings = ["AUTOCONFIGURING", |
90 | "unused", | |
91 | "unused", | |
92 | "unused", | |
93 | "unused", | |
94 | "DVR_REENTRY_OK (deprecated)", | |
95 | "ACCEPT_RTADV", | |
96 | "TXSTART", | |
97 | "RXPOLL", | |
98 | "VLAN", | |
99 | "BOND", | |
100 | "ARPLL", | |
101 | "NOWINDOWSCALE", | |
102 | "NOAUTOIPV6LL", | |
103 | "unused", | |
104 | "IPV4_ROUTER", | |
105 | "IPV6_ROUTER", | |
106 | "LOCALNET_PRIVATE", | |
107 | "IPV6_ND6ALT", | |
108 | "RESTRICTED_RECV", | |
109 | "AWDL", | |
110 | "NOACKPRI", | |
111 | "unused", | |
112 | "unused", | |
113 | "unused", | |
114 | "unused", | |
115 | "unused", | |
116 | "unused", | |
117 | "SENDLIST", | |
118 | "REUSE (deprecated)", | |
119 | "INUSE (deprecated)", | |
120 | "UPDOWNCHANGE" | |
121 | ] | |
122 | ||
123 | AF_INET = 2 | |
124 | AF_INET6 = 30 | |
125 | AF_LINK = 18 | |
126 | ||
127 | INP_IPV4 = 0x1 | |
128 | INP_IPV6 = 0x2 | |
129 | ||
130 | CTRACE_STACK_SIZE = 8 | |
131 | ||
132 | IFMA_TRACE_HIST_SIZE = 32 | |
133 | RTD_TRACE_HIST_SIZE = 4 | |
134 | INIFA_TRACE_HIST_SIZE = 32 | |
135 | IN6IFA_TRACE_HIST_SIZE = 32 | |
136 | INM_TRACE_HIST_SIZE = 32 | |
137 | IF_REF_TRACE_HIST_SIZE = 8 | |
138 | NDPR_TRACE_HIST_SIZE = 32 | |
139 | NDDR_TRACE_HIST_SIZE = 32 | |
140 | IMO_TRACE_HIST_SIZE = 32 | |
141 | IM6O_TRACE_HIST_SIZE = 32 | |
142 | ||
143 | INP_RECVOPTS = 0x01 | |
144 | INP_RECVRETOPTS = 0x02 | |
145 | INP_RECVDSTADDR = 0x04 | |
146 | INP_HDRINCL = 0x08 | |
147 | INP_HIGHPORT = 0x10 | |
148 | INP_LOWPORT = 0x20 | |
149 | INP_ANONPORT = 0x40 | |
150 | INP_RECVIF = 0x80 | |
151 | INP_MTUDISC = 0x100 | |
152 | INP_STRIPHDR = 0x200 | |
153 | INP_RECV_ANYIF = 0x400 | |
154 | INP_INADDR_ANY = 0x800 | |
155 | INP_RECVTTL = 0x1000 | |
156 | INP_UDP_NOCKSUM = 0x2000 | |
157 | INP_BOUND_IF = 0x4000 | |
158 | IN6P_IPV6_V6ONLY = 0x008000 | |
159 | IN6P_PKTINFO = 0x010000 | |
160 | IN6P_HOPLIMIT = 0x020000 | |
161 | IN6P_HOPOPTS = 0x040000 | |
162 | IN6P_DSTOPTS = 0x080000 | |
163 | IN6P_RTHDR = 0x100000 | |
164 | IN6P_RTHDRDSTOPTS = 0x200000 | |
165 | IN6P_TCLASS = 0x400000 | |
166 | IN6P_AUTOFLOWLABEL = 0x800000 | |
167 | IN6P_BINDV6ONLY = 0x10000000 | |
168 | IN6P_RFC2292 = 0x02000000 | |
169 | IN6P_MTU = 0x04000000 | |
170 | INP_PKTINFO = 0x08000000 | |
171 | INP_FLOW_SUSPENDED = 0x10000000 | |
172 | INP_NO_IFT_CELLULAR = 0x20000000 | |
173 | INP_FLOW_CONTROLLED = 0x40000000 | |
174 | INP_FC_FEEDBACK = 0x80000000 | |
175 | INPCB_STATE_INUSE = 0x1 | |
176 | INPCB_STATE_CACHED = 0x2 | |
177 | INPCB_STATE_DEAD = 0x3 | |
178 | ||
179 | INP2_TIMEWAIT = 0x00000001 | |
180 | INP2_IN_FCTREE = 0x00000002 | |
fe8ab488 | 181 | INP2_WANT_APP_POLICY = 0x00000004 |
39236c6e A |
182 | |
183 | N_TIME_WAIT_SLOTS = 128 |