Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros
snmp.h File Reference
#include <linux/cache.h>
#include <linux/snmp.h>
#include <linux/smp.h>
#include <linux/u64_stats_sync.h>

Go to the source code of this file.

Data Structures

struct  snmp_mib
 
struct  ipstats_mib
 
struct  icmp_mib
 
struct  icmpmsg_mib
 
struct  icmpv6_mib
 
struct  icmpv6_mib_device
 
struct  icmpv6msg_mib
 
struct  icmpv6msg_mib_device
 
struct  tcp_mib
 
struct  udp_mib
 
struct  linux_mib
 
struct  linux_xfrm_mib
 

Macros

#define SNMP_MIB_ITEM(_name, _entry)
 
#define SNMP_MIB_SENTINEL
 
#define IPSTATS_MIB_MAX   __IPSTATS_MIB_MAX
 
#define ICMP_MIB_MAX   __ICMP_MIB_MAX
 
#define ICMPMSG_MIB_MAX   __ICMPMSG_MIB_MAX
 
#define ICMP6_MIB_MAX   __ICMP6_MIB_MAX
 
#define ICMP6MSG_MIB_MAX   __ICMP6MSG_MIB_MAX
 
#define TCP_MIB_MAX   __TCP_MIB_MAX
 
#define UDP_MIB_MAX   __UDP_MIB_MAX
 
#define LINUX_MIB_MAX   __LINUX_MIB_MAX
 
#define LINUX_MIB_XFRMMAX   __LINUX_MIB_XFRMMAX
 
#define SNMP_ARRAY_SZ   1
 
#define DEFINE_SNMP_STAT(type, name)   __typeof__(type) __percpu *name[SNMP_ARRAY_SZ]
 
#define DEFINE_SNMP_STAT_ATOMIC(type, name)   __typeof__(type) *name
 
#define DECLARE_SNMP_STAT(type, name)   extern __typeof__(type) __percpu *name[SNMP_ARRAY_SZ]
 
#define SNMP_INC_STATS_BH(mib, field)   __this_cpu_inc(mib[0]->mibs[field])
 
#define SNMP_INC_STATS_USER(mib, field)   this_cpu_inc(mib[0]->mibs[field])
 
#define SNMP_INC_STATS_ATOMIC_LONG(mib, field)   atomic_long_inc(&mib->mibs[field])
 
#define SNMP_INC_STATS(mib, field)   this_cpu_inc(mib[0]->mibs[field])
 
#define SNMP_DEC_STATS(mib, field)   this_cpu_dec(mib[0]->mibs[field])
 
#define SNMP_ADD_STATS_BH(mib, field, addend)   __this_cpu_add(mib[0]->mibs[field], addend)
 
#define SNMP_ADD_STATS_USER(mib, field, addend)   this_cpu_add(mib[0]->mibs[field], addend)
 
#define SNMP_ADD_STATS(mib, field, addend)   this_cpu_add(mib[0]->mibs[field], addend)
 
#define SNMP_UPD_PO_STATS(mib, basefield, addend)
 
#define SNMP_UPD_PO_STATS_BH(mib, basefield, addend)
 
#define SNMP_INC_STATS64_BH(mib, field)   SNMP_INC_STATS_BH(mib, field)
 
#define SNMP_INC_STATS64_USER(mib, field)   SNMP_INC_STATS_USER(mib, field)
 
#define SNMP_INC_STATS64(mib, field)   SNMP_INC_STATS(mib, field)
 
#define SNMP_DEC_STATS64(mib, field)   SNMP_DEC_STATS(mib, field)
 
#define SNMP_ADD_STATS64_BH(mib, field, addend)   SNMP_ADD_STATS_BH(mib, field, addend)
 
#define SNMP_ADD_STATS64_USER(mib, field, addend)   SNMP_ADD_STATS_USER(mib, field, addend)
 
#define SNMP_ADD_STATS64(mib, field, addend)   SNMP_ADD_STATS(mib, field, addend)
 
#define SNMP_UPD_PO_STATS64(mib, basefield, addend)   SNMP_UPD_PO_STATS(mib, basefield, addend)
 
#define SNMP_UPD_PO_STATS64_BH(mib, basefield, addend)   SNMP_UPD_PO_STATS_BH(mib, basefield, addend)
 

Macro Definition Documentation

#define DECLARE_SNMP_STAT (   type,
  name 
)    extern __typeof__(type) __percpu *name[SNMP_ARRAY_SZ]

Definition at line 125 of file snmp.h.

#define DEFINE_SNMP_STAT (   type,
  name 
)    __typeof__(type) __percpu *name[SNMP_ARRAY_SZ]

Definition at line 121 of file snmp.h.

#define DEFINE_SNMP_STAT_ATOMIC (   type,
  name 
)    __typeof__(type) *name

Definition at line 123 of file snmp.h.

#define ICMP6_MIB_MAX   __ICMP6_MIB_MAX

Definition at line 74 of file snmp.h.

#define ICMP6MSG_MIB_MAX   __ICMP6MSG_MIB_MAX

Definition at line 84 of file snmp.h.

