parse.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 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_PARSE_H
10#define SQUID_PARSE_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/* NP: we only need struct variable_list and typedef oid from SNMP library */
35/* we use as ptrs. If this was true C++ we could pre-define their classes. */
36#include "snmp_vars.h"
37
41struct enum_list {
42 struct enum_list *next;
43 int value;
44 char *label;
45};
46
51 struct snmp_mib_tree *child_list; /* list of children of this node */
52 struct snmp_mib_tree *next_peer; /* Next node in list of peers */
54 char label[64]; /* This node's textual name */
55 u_int subid; /* This node's integer subidentifier */
56 int type; /* This node's object type */
57 struct enum_list *enums; /* (optional) list of enumerated integers (otherwise NULL) */
58 void (*printer) (char *buf, variable_list *var, void *foo, int quiet); /* Value printing function */
59};
60
61/* non-aggregate types for tree end nodes */
62#define TYPE_OTHER 0
63#define TYPE_OBJID 1
64#define TYPE_OCTETSTR 2
65#define TYPE_INTEGER 3
66#define TYPE_NETADDR 4
67#define TYPE_IPADDR 5
68#define TYPE_COUNTER 6
69#define TYPE_GAUGE 7
70#define TYPE_TIMETICKS 8
71#define TYPE_OPAQUE 9
72#define TYPE_NULL 10
73
74#ifdef __cplusplus
75extern "C" {
76#endif
77
78void init_mib(char *);
79int read_objid(char *, oid *, int *);
80void print_objid(oid *, int);
81void sprint_objid(char *, oid *, int);
82void print_variable(oid *, int, struct variable_list *);
83void sprint_variable(char *, oid *, int, struct variable_list *);
84void sprint_value(char *, oid *, int, struct variable_list *);
85void print_value(oid *, int, struct variable_list *);
86
87/*void print_variable_list(struct variable_list *); */
88/*void print_variable_list_value(struct variable_list *); */
89/*void print_type(struct variable_list *); */
90void print_oid_nums(oid *, int);
91
92struct snmp_mib_tree *read_mib(char *);
93
94#ifdef __cplusplus
95}
96
97#endif
98
99#endif /* SQUID_PARSE_H */
100
u_int oid
Definition: asn1.h:42
void sprint_variable(char *, oid *, int, struct variable_list *)
void sprint_value(char *, oid *, int, struct variable_list *)
void print_value(oid *, int, struct variable_list *)
struct snmp_mib_tree * read_mib(char *)
Definition: parse.c:1038
int read_objid(char *, oid *, int *)
Definition: mib.c:230
void print_objid(oid *, int)
Definition: mib.c:263
void print_oid_nums(oid *, int)
Definition: mib.c:320
void init_mib(char *)
Definition: mib.c:97
void print_variable(oid *, int, struct variable_list *)
void sprint_objid(char *, oid *, int)
Definition: mib.c:276
struct enum_list * next
Definition: parse.h:42
int value
Definition: parse.h:43
char * label
Definition: parse.h:44
struct enum_list * enums
Definition: parse.h:57
struct snmp_mib_tree * next_peer
Definition: parse.h:52
int type
Definition: parse.h:56
struct snmp_mib_tree * parent
Definition: parse.h:53
char label[64]
Definition: parse.h:54
struct snmp_mib_tree * child_list
Definition: parse.h:51
u_int subid
Definition: parse.h:55
void(* printer)(char *buf, variable_list *var, void *foo, int quiet)
Definition: parse.h:58

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors