]> git.saurik.com Git - apple/xnu.git/blobdiff - tools/lldbmacros/net.py
xnu-4570.51.1.tar.gz
[apple/xnu.git] / tools / lldbmacros / net.py
old mode 100644 (file)
new mode 100755 (executable)
index 86c5303..2c6cfd8
@@ -31,11 +31,16 @@ def ShowIfConfiguration(ifnet):
     """ Display ifconfig-like output for the ifnet
     """
     iface = Cast(ifnet, 'ifnet *')
+    dlifnet = Cast(ifnet, 'dlil_ifnet *')
     out_string = ""
     format_string = "{0: <s}: flags={1: <x} <{2: <s}> index {3: <d} mtu {4: <d}"
     if iface :
         out_string += format_string.format(iface.if_xname, (iface.if_flags & 0xffff), GetIfFlagsAsString(iface.if_flags), iface.if_index, iface.if_data.ifi_mtu)
         out_string += "\n\t(struct ifnet *)" + hex(ifnet)
+        if iface.if_snd.ifcq_len :
+            out_string += "\n\t" + str(iface.if_snd.ifcq_len)
+        if dlifnet.dl_if_inpstorage.rcvq_pkts.qlen :
+            out_string += "\n\t" + str(dlifnet.dl_if_inpstorage.rcvq_pkts.qlen)
     print out_string
 
 def GetIfConfiguration(ifname):
@@ -1326,6 +1331,17 @@ def RtEntryTrash(cmd_args=None):
     print out_string
 # EndMacro: rtentry_trash
 
+# Macro: show_rtentry
+@lldb_command('show_rtentry')
+def ShRtEntry(cmd_args=None):
+    """ Print rtentry.
+    """
+    out_string = ""
+    rt = kern.GetValueFromAddress(cmd_args[0], 'rtentry *')
+    out_string += GetRtEntryPrDetailsAsString(rt) + "\n"
+    print out_string
+# EndMacro: show_rtentry
+
 # Macro: inifa_trash
 @lldb_command('inifa_trash')
 def InIfaTrash(cmd_args=None):
@@ -1559,8 +1575,8 @@ def GetInPcb(pcb, proto):
         out_string += "timewait "
     if (pcb.inp_flags2 & INP2_IN_FCTREE):
         out_string += "in_fctree "
-    if (pcb.inp_flags2 & INP2_WANT_FLOW_DIVERT):
-        out_string += "want_flow_divert "
+    if (pcb.inp_flags2 & INP2_WANT_APP_POLICY):
+        out_string += "want_app_policy "
           
     so = pcb.inp_socket
     if (so != 0):
@@ -1608,7 +1624,7 @@ def GetPcbInfo(pcbi, proto):
                 while mp != 0:
                     snd_buf += 256
                     if (mp.m_hdr.mh_flags & 0x01):
-                        snd_buf = mp.M_dat.MH.MH_dat.MH_ext.ext_size
+                        snd_buf += mp.M_dat.MH.MH_dat.MH_ext.ext_size
                     mp = mp.m_hdr.mh_next
                 rcv_cc += so.so_rcv.sb_cc
                 mp = so.so_rcv.sb_mb
@@ -1861,8 +1877,6 @@ def ShowDomains(cmd_args=None):
             out_string += GetSourceInformationForAddress(pru.pru_disconnect) + "\n"
             out_string += "\t    listen:\t"
             out_string += GetSourceInformationForAddress(pru.pru_listen) + "\n"
-            out_string += "\t    peeloff:\t"
-            out_string += GetSourceInformationForAddress(pru.pru_peeloff) + "\n"
             out_string += "\t    peeraddr:\t"
             out_string += GetSourceInformationForAddress(pru.pru_peeraddr) + "\n"
             out_string += "\t    rcvd:\t"