]>
Commit | Line | Data |
---|---|---|
9067f855 | 1 | /*********************************************************** |
2 | Copyright 1989 by Carnegie Mellon University | |
3 | ||
4 | All Rights Reserved | |
5 | ||
6 | Permission to use, copy, modify, and distribute this software and its | |
7 | documentation for any purpose and without fee is hereby granted, | |
8 | provided that the above copyright notice appear in all copies and that | |
9 | both that copyright notice and this permission notice appear in | |
10 | supporting documentation, and that the name of CMU not be | |
11 | used in advertising or publicity pertaining to distribution of the | |
12 | software without specific, written prior permission. | |
13 | ||
14 | CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING | |
15 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL | |
16 | CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR | |
17 | ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, | |
18 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, | |
19 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS | |
20 | SOFTWARE. | |
21 | ******************************************************************/ | |
22 | ||
23 | /* | |
24 | * parse.h | |
25 | */ | |
26 | ||
27 | #ifndef _PARSE_H | |
28 | #define _PARSE_H | |
29 | ||
9067f855 | 30 | #define MAXLABEL 64 /* maximum characters in a label */ |
31 | #define MAXTOKEN 64 /* maximum characters in a token */ | |
32 | #define MAXQUOTESTR 512 /* maximum characters in a quoted string */ | |
33 | ||
9067f855 | 34 | /* |
35 | * A linked list of tag-value pairs for enumerated integers. | |
36 | */ | |
37 | struct enum_list { | |
38 | struct enum_list *next; | |
da2d50d1 | 39 | int value; |
9067f855 | 40 | char *label; |
41 | }; | |
42 | ||
43 | /* | |
44 | * A linked list of nodes. | |
45 | */ | |
46 | struct node { | |
47 | struct node *next; | |
da2d50d1 | 48 | char label[MAXLABEL]; /* This node's (unique) textual name */ |
49 | u_long subid; /* This node's integer subidentifier */ | |
50 | char parent[MAXLABEL]; /* The parent's textual name */ | |
51 | int type; /* The type of object this represents */ | |
9067f855 | 52 | struct enum_list *enums; /* (optional) list of enumerated integers |
da2d50d1 | 53 | * (otherwise NULL) */ |
54 | char *description; /* description (a quoted string) */ | |
9067f855 | 55 | }; |
56 | ||
57 | /* | |
58 | * A tree in the format of the tree structure of the MIB. | |
59 | */ | |
60 | struct tree { | |
61 | struct tree *child_list; /* list of children of this node */ | |
62 | struct tree *next_peer; /* Next node in list of peers */ | |
63 | struct tree *parent; | |
da2d50d1 | 64 | char label[MAXLABEL]; /* This node's textual name */ |
9067f855 | 65 | u_long subid; /* This node's integer subidentifier */ |
66 | int type; /* This node's object type */ | |
67 | struct enum_list *enums; /* (optional) list of enumerated integers | |
da2d50d1 | 68 | * (otherwise NULL) */ |
69 | void (*printer) (); /* Value printing function */ | |
70 | char *description; /* description (a quoted string) */ | |
9067f855 | 71 | }; |
72 | ||
73 | /* non-aggregate types for tree end nodes */ | |
74 | #define TYPE_OTHER 0 | |
75 | #define TYPE_OBJID 1 | |
76 | #define TYPE_OCTETSTR 2 | |
77 | #define TYPE_INTEGER 3 | |
78 | #define TYPE_NETADDR 4 | |
79 | #define TYPE_IPADDR 5 | |
80 | #define TYPE_COUNTER 6 | |
81 | #define TYPE_GAUGE 7 | |
82 | #define TYPE_TIMETICKS 8 | |
83 | #define TYPE_OPAQUE 9 | |
84 | #define TYPE_NULL 10 | |
85 | #define TYPE_COUNTER64 11 | |
86 | #define TYPE_BITSTRING 12 | |
87 | #define TYPE_NSAPADDRESS 13 | |
88 | #define TYPE_UINTEGER 14 | |
89 | ||
be335c22 | 90 | struct tree *read_mib(const char *fname); |
9067f855 | 91 | |
92 | ||
93 | #endif |