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_INCLUDE_PARSE_H
10 #define SQUID_INCLUDE_PARSE_H
11 
12 /***********************************************************
13  Copyright 1989 by Carnegie Mellon University
14 
15  All Rights Reserved
16 
17 Permission to use, copy, modify, and distribute this software and its
18 documentation for any purpose and without fee is hereby granted,
19 provided that the above copyright notice appear in all copies and that
20 both that copyright notice and this permission notice appear in
21 supporting documentation, and that the name of CMU not be
22 used in advertising or publicity pertaining to distribution of the
23 software without specific, written prior permission.
24 
25 CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
26 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
27 CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
28 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
29 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
30 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
31 SOFTWARE.
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 
41 struct enum_list {
42  struct enum_list *next;
43  int value;
44  char *label;
45 };
46 
50 struct snmp_mib_tree {
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
75 extern "C" {
76 #endif
77 
78 void init_mib(char *);
79 int read_objid(char *, oid *, int *);
80 void print_objid(oid *, int);
81 void sprint_objid(char *, oid *, int);
82 void print_variable(oid *, int, struct variable_list *);
83 void sprint_variable(char *, oid *, int, struct variable_list *);
84 void sprint_value(char *, oid *, int, struct variable_list *);
85 void 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 *); */
90 void print_oid_nums(oid *, int);
91 
92 struct snmp_mib_tree *read_mib(char *);
93 
94 #ifdef __cplusplus
95 }
96 
97 #endif
98 
99 #endif /* SQUID_INCLUDE_PARSE_H */
100 
void init_mib(char *)
Definition: mib.c:97
void sprint_value(char *, oid *, int, struct variable_list *)
char * label
Definition: parse.h:64
void sprint_objid(char *, oid *, int)
Definition: mib.c:276
struct snmp_mib_tree * child_list
Definition: parse.h:51
void print_value(oid *, int, struct variable_list *)
struct enum_list * enums
Definition: parse.h:57
struct snmp_mib_tree * read_mib(char *)
Definition: parse.c:1038
void print_oid_nums(oid *, int)
Definition: mib.c:320
struct enum_list * next
Definition: parse.h:62
struct snmp_mib_tree * parent
Definition: parse.h:53
u_int subid
Definition: parse.h:55
int value
Definition: parse.h:63
void sprint_variable(char *, oid *, int, struct variable_list *)
u_int oid
Definition: asn1.h:42
char label[64]
Definition: parse.h:54
int type
Definition: parse.h:56
void(* printer)(char *buf, variable_list *var, void *foo, int quiet)
Definition: parse.h:58
void print_objid(oid *, int)
Definition: mib.c:263
int read_objid(char *, oid *, int *)
Definition: mib.c:230
struct snmp_mib_tree * next_peer
Definition: parse.h:52
void print_variable(oid *, int, struct variable_list *)

 

Introduction

Documentation

Support

Miscellaneous