]> git.saurik.com Git - apple/xnu.git/blame - tools/lldbmacros/netdefines.py
xnu-7195.101.1.tar.gz
[apple/xnu.git] / tools / lldbmacros / netdefines.py
CommitLineData
cb323159
A
1def 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
7Mbuf_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
26M_EXT = 0x0001
27M_PKTHDR = 0x0002
28M_EOR = 0x0004
29M_PROTO1 = 0x0008
30M_PROTO2 = 0x0010
31M_PROTO3 = 0x0020
32M_LOOP = 0x0040
33M_PROTO5 = 0x0080
34
35M_BCAST = 0x0100
36M_MCAST = 0x0200
37M_FRAG = 0x0400
38M_FIRSTFRAG = 0x0800
39M_LASTFRAG = 0x1000
40M_PROMISC = 0x2000
41M_HASFCS = 0x4000
42M_TAGHDR = 0x8000
43
44dlil_if_flags_strings = ["DLIF_INUSE",
45 "DLIF_REUSE",
46 "DLIF_DEBUG"
47 ]
48
39236c6e
A
49if_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
66if_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
84if_refflags_strings = ["IFRF_EMBRYONIC",
85 "IFRF_ATTACHED",
86 "IFRF_DETACHING"
87 ]
88
39236c6e
A
89if_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
123AF_INET = 2
124AF_INET6 = 30
125AF_LINK = 18
126
127INP_IPV4 = 0x1
128INP_IPV6 = 0x2
129
130CTRACE_STACK_SIZE = 8
131
132IFMA_TRACE_HIST_SIZE = 32
133RTD_TRACE_HIST_SIZE = 4
134INIFA_TRACE_HIST_SIZE = 32
135IN6IFA_TRACE_HIST_SIZE = 32
136INM_TRACE_HIST_SIZE = 32
137IF_REF_TRACE_HIST_SIZE = 8
138NDPR_TRACE_HIST_SIZE = 32
139NDDR_TRACE_HIST_SIZE = 32
140IMO_TRACE_HIST_SIZE = 32
141IM6O_TRACE_HIST_SIZE = 32
142
143INP_RECVOPTS = 0x01
144INP_RECVRETOPTS = 0x02
145INP_RECVDSTADDR = 0x04
146INP_HDRINCL = 0x08
147INP_HIGHPORT = 0x10
148INP_LOWPORT = 0x20
149INP_ANONPORT = 0x40
150INP_RECVIF = 0x80
151INP_MTUDISC = 0x100
152INP_STRIPHDR = 0x200
153INP_RECV_ANYIF = 0x400
154INP_INADDR_ANY = 0x800
155INP_RECVTTL = 0x1000
156INP_UDP_NOCKSUM = 0x2000
157INP_BOUND_IF = 0x4000
158IN6P_IPV6_V6ONLY = 0x008000
159IN6P_PKTINFO = 0x010000
160IN6P_HOPLIMIT = 0x020000
161IN6P_HOPOPTS = 0x040000
162IN6P_DSTOPTS = 0x080000
163IN6P_RTHDR = 0x100000
164IN6P_RTHDRDSTOPTS = 0x200000
165IN6P_TCLASS = 0x400000
166IN6P_AUTOFLOWLABEL = 0x800000
167IN6P_BINDV6ONLY = 0x10000000
168IN6P_RFC2292 = 0x02000000
169IN6P_MTU = 0x04000000
170INP_PKTINFO = 0x08000000
171INP_FLOW_SUSPENDED = 0x10000000
172INP_NO_IFT_CELLULAR = 0x20000000
173INP_FLOW_CONTROLLED = 0x40000000
174INP_FC_FEEDBACK = 0x80000000
175INPCB_STATE_INUSE = 0x1
176INPCB_STATE_CACHED = 0x2
177INPCB_STATE_DEAD = 0x3
178
179INP2_TIMEWAIT = 0x00000001
180INP2_IN_FCTREE = 0x00000002
fe8ab488 181INP2_WANT_APP_POLICY = 0x00000004
39236c6e
A
182
183N_TIME_WAIT_SLOTS = 128