yumapro  24.10-2
YumaPro SDK
Loading...
Searching...
No Matches
agt_ypsnmp_proto.h
Go to the documentation of this file.
1/*****************************************************************************
2Various copyrights apply to this package, listed in various separate
3parts below. Please make sure that you read all the parts.
4
5---- Part 1: Sparta, Inc (BSD) -----
6
7Copyright (c) 2003-2010, Sparta, Inc
8All rights reserved.
9
10Redistribution and use in source and binary forms, with or without
11modification, are permitted provided that the following conditions are met:
12
13* Redistributions of source code must retain the above copyright notice,
14 this list of conditions and the following disclaimer.
15
16* Redistributions in binary form must reproduce the above copyright
17 notice, this list of conditions and the following disclaimer in the
18 documentation and/or other materials provided with the distribution.
19
20* Neither the name of Sparta, Inc nor the names of its contributors may
21 be used to endorse or promote products derived from this software
22 without specific prior written permission.
23
24THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
25IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
26THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
28CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
30PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
31OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
33OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
34ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
36---- Part 2: ScienceLogic, LLC (BSD) ----
37
38Copyright (c) 2006, ScienceLogic, LLC
39All rights reserved.
40
41Redistribution and use in source and binary forms, with or without
42modification, are permitted provided that the following conditions are
43met:
44
45* Redistributions of source code must retain the above copyright notice,
46 this list of conditions and the following disclaimer.
47
48* Redistributions in binary form must reproduce the above copyright
49 notice, this list of conditions and the following disclaimer in the
50 documentation and/or other materials provided with the distribution.
51
52* Neither the name of ScienceLogic, LLC nor the names of its
53 contributors may be used to endorse or promote products derived
54 from this software without specific prior written permission.
55
56THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
57``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
58LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
59A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
60HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
61INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
62BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
63OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
64ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
65TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
66USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
67DAMAGE.
68*************************************************************************/
69
70/*************************************************************************
71 OVERVIEW
72
73 This module implements an snmp AgentX Protocol.
74 Parsing, Re-allocation and packets check handling.
75
76*************************************************************************/
77
78
79/*
80 * Copyright (c) 2017, YumaWorks. Inc., All Rights Reserved.
81 *
82 * Unless required by applicable law or agreed to in writing,
83 * software distributed under the License is distributed on an
84 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
85 * KIND, either express or implied. See the License for the
86 * specific language governing permissions and limitations
87 * under the License.
88 */
89
90#if defined(WITH_SNMP) && defined(WITH_RESTCONF)
91
92#ifndef _H_agt_ypsnmp_proto
93#define _H_agt_ypsnmp_proto
94
95
102/*********************************************************************
103* *
104* C H A N G E H I S T O R Y *
105* *
106*********************************************************************
107
108date init comment
109----------------------------------------------------------------------
1108-Nov-17 am Begun.
111*/
112
113#ifndef _H_status_enum
114#include "status_enum.h"
115#endif
116
117#ifdef __cplusplus
118extern "C" {
119#endif
120
121
122/********************************************************************
123* *
124* C O N S T A N T S *
125* *
126*********************************************************************/
127
128
129/********************************************************************
130* *
131* T Y P E S *
132* *
133*********************************************************************/
134
135
136/********************************************************************
137* *
138* F U N C T I O N S *
139* *
140*********************************************************************/
141
142
167extern int
168 agentx_parse (netsnmp_session *session,
169 netsnmp_pdu *pdu,
170 u_char *data,
171 size_t len);
172
173
190extern int
191 agentx_realloc_build (netsnmp_session *session,
192 netsnmp_pdu *pdu,
193 u_char **buf,
194 size_t *buf_len,
195 size_t *out_len);
196
197
222extern int
223 agentx_check_packet (u_char * packet,
224 size_t packet_len);
225
226
227
231#ifdef __cplusplus
232} /* end extern 'C' */
233#endif
234
235#endif // _H_agt_ypsnmp_proto
236#endif // defined(WITH_SNMP) && defined(WITH_RESTCONF)
int agentx_check_packet(u_char *packet, size_t packet_len)
Check the packet.
Definition: agt_ypsnmp_proto.c:1782
int agentx_parse(netsnmp_session *session, netsnmp_pdu *pdu, u_char *data, size_t len)
Utility functions for parsing an AgentX packet.
Definition: agt_ypsnmp_proto.c:1371
int agentx_realloc_build(netsnmp_session *session, netsnmp_pdu *pdu, u_char **buf, size_t *buf_len, size_t *out_len)
Realloc an AgentX PDU.
Definition: agt_ypsnmp_proto.c:1739
global error status code enumerations