]> git.saurik.com Git - apple/xnu.git/blobdiff - tools/lldbmacros/netdefines.py
xnu-6153.41.3.tar.gz
[apple/xnu.git] / tools / lldbmacros / netdefines.py
old mode 100644 (file)
new mode 100755 (executable)
index 8fff027..d894ab0
@@ -1,3 +1,51 @@
+def enum(*sequential, **named):
+    enums = dict(zip(sequential, range(len(sequential))), **named)
+    reverse = dict((value, key) for key, value in enums.iteritems())
+    enums['reverse_mapping'] = reverse
+    return type('Enum', (), enums)
+
+Mbuf_Type = enum(
+    'MT_FREE',
+    'MT_DATA',
+    'MT_HEADER',
+    'MT_SOCKET',
+    'MT_PCB',
+    'MT_RTABLE',
+    'MT_HTABLE',
+    'MT_ATABLE',
+    'MT_SONAME',
+    'MT_SOOPTS',
+    'MT_FTABLE',
+    'MT_RIGHTS',
+    'MT_IFADDR',
+    'MT_CONTROL',
+    'MT_OOBDATA',
+    'MT_TAG',
+    'MT_LAST')
+
+M_EXT           = 0x0001
+M_PKTHDR        = 0x0002
+M_EOR           = 0x0004
+M_PROTO1        = 0x0008
+M_PROTO2        = 0x0010
+M_PROTO3        = 0x0020
+M_LOOP          = 0x0040
+M_PROTO5        = 0x0080
+
+M_BCAST         = 0x0100
+M_MCAST         = 0x0200
+M_FRAG          = 0x0400
+M_FIRSTFRAG     = 0x0800
+M_LASTFRAG      = 0x1000
+M_PROMISC       = 0x2000
+M_HASFCS        = 0x4000
+M_TAGHDR        = 0x8000
+
+dlil_if_flags_strings = ["DLIF_INUSE",
+                         "DLIF_REUSE",
+                         "DLIF_DEBUG"
+                        ]
+
 if_capenable_strings = ["RXCSUM",
                         "TXCSUM", 
                         "VLAN_MTU", 
@@ -7,7 +55,12 @@ if_capenable_strings = ["RXCSUM",
                         "TSO6",
                         "LRO",
                         "AV",
-                        "TXSTATUS"
+                        "TXSTATUS",
+                        "CHANNEL_IO",
+                        "HW_TIMESTAMP",
+                        "SW_TIMESTAMP",
+                        "CSUM_PARTIAL",
+                        "CSUM_ZERO_INVERT"
                        ]
 
 if_flags_strings = ["UP",
@@ -28,6 +81,11 @@ if_flags_strings = ["UP",
                     "MULTICAST"
                     ]
 
+if_refflags_strings = ["IFRF_EMBRYONIC",
+                       "IFRF_ATTACHED",
+                       "IFRF_DETACHING"
+                      ]
+
 if_eflags_strings = ["AUTOCONFIGURING",
                      "unused",
                      "unused",
@@ -120,6 +178,6 @@ INPCB_STATE_DEAD   =       0x3
 
 INP2_TIMEWAIT      =       0x00000001
 INP2_IN_FCTREE     =       0x00000002
-INP2_WANT_FLOW_DIVERT =    0x00000004
+INP2_WANT_APP_POLICY =    0x00000004
 
 N_TIME_WAIT_SLOTS = 128