420 remove patch (sparse package) support from svr4 pkg
[illumos-gate.git] / usr / src / cmd / agents / snmp / agent / node.h
blobcf01aa86ba3cd947f72d5d5b57b7f8049f6fd4ad
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
22 * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved.
23 * Use is subject to license terms.
26 #ifndef _NODE_H_
27 #define _NODE_H_
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #include "asn1.h"
32 #define COLUMN 1
33 #define OBJECT 2
34 #define NODE 3
36 #define READ_FLAG 0x1
37 #define WRITE_FLAG 0x2
40 typedef struct _Enum {
41 struct _Enum *next_enum;
42 char *label;
43 Integer value;
44 } Enum;
46 typedef struct _Object {
47 Oid name;
48 u_char asn1_type;
49 Enum *first_enum;
50 int access;
51 int type;
52 int (*get)();
53 int (*set)();
54 void (*dealloc)();
55 } Object;
57 typedef struct _Index {
58 struct _Index *next_index;
59 char *label;
60 int index_type;
61 int index_len; /* for strings only */
62 struct _Node *node;
63 } Index;
65 typedef struct _Entry {
66 struct _Index *first_index;
67 int n_indexs;
68 int (*get)();
69 void (*dealloc)();
70 } Entry;
73 typedef struct _Column {
74 Oid name;
75 u_char asn1_type;
76 Enum *first_enum;
77 int access;
78 int type;
79 int (*get)();
80 int (*set)();
81 Entry *entry;
82 int offset;
83 } Column;
86 typedef struct _Node {
87 struct _Node *parent;
88 struct _Node *first_child;
89 struct _Node *next_peer;
90 struct _Node *next;
92 char *label;
93 Subid subid;
95 int type;
96 union {
97 Object *object;
98 Column *column;
99 } data;
100 } Node;
102 struct CallbackItem {
103 Object *ptr;
104 int type,next;
106 struct TrapHndlCxt {
107 char name[256];
108 int is_sun_enterprise;
109 int generic,specific;
112 struct TrapEnterpriseInfo {
113 Subid subids[7];
116 /* Handling arbitrary length enterprise OID in traps */
117 struct TrapAnyEnterpriseInfo {
118 Subid subids[MAX_OID_LEN+1];
122 extern Enum enum_table[];
123 extern int enum_table_size;
125 extern Object object_table[];
126 extern int object_table_size;
128 extern Index index_table[];
129 extern int index_table_size;
131 extern Entry entry_table[];
132 extern int entry_table_size;
134 extern Column column_table[];
135 extern int column_table_size;
137 extern Node node_table[];
138 extern int node_table_size;
140 extern struct CallbackItem *callItem;
141 extern int numCallItem;
143 extern int *trapTableMap;
145 extern struct TrapHndlCxt *trapBucket;
146 extern int numTrapElem;
148 extern struct TrapEnterpriseInfo *trapEnterpriseInfo;
149 /* For arbitrary length enterprise OID in traps - bug 4133978 */
150 extern struct TrapAnyEnterpriseInfo *trapAnyEnterpriseInfo;
153 extern Node *node_find(int search_type, Oid *name, Oid *suffix);
155 #endif