snmp_api.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2022 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9#ifndef SQUID_SNMP_API_H
10#define SQUID_SNMP_API_H
11
12/***********************************************************
13 Copyright 1989 by Carnegie Mellon University
14
15 All Rights Reserved
16
17Permission to use, copy, modify, and distribute this software and its
18documentation for any purpose and without fee is hereby granted,
19provided that the above copyright notice appear in all copies and that
20both that copyright notice and this permission notice appear in
21supporting documentation, and that the name of CMU not be
22used in advertising or publicity pertaining to distribution of the
23software without specific, written prior permission.
24
25CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
26ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
27CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
28ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
29WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
30ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
31SOFTWARE.
32******************************************************************/
33
34/*
35 * snmp_api.h - API for access to snmp.
36 */
37
38/*
39 * Set fields in session and pdu to the following to get a default or unconfigured value.
40 */
41#define SNMP_DEFAULT_COMMUNITY_LEN 0 /* to get a default community name */
42#define SNMP_DEFAULT_RETRIES 3
43#define SNMP_DEFAULT_TIMEOUT 1
44#define SNMP_DEFAULT_REMPORT 0
45#define SNMP_DEFAULT_PEERNAME NULL
46#define SNMP_DEFAULT_ENTERPRISE_LENGTH 0
47#define SNMP_DEFAULT_TIME 0
48#define SNMP_DEFAULT_MAXREPETITIONS 5
49#define SNMP_DEFAULT_MACREPEATERS 0
50
51#ifdef __cplusplus
52extern "C" {
53#endif
54
55/* Parse the buffer pointed to by arg3, of length arg4, into pdu arg2.
56 *
57 * Returns the community of the incoming PDU, or NULL
58 */
59u_char *snmp_parse(struct snmp_session *, struct snmp_pdu *, u_char *, int);
60
61/* Encode pdu arg2 into buffer arg3. arg4 contains the size of
62 * the buffer.
63 */
64int snmp_build(struct snmp_session *, struct snmp_pdu *, u_char *, int *);
65
66#ifdef __cplusplus
67}
68
69#endif
70
71#endif /* SQUID_SNMP_API_H */
72
u_char * snmp_parse(struct snmp_session *, struct snmp_pdu *, u_char *, int)
Definition: snmp_api.c:133
int snmp_build(struct snmp_session *, struct snmp_pdu *, u_char *, int *)
Definition: snmp_api.c:106

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors