]> git.ipfire.org Git - thirdparty/squid.git/blame - include/parse.h
SourceFormat Enforcement
[thirdparty/squid.git] / include / parse.h
CommitLineData
5c193dec 1/*
4ac4a490 2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
5c193dec
AJ
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
b5638623 9#ifndef SQUID_PARSE_H
10#define SQUID_PARSE_H
d60c11be 11
9067f855 12/***********************************************************
f53969cc 13 Copyright 1989 by Carnegie Mellon University
9067f855 14
15 All Rights Reserved
16
c5dd4956
AJ
17Permission to use, copy, modify, and distribute this software and its
18documentation for any purpose and without fee is hereby granted,
9067f855 19provided that the above copyright notice appear in all copies and that
c5dd4956 20both that copyright notice and this permission notice appear in
9067f855 21supporting documentation, and that the name of CMU not be
22used in advertising or publicity pertaining to distribution of the
c5dd4956 23software without specific, written prior permission.
9067f855 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******************************************************************/
9067f855 33
e1f7507e
AJ
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
38/**
9067f855 39 * A linked list of tag-value pairs for enumerated integers.
40 */
41struct enum_list {
42 struct enum_list *next;
43d4303e 43 int value;
9067f855 44 char *label;
45};
46
e1f7507e 47/**
9067f855 48 * A tree in the format of the tree structure of the MIB.
49 */
d60c11be 50struct snmp_mib_tree {
f53969cc
SM
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 */
d60c11be 53 struct snmp_mib_tree *parent;
f53969cc
SM
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 */
9067f855 59};
60
61/* non-aggregate types for tree end nodes */
f53969cc
SM
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
9067f855 73
d60c11be 74#ifdef __cplusplus
e1381638 75extern "C" {
d60c11be 76#endif
9067f855 77
f53969cc
SM
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 *);
9067f855 86
f53969cc
SM
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);
d60c11be 91
f53969cc 92struct snmp_mib_tree *read_mib(char *);
d60c11be 93
94#ifdef __cplusplus
95}
d60c11be 96
43d4303e 97#endif
b5638623 98
f53969cc
SM
99#endif /* SQUID_PARSE_H */
100