Print this page
XXXX adding PID information to netstat output
*** 2720,2724 ****
--- 2720,2750 ----
ctb->ctb_depth = getpcstack(ctb->ctb_stack, CONN_STACK_DEPTH);
connp->conn_trace_last = last;
return (1);
}
#endif
+
+ conn_pid_node_list_hdr_t *
+ conn_get_pid_list(conn_t *connp)
+ {
+ conn_pid_node_list_hdr_t *cph;
+
+ if (connp->conn_upper_handle != NULL) {
+ return (*connp->conn_upcalls->su_get_sock_pid_list)
+ (connp->conn_upper_handle);
+ } else if (!IPCL_IS_NONSTR(connp) && connp->conn_rq != NULL &&
+ connp->conn_rq->q_stream != NULL) {
+ return (sh_get_pid_list(connp->conn_rq->q_stream));
+ }
+
+ /* return an empty header */
+ cph = kmem_zalloc(sizeof (conn_pid_node_list_hdr_t), KM_SLEEP);
+ cph->cph_magic = CONN_PID_NODE_LIST_HDR_MAGIC;
+ cph->cph_contents = CONN_PID_NODE_LIST_HDR_NON;
+ cph->cph_pn_cnt = 0;
+ cph->cph_tot_size = sizeof (conn_pid_node_list_hdr_t);
+ cph->cph_flags = 0;
+ cph->cph_optional1 = 0;
+ cph->cph_optional2 = 0;
+
+ return (cph);
+ }