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