1 /* 2 * This file and its contents are supplied under the terms of the 3 * Common Development and Distribution License ("CDDL"), version 1.0. 4 * You may only use this file in accordance with the terms of version 5 * 1.0 of the CDDL. 6 * 7 * A full copy of the text of the CDDL should have accompanied this 8 * source. A copy of the CDDL is also available via the Internet at 9 * http://www.illumos.org/license/CDDL. 10 */ 11 12 /* 13 * Copyright 2015 Mohamed A. Khalfella <khalfella@gmail.com> 14 */ 15 16 #ifndef _SYS_PIDNODE_H 17 #define _SYS_PIDNODE_H 18 19 #include <sys/avl.h> 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 #define CONN_PID_INFO_MGC 0x5A7A0B1D 26 27 #define CONN_PID_INFO_NON 0 28 #define CONN_PID_INFO_SOC 1 29 #define CONN_PID_INFO_XTI 2 30 31 typedef struct conn_pid_info_s { 32 uint16_t cpi_contents; /* CONN_PID_INFO_* */ 33 uint32_t cpi_magic; /* CONN_PID_INFO_MGC */ 34 uint32_t cpi_pids_cnt; /* # of elements in cpi_pids */ 35 uint32_t cpi_tot_size; /* total size of hdr + pids */ 36 pid_t cpi_pids[1]; /* varialbe length array of pids */ 37 } conn_pid_info_t; 38 39 #if defined(_KERNEL) 40 41 typedef struct pid_node_s { 42 avl_node_t pn_ref_link; 43 uint32_t pn_count; 44 pid_t pn_pid; 45 } pid_node_t; 46 47 extern int pid_node_comparator(const void *, const void *); 48 49 #endif /* defined(_KERNEL) */ 50 51 #ifdef __cplusplus 52 } 53 #endif 54 55 #endif /* _SYS_PIDNODE_H */