source: squid-ssl/trunk/fuentes/include/parse.h @ 5495

Last change on this file since 5495 was 5495, checked in by Juanma, 2 years ago

Initial release

File size: 3.4 KB
Line 
1/*
2 * Copyright (C) 1996-2015 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
38/**
39 * A linked list of tag-value pairs for enumerated integers.
40 */
41struct enum_list {
42    struct enum_list *next;
43    int value;
44    char *label;
45};
46
47/**
48 * A tree in the format of the tree structure of the MIB.
49 */
50struct 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 */
53    struct snmp_mib_tree *parent;
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
Note: See TracBrowser for help on using the repository browser.