Print this page
4770 soconfig(1M) needs an option to print the in-kernel socket configuration table

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/socketvar.h
          +++ new/usr/src/uts/common/sys/socketvar.h
↓ open down ↓ 27 lines elided ↑ open up ↑
  28   28  
  29   29  /*
  30   30   * University Copyright- Copyright (c) 1982, 1986, 1988
  31   31   * The Regents of the University of California
  32   32   * All Rights Reserved
  33   33   *
  34   34   * University Acknowledgment- Portions of this document are derived from
  35   35   * software developed by the University of California, Berkeley, and its
  36   36   * contributors.
  37   37   */
       38 +/*
       39 + * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
       40 + */
  38   41  
  39   42  #ifndef _SYS_SOCKETVAR_H
  40   43  #define _SYS_SOCKETVAR_H
  41   44  
  42   45  #include <sys/types.h>
  43   46  #include <sys/stream.h>
  44   47  #include <sys/t_lock.h>
  45   48  #include <sys/cred.h>
  46   49  #include <sys/vnode.h>
  47   50  #include <sys/file.h>
↓ open down ↓ 451 lines elided ↑ open up ↑
 499  502      const char *, int, int *);
 500  503  extern void sockparams_ephemeral_drop_last_ref(struct sockparams *);
 501  504  
 502  505  extern struct sockparams *sockparams_create(int, int, int, char *, char *, int,
 503  506      int, int, int *);
 504  507  extern void     sockparams_destroy(struct sockparams *);
 505  508  extern int      sockparams_add(struct sockparams *);
 506  509  extern int      sockparams_delete(int, int, int);
 507  510  extern int      sockparams_new_filter(struct sof_entry *);
 508  511  extern void     sockparams_filter_cleanup(struct sof_entry *);
      512 +extern int      sockparams_copyout_socktable(uintptr_t);
 509  513  
 510  514  extern void smod_init(void);
 511  515  extern void smod_add(smod_info_t *);
 512  516  extern int smod_register(const smod_reg_t *);
 513  517  extern int smod_unregister(const char *);
 514  518  extern smod_info_t *smod_lookup_byname(const char *);
 515  519  
 516  520  #define SOCKPARAMS_HAS_DEVICE(sp)                                       \
 517  521          ((sp)->sp_sdev_info.sd_devpath != NULL)
 518  522  
↓ open down ↓ 449 lines elided ↑ open up ↑
 968  972          zoneid_t        si_szoneid;
 969  973  };
 970  974  
 971  975  /*
 972  976   * Subcodes for sockconf() system call
 973  977   */
 974  978  #define SOCKCONFIG_ADD_SOCK             0
 975  979  #define SOCKCONFIG_REMOVE_SOCK          1
 976  980  #define SOCKCONFIG_ADD_FILTER           2
 977  981  #define SOCKCONFIG_REMOVE_FILTER        3
      982 +#define SOCKCONFIG_GET_SOCKTABLE        4
 978  983  
 979  984  /*
 980  985   * Data structures for configuring socket filters.
 981  986   */
 982  987  
 983  988  /*
 984  989   * Placement hint for automatic filters
 985  990   */
 986  991  typedef enum {
 987  992          SOF_HINT_NONE,
↓ open down ↓ 18 lines elided ↑ open up ↑
1006 1011   */
1007 1012  struct sockconfig_filter_props {
1008 1013          char            *sfp_modname;
1009 1014          boolean_t       sfp_autoattach;
1010 1015          sof_hint_t      sfp_hint;
1011 1016          char            *sfp_hintarg;
1012 1017          uint_t          sfp_socktuple_cnt;
1013 1018          sof_socktuple_t *sfp_socktuple;
1014 1019  };
1015 1020  
     1021 +/*
     1022 + * Data structures for the in-kernel socket configuration table.
     1023 + */
     1024 +typedef struct sockconfig_socktable_entry {
     1025 +        int             se_family;
     1026 +        int             se_type;
     1027 +        int             se_protocol;
     1028 +        int             se_refcnt;
     1029 +        int             se_flags;
     1030 +        char            se_modname[MODMAXNAMELEN];
     1031 +        char            se_strdev[MAXPATHLEN];
     1032 +} sockconfig_socktable_entry_t;
     1033 +
     1034 +typedef struct sockconfig_socktable {
     1035 +        uint_t          num_of_entries;
     1036 +        sockconfig_socktable_entry_t *st_entries;
     1037 +} sockconfig_socktable_t;
     1038 +
1016 1039  #ifdef  _SYSCALL32
1017 1040  
1018 1041  typedef struct sof_socktuple32 {
1019 1042          int32_t sofst_family;
1020 1043          int32_t sofst_type;
1021 1044          int32_t sofst_protocol;
1022 1045  } sof_socktuple32_t;
1023 1046  
1024 1047  struct sockconfig_filter_props32 {
1025 1048          caddr32_t       sfp_modname;
1026 1049          boolean_t       sfp_autoattach;
1027 1050          sof_hint_t      sfp_hint;
1028 1051          caddr32_t       sfp_hintarg;
1029 1052          uint32_t        sfp_socktuple_cnt;
1030 1053          caddr32_t       sfp_socktuple;
1031 1054  };
1032 1055  
     1056 +typedef struct sockconfig_socktable32 {
     1057 +        uint_t          num_of_entries;
     1058 +        caddr32_t       st_entries;
     1059 +} sockconfig_socktable32_t;
     1060 +
1033 1061  #endif  /* _SYSCALL32 */
1034 1062  
1035 1063  #define SOCKMOD_PATH    "socketmod"     /* dir where sockmods are stored */
1036 1064  
1037 1065  #ifdef  __cplusplus
1038 1066  }
1039 1067  #endif
1040 1068  
1041 1069  #endif  /* _SYS_SOCKETVAR_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX