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 
  22 #include <inet/dccp/dccp_stats.h>
  23 
  24 #ifdef  __cplusplus
  25 extern "C" {
  26 #endif
  27 
  28 /*
  29  * DCCP stack instances
  30  */
  31 typedef struct dccp_stack {
  32         netstack_t              *dccps_netstack;        /* Common netstack */
  33 
  34         uint_t                  dccps_bind_fanout_size;
  35         struct dccp_df_s        *dccps_bind_fanout;
  36 
  37         /* Ports */
  38 #define DCCP_NUM_EPRIV_PORTS    64
  39         int                     dccps_num_epriv_ports;
  40         in_port_t               dccps_epriv_ports[DCCP_NUM_EPRIV_PORTS];
  41         kmutex_t                dccps_epriv_port_lock;
  42 
  43         uint_t                  dccps_next_port_to_try;
  44 
  45         in_port_t               dccps_min_anonpriv_port;
  46 
  47         /* Reset rate control */
  48         int64_t                 dccps_last_rst_intrvl;
  49         uint32_t                dccps_rst_cnt;
  50 
  51         /* Tunables table */
  52         struct mod_prop_info_s  *dccps_propinfo_tbl;
  53 
  54         ldi_ident_t             dccps_ldi_ident;
  55 
  56         /* Cpu stats counter */
  57         dccp_stats_cpu_t        **dccps_sc;
  58         int                     dccps_sc_cnt;
  59 } dccp_stack_t;
  60 
  61 #ifdef  __cplusplus
  62 }
  63 #endif
  64 
  65 #endif  /* _INET_DCCP_DCCP_STACK_H */