linux/include/net/snmp.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 *
 *		SNMP MIB entries for the IP subsystem.
 *		
 *		Alan Cox <[email protected]>
 *
 *		We don't chose to implement SNMP in the kernel (this would
 *		be silly as SNMP is a pain in the backside in places). We do
 *		however need to collect the MIB statistics and export them
 *		out of /proc (eventually)
 */
 
#ifndef _SNMP_H
#define _SNMP_H

#include <linux/cache.h>
#include <linux/snmp.h>
#include <linux/smp.h>

/*
 * Mibs are stored in array of unsigned long.
 */
/*
 * struct snmp_mib{}
 *  - list of entries for particular API (such as /proc/net/snmp)
 *  - name of entries.
 */
struct snmp_mib {};

#define SNMP_MIB_ITEM(_name,_entry)

#define SNMP_MIB_SENTINEL

/*
 * We use unsigned longs for most mibs but u64 for ipstats.
 */
#include <linux/u64_stats_sync.h>

/* IPstats */
#define IPSTATS_MIB_MAX
struct ipstats_mib {};

/* ICMP */
#define ICMP_MIB_MAX
struct icmp_mib {};

#define ICMPMSG_MIB_MAX
struct icmpmsg_mib {};

/* ICMP6 (IPv6-ICMP) */
#define ICMP6_MIB_MAX
/* per network ns counters */
struct icmpv6_mib {};
/* per device counters, (shared on all cpus) */
struct icmpv6_mib_device {};

#define ICMP6MSG_MIB_MAX
/* per network ns counters */
struct icmpv6msg_mib {};
/* per device counters, (shared on all cpus) */
struct icmpv6msg_mib_device {};


/* TCP */
#define TCP_MIB_MAX
struct tcp_mib {};

/* UDP */
#define UDP_MIB_MAX
struct udp_mib {};

/* Linux */
#define LINUX_MIB_MAX
struct linux_mib {};

/* Linux Xfrm */
#define LINUX_MIB_XFRMMAX
struct linux_xfrm_mib {};

/* Linux TLS */
#define LINUX_MIB_TLSMAX
struct linux_tls_mib {};

#define DEFINE_SNMP_STAT(type, name)
#define DEFINE_SNMP_STAT_ATOMIC(type, name)
#define DECLARE_SNMP_STAT(type, name)

#define __SNMP_INC_STATS(mib, field)

#define SNMP_INC_STATS_ATOMIC_LONG(mib, field)

#define SNMP_INC_STATS(mib, field)

#define SNMP_DEC_STATS(mib, field)

#define __SNMP_ADD_STATS(mib, field, addend)

#define SNMP_ADD_STATS(mib, field, addend)
#define SNMP_UPD_PO_STATS(mib, basefield, addend)
#define __SNMP_UPD_PO_STATS(mib, basefield, addend)


#if BITS_PER_LONG==32

#define __SNMP_ADD_STATS64

#define SNMP_ADD_STATS64

#define __SNMP_INC_STATS64
#define SNMP_INC_STATS64
#define __SNMP_UPD_PO_STATS64
#define SNMP_UPD_PO_STATS64
#else
#define __SNMP_INC_STATS64(mib, field)
#define SNMP_INC_STATS64(mib, field)
#define SNMP_DEC_STATS64(mib, field)
#define __SNMP_ADD_STATS64(mib, field, addend)
#define SNMP_ADD_STATS64(mib, field, addend)
#define SNMP_UPD_PO_STATS64(mib, basefield, addend)
#define __SNMP_UPD_PO_STATS64(mib, basefield, addend)
#endif

#endif