#define ICMP_MIB_MAX   __ICMP_MIB_MAX

Definition at line 63 of file snmp.h.

#define ICMPMSG_MIB_MAX   __ICMPMSG_MIB_MAX

Definition at line 68 of file snmp.h.

#define IPSTATS_MIB_MAX   __IPSTATS_MIB_MAX

Definition at line 55 of file snmp.h.

#define LINUX_MIB_MAX   __LINUX_MIB_MAX

Definition at line 108 of file snmp.h.

#define LINUX_MIB_XFRMMAX   __LINUX_MIB_XFRMMAX

Definition at line 114 of file snmp.h.

#define SNMP_ADD_STATS (   mib,
  field,
  addend 
)    this_cpu_add(mib[0]->mibs[field], addend)

Definition at line 149 of file snmp.h.

#define SNMP_ADD_STATS64 (   mib,
  field,
  addend 
)    SNMP_ADD_STATS(mib, field, addend)

Definition at line 214 of file snmp.h.

#define SNMP_ADD_STATS64_BH (   mib,
  field,
  addend 
)    SNMP_ADD_STATS_BH(mib, field, addend)

Definition at line 212 of file snmp.h.

#define SNMP_ADD_STATS64_USER (   mib,
  field,
  addend 
)    SNMP_ADD_STATS_USER(mib, field, addend)

Definition at line 213 of file snmp.h.

#define SNMP_ADD_STATS_BH (   mib,
  field,
  addend 
)    __this_cpu_add(mib[0]->mibs[field], addend)

Definition at line 143 of file snmp.h.

#define SNMP_ADD_STATS_USER (   mib,
  field,
  addend 
)    this_cpu_add(mib[0]->mibs[field], addend)

Definition at line 146 of file snmp.h.

#define SNMP_ARRAY_SZ   1

Definition at line 119 of file snmp.h.

#define SNMP_DEC_STATS (   mib,
  field 
)    this_cpu_dec(mib[0]->mibs[field])

Definition at line 140 of file snmp.h.

#define SNMP_DEC_STATS64 (   mib,
  field 
)    SNMP_DEC_STATS(mib, field)

Definition at line 211 of file snmp.h.

#define SNMP_INC_STATS (   mib,
  field 
)    this_cpu_inc(mib[0]->mibs[field])

Definition at line 137 of file snmp.h.

#define SNMP_INC_STATS64 (   mib,
  field 
)    SNMP_INC_STATS(mib, field)

Definition at line 210 of file snmp.h.

#define SNMP_INC_STATS64_BH (   mib,
  field 
)    SNMP_INC_STATS_BH(mib, field)

Definition at line 208 of file snmp.h.

#define SNMP_INC_STATS64_USER (   mib,
  field 
)    SNMP_INC_STATS_USER(mib, field)

Definition at line 209 of file snmp.h.

#define SNMP_INC_STATS_ATOMIC_LONG (   mib,
  field 
)    atomic_long_inc(&mib->mibs[field])

Definition at line 134 of file snmp.h.

#define SNMP_INC_STATS_BH (   mib,
  field 
)    __this_cpu_inc(mib[0]->mibs[field])

Definition at line 128 of file snmp.h.

#define SNMP_INC_STATS_USER (   mib,
  field 
)    this_cpu_inc(mib[0]->mibs[field])

Definition at line 131 of file snmp.h.

#define SNMP_MIB_ITEM (   _name,
  _entry 
)
Value:
{ \
.name = _name, \
.entry = _entry, \
}

Definition at line 39 of file snmp.h.

#define SNMP_MIB_SENTINEL
Value:
{ \
.name = NULL, \
.entry = 0, \
}

Definition at line 44 of file snmp.h.

#define SNMP_UPD_PO_STATS (   mib,
  basefield,
  addend 
)
Value:
do { \
__typeof__(*mib[0]->mibs) *ptr = mib[0]->mibs; \
this_cpu_inc(ptr[basefield##PKTS]); \
this_cpu_add(ptr[basefield##OCTETS], addend); \
} while (0)

Definition at line 155 of file snmp.h.

#define SNMP_UPD_PO_STATS64 (   mib,
  basefield,
  addend 
)    SNMP_UPD_PO_STATS(mib, basefield, addend)

Definition at line 215 of file snmp.h.

#define SNMP_UPD_PO_STATS64_BH (   mib,
  basefield,
  addend 
)    SNMP_UPD_PO_STATS_BH(mib, basefield, addend)

Definition at line 216 of file snmp.h.

#define SNMP_UPD_PO_STATS_BH (   mib,
  basefield,
  addend 
)
Value:
do { \
__typeof__(*mib[0]->mibs) *ptr = mib[0]->mibs; \
__this_cpu_inc(ptr[basefield##PKTS]); \
__this_cpu_add(ptr[basefield##OCTETS], addend); \
} while (0)

Definition at line 161 of file snmp.h.

#define TCP_MIB_MAX   __TCP_MIB_MAX

Definition at line 96 of file snmp.h.

#define UDP_MIB_MAX   __UDP_MIB_MAX

Definition at line 102 of file snmp.h.