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_STATS_H
  17 #define _INET_DCCP_DCCP_STATS_H
  18 
  19 #include <sys/netstack.h>
  20 #include <sys/cpuvar.h>
  21 
  22 #ifdef  __cplusplus
  23 extern "C" {
  24 #endif
  25 
  26 typedef struct dccp_stat_counter_s {
  27         uint64_t        dccp_no_listener;
  28         uint64_t        dccp_listendrop;
  29         uint64_t        dccp_sock_fallback;
  30         uint64_t        dccp_rst_unsent;
  31 } dccp_stat_counter_t;
  32 
  33 typedef struct {
  34         uint64_t                dccp_stats_cnt;
  35         mib2_dccp_t             dccp_sc_mib;
  36         dccp_stat_counter_t     dccp_sc_stats;
  37 } dccp_stats_cpu_t;
  38 
  39 /*
  40  * MIB-II
  41  */
  42 #define DCCPS_BUMP_MIB(dccps, x) \
  43         BUMP_MIB(&(dccps)->dccps_sc[CPU->cpu_seqid]->dccp_sc_mib, x)
  44 
  45 #define DCCP_STAT(dccps, x)     \
  46         ((dccps)->dccps_sc[CPU->cpu_seqid]->dccp_sc_stats.x++)
  47 
  48 #ifdef  __cplusplus
  49 }
  50 #endif
  51 
  52 #endif  /* _INET_DCCP_DCCP_STATS_H */