Print this page
XXXX adding PID information to netstat output

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/socketvar.h
          +++ new/usr/src/uts/common/sys/socketvar.h
↓ open down ↓ 38 lines elided ↑ open up ↑
  39   39   * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
  40   40   */
  41   41  
  42   42  #ifndef _SYS_SOCKETVAR_H
  43   43  #define _SYS_SOCKETVAR_H
  44   44  
  45   45  #include <sys/types.h>
  46   46  #include <sys/stream.h>
  47   47  #include <sys/t_lock.h>
  48   48  #include <sys/cred.h>
       49 +#include <sys/pidnode.h>
  49   50  #include <sys/vnode.h>
  50   51  #include <sys/file.h>
  51   52  #include <sys/param.h>
  52   53  #include <sys/zone.h>
  53   54  #include <sys/sdt.h>
  54   55  #include <sys/modctl.h>
  55   56  #include <sys/atomic.h>
  56   57  #include <sys/socket.h>
  57   58  #include <sys/ksocket.h>
  58   59  #include <sys/kstat.h>
↓ open down ↓ 178 lines elided ↑ open up ↑
 237  238  
 238  239          /* != NULL for sodirect enabled socket */
 239  240          struct sodirect_s       *so_direct;
 240  241  
 241  242          /* socket filters */
 242  243          uint_t                  so_filter_active;       /* # of active fil */
 243  244          uint_t                  so_filter_tx;           /* pending tx ops */
 244  245          struct sof_instance     *so_filter_top;         /* top of stack */
 245  246          struct sof_instance     *so_filter_bottom;      /* bottom of stack */
 246  247          clock_t                 so_filter_defertime;    /* time when deferred */
      248 +
      249 +        /* pid list */
      250 +        list_t                  so_pid_list;
      251 +        kmutex_t                so_pid_list_lock;
 247  252  };
 248  253  
 249  254  #define SO_HAVE_DATA(so)                                                \
 250  255          /*                                                              \
 251  256           * For the (tid == 0) case we must check so_rcv_{q_,}head       \
 252  257           * rather than (so_rcv_queued > 0), since the latter does not   \
 253  258           * take into account mblks with only control/name information.  \
 254  259           */                                                             \
 255  260          ((so)->so_rcv_timer_tid == 0 && ((so)->so_rcv_head != NULL ||   \
 256  261          (so)->so_rcv_q_head != NULL)) ||                                \
↓ open down ↓ 689 lines elided ↑ open up ↑
 946  951  extern int      so_copyin(const void *, void *, size_t, int);
 947  952  extern int      so_copyout(const void *, void *, size_t, int);
 948  953  
 949  954  #endif
 950  955  
 951  956  /*
 952  957   * Internal structure for obtaining sonode information from the socklist.
 953  958   * These types match those corresponding in the sonode structure.
 954  959   * This is not a published interface, and may change at any time.
 955  960   */
      961 +
      962 +#define ADRSTRLEN (2 * sizeof (uint64_t) + 1)
      963 +
 956  964  struct sockinfo {
 957  965          uint_t          si_size;                /* real length of this struct */
 958  966          short           si_family;
 959  967          short           si_type;
 960  968          ushort_t        si_flag;
 961  969          uint_t          si_state;
 962  970          uint_t          si_ux_laddr_sou_magic;
 963  971          uint_t          si_ux_faddr_sou_magic;
 964  972          t_scalar_t      si_serv_type;
 965  973          t_uscalar_t     si_laddr_soa_len;
 966  974          t_uscalar_t     si_faddr_soa_len;
 967  975          uint16_t        si_laddr_family;
 968  976          uint16_t        si_faddr_family;
 969  977          char            si_laddr_sun_path[MAXPATHLEN + 1]; /* NULL terminated */
 970  978          char            si_faddr_sun_path[MAXPATHLEN + 1];
 971  979          boolean_t       si_faddr_noxlate;
 972  980          zoneid_t        si_szoneid;
      981 +        char            si_son_straddr[ADRSTRLEN];
      982 +        char            si_lvn_straddr[ADRSTRLEN];
      983 +        char            si_fvn_straddr[ADRSTRLEN];
      984 +        uint_t          si_pn_cnt;
      985 +        conn_pid_node_t si_pns[1];
 973  986  };
 974  987  
 975  988  /*
 976  989   * Subcodes for sockconf() system call
 977  990   */
 978  991  #define SOCKCONFIG_ADD_SOCK             0
 979  992  #define SOCKCONFIG_REMOVE_SOCK          1
 980  993  #define SOCKCONFIG_ADD_FILTER           2
 981  994  #define SOCKCONFIG_REMOVE_FILTER        3
 982  995  #define SOCKCONFIG_GET_SOCKTABLE        4
↓ open down ↓ 87 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX