OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [net/] [snmp/] [agent/] [v2_0/] [include/] [var_struct.h] - Blame information for rev 174

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
//==========================================================================
2
//
3
//      ./agent/current/include/var_struct.h
4
//
5
//
6
//==========================================================================
7
//####ECOSGPLCOPYRIGHTBEGIN####
8
// -------------------------------------------
9
// This file is part of eCos, the Embedded Configurable Operating System.
10
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
11
//
12
// eCos is free software; you can redistribute it and/or modify it under
13
// the terms of the GNU General Public License as published by the Free
14
// Software Foundation; either version 2 or (at your option) any later version.
15
//
16
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
17
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
18
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19
// for more details.
20
//
21
// You should have received a copy of the GNU General Public License along
22
// with eCos; if not, write to the Free Software Foundation, Inc.,
23
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
24
//
25
// As a special exception, if other files instantiate templates or use macros
26
// or inline functions from this file, or you compile this file and link it
27
// with other works to produce a work based on this file, this file does not
28
// by itself cause the resulting work to be covered by the GNU General Public
29
// License. However the source code for this file must still be made available
30
// in accordance with section (3) of the GNU General Public License.
31
//
32
// This exception does not invalidate any other reasons why a work based on
33
// this file might be covered by the GNU General Public License.
34
//
35
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
36
// at http://sources.redhat.com/ecos/ecos-license/
37
// -------------------------------------------
38
//####ECOSGPLCOPYRIGHTEND####
39
//####UCDSNMPCOPYRIGHTBEGIN####
40
//
41
// -------------------------------------------
42
//
43
// Portions of this software may have been derived from the UCD-SNMP
44
// project,  <http://ucd-snmp.ucdavis.edu/>  from the University of
45
// California at Davis, which was originally based on the Carnegie Mellon
46
// University SNMP implementation.  Portions of this software are therefore
47
// covered by the appropriate copyright disclaimers included herein.
48
//
49
// The release used was version 4.1.2 of May 2000.  "ucd-snmp-4.1.2"
50
// -------------------------------------------
51
//
52
//####UCDSNMPCOPYRIGHTEND####
53
//==========================================================================
54
//#####DESCRIPTIONBEGIN####
55
//
56
// Author(s):    hmt
57
// Contributors: hmt
58
// Date:         2000-05-30
59
// Purpose:      Port of UCD-SNMP distribution to eCos.
60
// Description:  
61
//              
62
//
63
//####DESCRIPTIONEND####
64
//
65
//==========================================================================
66
/********************************************************************
67
       Copyright 1989, 1991, 1992 by Carnegie Mellon University
68
 
69
                          Derivative Work -
70
Copyright 1996, 1998, 1999, 2000 The Regents of the University of California
71
 
72
                         All Rights Reserved
73
 
74
Permission to use, copy, modify and distribute this software and its
75
documentation for any purpose and without fee is hereby granted,
76
provided that the above copyright notice appears in all copies and
77
that both that copyright notice and this permission notice appear in
78
supporting documentation, and that the name of CMU and The Regents of
79
the University of California not be used in advertising or publicity
80
pertaining to distribution of the software without specific written
81
permission.
82
 
83
CMU AND THE REGENTS OF THE UNIVERSITY OF CALIFORNIA DISCLAIM ALL
84
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
85
WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL CMU OR
86
THE REGENTS OF THE UNIVERSITY OF CALIFORNIA BE LIABLE FOR ANY SPECIAL,
87
INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
88
FROM THE LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
89
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
90
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
91
*********************************************************************/
92
#ifndef VAR_STRUCT_H
93
#define VAR_STRUCT_H
94
/*
95
 * The subtree structure contains a subtree prefix which applies to
96
 * all variables in the associated variable list.
97
 *
98
 * By converting to a tree of subtree structures, entries can
99
 * now be subtrees of another subtree in the structure. i.e:
100
 * 1.2
101
 * 1.2.0
102
 */
103
struct subtree {
104
    oid                 name[16];       /* objid prefix of registered subtree */
105
    u_char              namelen;        /* number of subid's in name above */
106
    oid                 start[16];      /* objid of start of covered range */
107
    u_char              start_len;      /* number of subid's in start name */
108
    oid                 end[16];        /* objid of end of covered range */
109
    u_char              end_len;        /* number of subid's in end name */
110
    struct variable     *variables;   /* pointer to variables array */
111
    int                 variables_len;  /* number of entries in above array */
112
    int                 variables_width; /* sizeof each variable entry */
113
    char                label[256];     /* calling module's label */
114
    struct snmp_session *session;
115
    u_char              flags;
116
    u_char              priority;
117
    struct subtree      *next;          /* List of 'sibling' subtrees */
118
    struct subtree      *prev;          /* Make siblings a doubly-linked list */
119
    struct subtree      *children;      /* List of 'child' subtrees */
120
};
121
 
122
/*
123
 * This is a new variable structure that doesn't have as much memory
124
 * tied up in the object identifier.  It's elements have also been re-arranged
125
 * so that the name field can be variable length.  Any number of these
126
 * structures can be created with lengths tailor made to a particular
127
 * application.  The first 5 elements of the structure must remain constant.
128
 */
129
struct variable2 {
130
    u_char          magic;          /* passed to function as a hint */
131
    u_char          type;           /* type of variable */
132
    u_short         acl;            /* access control list for variable */
133
    FindVarMethod  *findVar;        /* function that finds variable */
134
    u_char          namelen;        /* length of name below */
135
    oid             name[2];       /* object identifier of variable */
136
};
137
 
138
struct variable4 {
139
    u_char          magic;          /* passed to function as a hint */
140
    u_char          type;           /* type of variable */
141
    u_short         acl;            /* access control list for variable */
142
    FindVarMethod  *findVar;        /* function that finds variable */
143
    u_char          namelen;        /* length of name below */
144
    oid             name[4];       /* object identifier of variable */
145
};
146
 
147
struct variable7 {
148
    u_char          magic;          /* passed to function as a hint */
149
    u_char          type;           /* type of variable */
150
    u_short         acl;            /* access control list for variable */
151
    FindVarMethod  *findVar;        /* function that finds variable */
152
    u_char          namelen;        /* length of name below */
153
    oid             name[7];       /* object identifier of variable */
154
};
155
 
156
struct variable8 {
157
    u_char          magic;          /* passed to function as a hint */
158
    u_char          type;           /* type of variable */
159
    u_short         acl;            /* access control list for variable */
160
    FindVarMethod  *findVar;        /* function that finds variable */
161
    u_char          namelen;        /* length of name below */
162
    oid             name[8];       /* object identifier of variable */
163
};
164
 
165
struct variable13 {
166
    u_char          magic;          /* passed to function as a hint */
167
    u_char          type;           /* type of variable */
168
    u_short         acl;            /* access control list for variable */
169
    FindVarMethod  *findVar;        /* function that finds variable */
170
    u_char          namelen;        /* length of name below */
171
    oid             name[13];       /* object identifier of variable */
172
};
173
#endif /* VAR_STRUCT_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.