]> git.ipfire.org Git - thirdparty/squid.git/blame - include/parse.h
Boilerplate: update copyright on compat/ library sources
[thirdparty/squid.git] / include / parse.h
CommitLineData
b5638623 1#ifndef SQUID_PARSE_H
2#define SQUID_PARSE_H
d60c11be 3
9067f855 4/***********************************************************
5 Copyright 1989 by Carnegie Mellon University
6
7 All Rights Reserved
8
c5dd4956
AJ
9Permission to use, copy, modify, and distribute this software and its
10documentation for any purpose and without fee is hereby granted,
9067f855 11provided that the above copyright notice appear in all copies and that
c5dd4956 12both that copyright notice and this permission notice appear in
9067f855 13supporting documentation, and that the name of CMU not be
14used in advertising or publicity pertaining to distribution of the
c5dd4956 15software without specific, written prior permission.
9067f855 16
17CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
18ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
19CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
20ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
21WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
22ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
23SOFTWARE.
24******************************************************************/
9067f855 25
e1f7507e
AJ
26/* NP: we only need struct variable_list and typedef oid from SNMP library */
27/* we use as ptrs. If this was true C++ we could pre-define their classes. */
28#include "snmp_vars.h"
29
30/**
9067f855 31 * A linked list of tag-value pairs for enumerated integers.
32 */
33struct enum_list {
34 struct enum_list *next;
43d4303e 35 int value;
9067f855 36 char *label;
37};
38
e1f7507e 39/**
9067f855 40 * A tree in the format of the tree structure of the MIB.
41 */
d60c11be 42struct snmp_mib_tree {
43 struct snmp_mib_tree *child_list; /* list of children of this node */
44 struct snmp_mib_tree *next_peer; /* Next node in list of peers */
45 struct snmp_mib_tree *parent;
46 char label[64]; /* This node's textual name */
47 u_int subid; /* This node's integer subidentifier */
9067f855 48 int type; /* This node's object type */
d60c11be 49 struct enum_list *enums; /* (optional) list of enumerated integers (otherwise NULL) */
5c52f59a 50 void (*printer) (char *buf, variable_list *var, void *foo, int quiet); /* Value printing function */
9067f855 51};
52
53/* non-aggregate types for tree end nodes */
54#define TYPE_OTHER 0
55#define TYPE_OBJID 1
56#define TYPE_OCTETSTR 2
57#define TYPE_INTEGER 3
58#define TYPE_NETADDR 4
59#define TYPE_IPADDR 5
60#define TYPE_COUNTER 6
61#define TYPE_GAUGE 7
62#define TYPE_TIMETICKS 8
e1f7507e 63#define TYPE_OPAQUE 9
9067f855 64#define TYPE_NULL 10
9067f855 65
d60c11be 66#ifdef __cplusplus
e1381638 67extern "C" {
d60c11be 68#endif
9067f855 69
43d4303e 70 void init_mib(char *);
71 int read_objid(char *, oid *, int *);
72 void print_objid(oid *, int);
73 void sprint_objid(char *, oid *, int);
74 void print_variable(oid *, int, struct variable_list *);
75 void sprint_variable(char *, oid *, int, struct variable_list *);
76 void sprint_value(char *, oid *, int, struct variable_list *);
77 void print_value(oid *, int, struct variable_list *);
9067f855 78
c5dd4956
AJ
79 /*void print_variable_list(struct variable_list *); */
80 /*void print_variable_list_value(struct variable_list *); */
81 /*void print_type(struct variable_list *); */
43d4303e 82 void print_oid_nums(oid *, int);
d60c11be 83
2f232128 84 struct snmp_mib_tree *read_mib(char *);
d60c11be 85
86#ifdef __cplusplus
87}
d60c11be 88
43d4303e 89#endif
b5638623 90
91#endif /* SQUID_PARSE_H */