udp_mib_module.c
Go to the documentation of this file.
1 /**
2  * @file udp_mib_module.c
3  * @brief UDP MIB module
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2019 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneTCP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @section Description
28  *
29  * The UDP-MIB describes managed objects used for implementations of
30  * the User Datagram Protocol (UDP) in an IP version independent manner.
31  * Refer to the following RFCs for complete details:
32  * - RFC 4113: MIB for the User Datagram Protocol (UDP)
33  * - RFC 4001: Textual Conventions for Internet Network Addresses
34  *
35  * @author Oryx Embedded SARL (www.oryx-embedded.com)
36  * @version 1.9.6
37  **/
38 
39 //Switch to the appropriate trace level
40 #define TRACE_LEVEL SNMP_TRACE_LEVEL
41 
42 //Dependencies
43 #include "core/net.h"
44 #include "mibs/mib_common.h"
45 #include "mibs/udp_mib_module.h"
46 #include "mibs/udp_mib_impl.h"
47 #include "core/crypto.h"
48 #include "encoding/asn1.h"
49 #include "encoding/oid.h"
50 #include "debug.h"
51 
52 //Check TCP/IP stack configuration
53 #if (UDP_MIB_SUPPORT == ENABLED && UDP_SUPPORT == ENABLED)
54 
55 
56 /**
57  * @brief UDP MIB base
58  **/
59 
61 
62 
63 /**
64  * @brief UDP MIB objects
65  **/
66 
68 {
69  //udpInDatagrams object (1.3.6.1.2.1.7.1)
70  {
71  "udpInDatagrams",
72  {43, 6, 1, 2, 1, 7, 1},
73  7,
78  NULL,
79  sizeof(uint32_t),
80  NULL,
81  NULL,
82  NULL
83  },
84  //udpNoPorts object (1.3.6.1.2.1.7.2)
85  {
86  "udpNoPorts",
87  {43, 6, 1, 2, 1, 7, 2},
88  7,
93  NULL,
94  sizeof(uint32_t),
95  NULL,
96  NULL,
97  NULL
98  },
99  //udpInErrors object (1.3.6.1.2.1.7.3)
100  {
101  "udpInErrors",
102  {43, 6, 1, 2, 1, 7, 3},
103  7,
108  NULL,
109  sizeof(uint32_t),
110  NULL,
111  NULL,
112  NULL
113  },
114  //udpOutDatagrams object (1.3.6.1.2.1.7.4)
115  {
116  "udpOutDatagrams",
117  {43, 6, 1, 2, 1, 7, 4},
118  7,
123  NULL,
124  sizeof(uint32_t),
125  NULL,
126  NULL,
127  NULL
128  },
129  //udpEndpointProcess object (1.3.6.1.2.1.7.7.1.8)
130  {
131  "udpEndpointProcess",
132  {43, 6, 1, 2, 1, 7, 7, 1, 8},
133  9,
137  NULL,
138  NULL,
139  sizeof(uint32_t),
140  NULL,
143  },
144  //udpHCInDatagrams object (1.3.6.1.2.1.7.8)
145  {
146  "udpHCInDatagrams",
147  {43, 6, 1, 2, 1, 7, 8},
148  7,
153  NULL,
154  sizeof(uint64_t),
155  NULL,
156  NULL,
157  NULL
158  },
159  //udpHCOutDatagrams object (1.3.6.1.2.1.7.9)
160  {
161  "udpHCOutDatagrams",
162  {43, 6, 1, 2, 1, 7, 9},
163  7,
168  NULL,
169  sizeof(uint64_t),
170  NULL,
171  NULL,
172  NULL
173  }
174 };
175 
176 
177 /**
178  * @brief UDP MIB module
179  **/
180 
182 {
183  "UDP-MIB",
184  {43, 6, 1, 2, 1, 50},
185  6,
188  udpMibInit,
189  NULL,
190  NULL,
191  NULL,
192  NULL
193 };
194 
195 #endif
uint64_t udpHCInDatagrams
const MibObject udpMibObjects[]
UDP MIB objects.
OID (Object Identifier)
uint32_t udpInErrors
@ MIB_ACCESS_READ_ONLY
Definition: mib_common.h:79
uint32_t udpInDatagrams
error_t udpMibGetNextUdpEndpointEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next udpEndpointEntry object.
Definition: udp_mib_impl.c:205
UdpMibBase udpMibBase
UDP MIB base.
const MibModule udpMibModule
UDP MIB module.
@ MIB_TYPE_COUNTER32
Definition: mib_common.h:61
UDP MIB module.
General definitions for cryptographic algorithms.
@ MIB_TYPE_UNSIGNED32
Definition: mib_common.h:63
uint32_t udpOutDatagrams
error_t udpMibInit(void)
UDP MIB module initialization.
Definition: udp_mib_impl.c:53
MIB module.
Definition: mib_common.h:287
uint32_t udpNoPorts
Common definitions for MIB modules.
#define MibObject
Definition: mib_common.h:46
uint64_t udpHCOutDatagrams
UDP MIB module implementation.
@ MIB_TYPE_COUNTER64
Definition: mib_common.h:66
TCP/IP stack core.
#define ASN1_CLASS_APPLICATION
Definition: asn1.h:49
Debugging facilities.
ASN.1 (Abstract Syntax Notation One)
#define arraysize(a)
Definition: os_port.h:70
UDP MIB base.
error_t udpMibGetUdpEndpointEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get udpEndpointEntry object value.
Definition: udp_mib_impl.c:76