Print this page
XXXX adding PID information to netstat output

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/strsubr.h
          +++ new/usr/src/uts/common/sys/strsubr.h
↓ open down ↓ 36 lines elided ↑ open up ↑
  37   37   * contents of this file is that if you include it, your
  38   38   * code will not port to the next release.
  39   39   */
  40   40  #include <sys/stream.h>
  41   41  #include <sys/stropts.h>
  42   42  #include <sys/kstat.h>
  43   43  #include <sys/uio.h>
  44   44  #include <sys/proc.h>
  45   45  #include <sys/netstack.h>
  46   46  #include <sys/modhash.h>
       47 +#include <sys/pidnode.h>
  47   48  
  48   49  #ifdef  __cplusplus
  49   50  extern "C" {
  50   51  #endif
  51   52  
  52   53  /*
  53   54   * In general, the STREAMS locks are disjoint; they are only held
  54   55   * locally, and not simultaneously by a thread.  However, module
  55   56   * code, including at the stream head, requires some locks to be
  56   57   * acquired in order for its safety.
↓ open down ↓ 177 lines elided ↑ open up ↑
 234  235          struct queue    *sd_qhead;      /* Head of queues to be serviced. */
 235  236          struct queue    *sd_qtail;      /* Tail of queues to be serviced. */
 236  237          void            *sd_servid;     /* Service ID for bckgrnd schedule */
 237  238          ushort_t        sd_svcflags;    /* Servicing flags */
 238  239          short           sd_nqueues;     /* Number of queues in the list */
 239  240          kcondvar_t      sd_qcv;         /* Waiters for qhead to become empty */
 240  241          kcondvar_t      sd_zcopy_wait;
 241  242          uint_t          sd_copyflag;    /* copy-related flags */
 242  243          zoneid_t        sd_anchorzone;  /* Allow removal from same zone only */
 243  244          struct msgb     *sd_cmdblk;     /* reply from _I_CMD */
      245 +        /*
      246 +         * pids associated with this stream head.
      247 +         */
      248 +        avl_tree_t      sd_pid_tree;
      249 +        kmutex_t        sd_pid_tree_lock;
 244  250  } stdata_t;
 245  251  
 246  252  /*
 247  253   * stdata servicing flags.
 248  254   */
 249  255  #define STRS_WILLSERVICE        0x01
 250  256  #define STRS_SCHEDULED          0x02
 251  257  
 252  258  #define STREAM_NEEDSERVICE(stp) ((stp)->sd_qhead != NULL)
 253  259  
↓ open down ↓ 879 lines elided ↑ open up ↑
1133 1139  extern int strrput(queue_t *, mblk_t *);
1134 1140  extern int strrput_nondata(queue_t *, mblk_t *);
1135 1141  extern mblk_t *strrput_proto(vnode_t *, mblk_t *,
1136 1142      strwakeup_t *, strsigset_t *, strsigset_t *, strpollset_t *);
1137 1143  extern mblk_t *strrput_misc(vnode_t *, mblk_t *,
1138 1144      strwakeup_t *, strsigset_t *, strsigset_t *, strpollset_t *);
1139 1145  extern int getiocseqno(void);
1140 1146  extern int strwaitbuf(size_t, int);
1141 1147  extern int strwaitq(stdata_t *, int, ssize_t, int, clock_t, int *);
1142 1148  extern struct stdata *shalloc(queue_t *);
     1149 +extern void sh_insert_pid(struct stdata *, pid_t);
     1150 +extern void sh_remove_pid(struct stdata *, pid_t);
     1151 +extern mblk_t *sh_get_pid_mblk(struct stdata *);
1143 1152  extern void shfree(struct stdata *s);
1144 1153  extern queue_t *allocq(void);
1145 1154  extern void freeq(queue_t *);
1146 1155  extern qband_t *allocband(void);
1147 1156  extern void freeband(qband_t *);
1148 1157  extern void freebs_enqueue(mblk_t *, dblk_t *);
1149 1158  extern void setqback(queue_t *, unsigned char);
1150 1159  extern int strcopyin(void *, void *, size_t, int);
1151 1160  extern int strcopyout(void *, void *, size_t, int);
1152 1161  extern void strsignal(struct stdata *, int, int32_t);
↓ open down ↓ 195 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX