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 2012 David Hoeppner.  All rights reserved.
  14  */
  15 
  16 #ifndef _INET_DCCP_DCCP_STACK_H
  17 #define _INET_DCCP_DCCP_STACK_H
  18 
  19 #include <sys/netstack.h>
  20 #include <sys/cpuvar.h>
  21 #include <sys/sunddi.h>
  22 #include <sys/sunldi.h>
  23 #include <inet/ip.h>
  24 #include <inet/ipdrop.h>
  25 #include <inet/dccp_stats.h>
  26 
  27 #ifdef  __cplusplus
  28 extern "C" {
  29 #endif
  30 
  31 /*
  32  * DCCP stack instances
  33  */
  34 typedef struct dccp_stack {
  35         netstack_t              *dccps_netstack;        /* Common netstack */
  36 
  37         uint_t                  dccps_bind_fanout_size;
  38         struct dccp_df_s        *dccps_bind_fanout;
  39 
  40         /*
  41          * Privileged ports.
  42          */
  43 #define DCCP_NUM_EPRIV_PORTS    64
  44         int                     dccps_num_epriv_ports;
  45         in_port_t               dccps_epriv_ports[DCCP_NUM_EPRIV_PORTS];
  46         kmutex_t                dccps_epriv_port_lock;
  47 
  48         in_port_t               dccps_min_anonpriv_port;
  49         uint_t                  dccps_next_port_to_try;
  50 
  51         /* Reset rate control */
  52         int64_t                 dccps_last_rst_intrvl;
  53         uint32_t                dccps_rst_cnt;
  54 
  55         /* Tunables table */
  56         struct mod_prop_info_s  *dccps_propinfo_tbl;
  57 
  58         ldi_ident_t             dccps_ldi_ident;
  59 
  60         /* MIB-II kernel statistics */
  61         kstat_t                 *dccps_mibkp;
  62         kstat_t                 *dccps_kstat;
  63 
  64         /* CPU stats counter */
  65         dccp_stats_cpu_t        **dccps_sc;
  66         int                     dccps_sc_cnt;
  67 } dccp_stack_t;
  68 
  69 #ifdef  __cplusplus
  70 }
  71 #endif
  72 
  73 #endif  /* _INET_DCCP_DCCP_STACK_H */