diff options
author | Andy Fiddaman <omnios@citrus-it.co.uk> | 2019-08-22 14:59:11 +0000 |
---|---|---|
committer | Andy Fiddaman <omnios@citrus-it.co.uk> | 2019-10-24 20:12:56 +0000 |
commit | 78a2e113edb6fe0a0382b403b55d92e8f0bba78f (patch) | |
tree | b87dece407956c78f19382fe823691d6d71c415c /usr/src/uts/common/sys/socketvar.h | |
parent | a2e92fdb91a6e5451ecb5488b74ee1e95a4bafd0 (diff) | |
download | illumos-joyent-78a2e113edb6fe0a0382b403b55d92e8f0bba78f.tar.gz |
9531 Want netstat -u to show PIDs associated with sockets
11707 provide 64-bit libdhcpagent
11708 netstat should be smatch and CERRWARN clean
Portions contributed by: Mohamed A. Khalfella <khalfella@gmail.com>
Reviewed by: Robert Mustacchi <rm@fingolfin.org>
Reviewed by: Dominik Hassler <hadfl@omniosce.org>
Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src/uts/common/sys/socketvar.h')
-rw-r--r-- | usr/src/uts/common/sys/socketvar.h | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/usr/src/uts/common/sys/socketvar.h b/usr/src/uts/common/sys/socketvar.h index ac07bad909..f5c4d801de 100644 --- a/usr/src/uts/common/sys/socketvar.h +++ b/usr/src/uts/common/sys/socketvar.h @@ -37,6 +37,7 @@ */ /* * Copyright 2015 Nexenta Systems, Inc. All rights reserved. + * Copyright 2019 OmniOS Community Edition (OmniOSce) Association. */ #ifndef _SYS_SOCKETVAR_H @@ -135,7 +136,7 @@ struct sodirect_s; struct sonode { struct vnode *so_vnode; /* vnode associated with this sonode */ - sonodeops_t *so_ops; /* operations vector for this sonode */ + sonodeops_t *so_ops; /* operations vector for this sonode */ void *so_priv; /* sonode private data */ krwlock_t so_fallback_rwlock; @@ -149,12 +150,12 @@ struct sonode { uint_t so_state; /* internal state flags SS_*, below */ uint_t so_mode; /* characteristics on socket. SM_* */ - ushort_t so_flag; /* flags, see below */ + ushort_t so_flag; /* flags, see below */ int so_count; /* count of opened references */ sock_connid_t so_proto_connid; /* protocol generation number */ - ushort_t so_error; /* error affecting connection */ + ushort_t so_error; /* error affecting connection */ struct sockparams *so_sockparams; /* vnode or socket module */ /* Needed to recreate the same socket for accept */ @@ -223,7 +224,7 @@ struct sonode { /* Communication channel with protocol */ sock_lower_handle_t so_proto_handle; - sock_downcalls_t *so_downcalls; + sock_downcalls_t *so_downcalls; struct sock_proto_props so_proto_props; /* protocol settings */ boolean_t so_flowctrld; /* Flow controlled */ @@ -231,7 +232,7 @@ struct sonode { kcondvar_t so_copy_cv; /* Copy cond variable */ /* kernel sockets */ - ksocket_callbacks_t so_ksock_callbacks; + ksocket_callbacks_t so_ksock_callbacks; void *so_ksock_cb_arg; /* callback argument */ kcondvar_t so_closing_cv; @@ -429,7 +430,7 @@ typedef struct smod_info { int smod_version; char *smod_name; uint_t smod_refcnt; /* # of entries */ - size_t smod_uc_version; /* upcall version */ + size_t smod_uc_version; /* upcall version */ size_t smod_dc_version; /* down call version */ so_proto_create_func_t smod_proto_create_func; so_proto_fallback_func_t smod_proto_fallback_func; @@ -504,8 +505,8 @@ extern void sockparams_ephemeral_drop_last_ref(struct sockparams *); extern struct sockparams *sockparams_create(int, int, int, char *, char *, int, int, int, int *); -extern void sockparams_destroy(struct sockparams *); -extern int sockparams_add(struct sockparams *); +extern void sockparams_destroy(struct sockparams *); +extern int sockparams_add(struct sockparams *); extern int sockparams_delete(int, int, int); extern int sockparams_new_filter(struct sof_entry *); extern void sockparams_filter_cleanup(struct sof_entry *); @@ -626,7 +627,7 @@ typedef struct snf_req { int sr_lowat; int sr_operation; struct vnode *sr_vp; - file_t *sr_fp; + file_t *sr_fp; ssize_t sr_maxpsz; u_offset_t sr_file_off; u_offset_t sr_file_size; @@ -652,7 +653,7 @@ struct sendfile_queue { /* Socket network operations switch */ struct sonodeops { - int (*sop_init)(struct sonode *, struct sonode *, cred_t *, + int (*sop_init)(struct sonode *, struct sonode *, cred_t *, int); int (*sop_accept)(struct sonode *, int, cred_t *, struct sonode **); int (*sop_bind)(struct sonode *, struct sockaddr *, socklen_t, @@ -673,13 +674,13 @@ struct sonodeops { int (*sop_shutdown)(struct sonode *, int, cred_t *); int (*sop_getsockopt)(struct sonode *, int, int, void *, socklen_t *, int, cred_t *); - int (*sop_setsockopt)(struct sonode *, int, int, const void *, + int (*sop_setsockopt)(struct sonode *, int, int, const void *, socklen_t, cred_t *); - int (*sop_ioctl)(struct sonode *, int, intptr_t, int, + int (*sop_ioctl)(struct sonode *, int, intptr_t, int, cred_t *, int32_t *); - int (*sop_poll)(struct sonode *, short, int, short *, + int (*sop_poll)(struct sonode *, short, int, short *, struct pollhead **); - int (*sop_close)(struct sonode *, int, cred_t *); + int (*sop_close)(struct sonode *, int, cred_t *); }; #define SOP_INIT(so, flag, cr, flags) \ @@ -951,8 +952,14 @@ extern int so_copyout(const void *, void *, size_t, int); /* * Internal structure for obtaining sonode information from the socklist. * These types match those corresponding in the sonode structure. - * This is not a published interface, and may change at any time. + * This is not a published interface, and may change at any time. It is + * used for passing information back up to the kstat consumers. By converting + * kernel addresses to strings, we should be able to pass information from + * the kernel to userland regardless of n-bit kernel we are using. */ + +#define ADRSTRLEN (2 * sizeof (uint64_t) + 1) + struct sockinfo { uint_t si_size; /* real length of this struct */ short si_family; @@ -970,6 +977,10 @@ struct sockinfo { char si_faddr_sun_path[MAXPATHLEN + 1]; boolean_t si_faddr_noxlate; zoneid_t si_szoneid; + char si_son_straddr[ADRSTRLEN]; + char si_lvn_straddr[ADRSTRLEN]; + char si_fvn_straddr[ADRSTRLEN]; + uint64_t si_inode; }; /* |