]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/kern/socket_info.c
xnu-4903.221.2.tar.gz
[apple/xnu.git] / bsd / kern / socket_info.c
index 157b47dc3dabf30074740b68caa7853774b03de5..4713bf2608379adb9a9551169499f04511aabd22 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005-2013 Apple Inc. All rights reserved.
+ * Copyright (c) 2005-2015 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  *
@@ -149,12 +149,14 @@ fill_socketinfo(struct socket *so, struct socket_info *si)
                        si->soi_kind = SOCKINFO_TCP;
 
                        tcpsi->tcpsi_state = tp->t_state;
-                       tcpsi->tcpsi_timer[TCPT_REXMT] =
+                       tcpsi->tcpsi_timer[TSI_T_REXMT] =
                            tp->t_timer[TCPT_REXMT];
-                       tcpsi->tcpsi_timer[TCPT_PERSIST] =
+                       tcpsi->tcpsi_timer[TSI_T_PERSIST] =
                            tp->t_timer[TCPT_PERSIST];
-                       tcpsi->tcpsi_timer[TCPT_KEEP] = tp->t_timer[TCPT_KEEP];
-                       tcpsi->tcpsi_timer[TCPT_2MSL] = tp->t_timer[TCPT_2MSL];
+                       tcpsi->tcpsi_timer[TSI_T_KEEP] =
+                           tp->t_timer[TCPT_KEEP];
+                       tcpsi->tcpsi_timer[TSI_T_2MSL] =
+                           tp->t_timer[TCPT_2MSL];
                        tcpsi->tcpsi_mss = tp->t_maxseg;
                        tcpsi->tcpsi_flags = tp->t_flags;
                        tcpsi->tcpsi_tp =
@@ -220,24 +222,8 @@ fill_socketinfo(struct socket *so, struct socket_info *si)
                            ev_pcb->evp_vendor_code_filter;
                        kesi->kesi_class_filter = ev_pcb->evp_class_filter;
                        kesi->kesi_subclass_filter = ev_pcb->evp_subclass_filter;
-
                } else if (SOCK_PROTO(so) == SYSPROTO_CONTROL) {
-                       struct ctl_cb *kcb = (struct ctl_cb *)so->so_pcb;
-                       struct kern_ctl_info *kcsi =
-                           &si->soi_proto.pri_kern_ctl;
-                       struct kctl *kctl = kcb->kctl;
-
-                       si->soi_kind = SOCKINFO_KERN_CTL;
-
-                       if (kctl == 0)
-                               break;
-                       kcsi->kcsi_id = kctl->id;
-                       kcsi->kcsi_reg_unit = kctl->id;
-                       kcsi->kcsi_flags = kctl->flags;
-                       kcsi->kcsi_recvbufsize = kctl->recvbufsize;
-                       kcsi->kcsi_sendbufsize = kctl->sendbufsize;
-                       kcsi->kcsi_unit = kcb->unit;
-                       strlcpy(kcsi->kcsi_name, kctl->name, MAX_KCTL_NAME);
+                       kctl_fill_socketinfo(so, si);
                }
                break;