~ubuntu-branches/ubuntu/trusty/net-snmp/trusty

« back to all changes in this revision

Viewing changes to include/net-snmp/data_access/interface.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2007-05-10 22:20:23 UTC
  • mto: (1.4.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: james.westby@ubuntu.com-20070510222023-3fr07xb9i17xvq32
Tags: upstream-5.3.1
ImportĀ upstreamĀ versionĀ 5.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * interface data access header
3
3
 *
4
 
 * $Id: interface.h,v 1.15.2.1 2005/02/09 21:02:15 nba Exp $
 
4
 * $Id: interface.h,v 1.20 2005/11/16 20:11:12 rstory Exp $
5
5
 */
6
6
#ifndef NETSNMP_ACCESS_INTERFACE_H
7
7
#define NETSNMP_ACCESS_INTERFACE_H
24
24
#define NETSNMP_INTERFACE_FLAGS_HAS_LASTCHANGE          0x00000100
25
25
#define NETSNMP_INTERFACE_FLAGS_HAS_DISCONTINUITY       0x00000200
26
26
#define NETSNMP_INTERFACE_FLAGS_HAS_IF_FLAGS            0x00000400
 
27
#define NETSNMP_INTERFACE_FLAGS_CAN_DOWN_PROTOCOL       0x00000800
 
28
#define NETSNMP_INTERFACE_FLAGS_HAS_IPV4                0x00001000
 
29
#define NETSNMP_INTERFACE_FLAGS_HAS_IPV6                0x00002000
 
30
#define NETSNMP_INTERFACE_FLAGS_HAS_V4_RETRANSMIT       0x00004000
 
31
#define NETSNMP_INTERFACE_FLAGS_HAS_V4_REASMMAX         0x00008000
 
32
#define NETSNMP_INTERFACE_FLAGS_HAS_V6_RETRANSMIT       0x00010000
 
33
#define NETSNMP_INTERFACE_FLAGS_HAS_V6_REASMMAX         0x00020000
 
34
#define NETSNMP_INTERFACE_FLAGS_HAS_V6_REACHABLE        0x00040000
 
35
#define NETSNMP_INTERFACE_FLAGS_HAS_V6_IFID             0x00080000
 
36
#define NETSNMP_INTERFACE_FLAGS_HAS_V6_FORWARDING       0x00100000
27
37
 
28
38
/*************************************************************
29
39
 * constants for enums for the MIB node
60
70
/**---------------------------------------------------------------------*/
61
71
/*
62
72
 * structure definitions
 
73
 *
 
74
 * NOTE: if you add fields, update code dealing with
 
75
 *       stats in interface_common.c, particularly
 
76
 *       netsnmp_access_interface_entry_update_stats()
 
77
 *
63
78
 */
64
79
typedef struct netsnmp_interface_stats_s {
65
80
    /*
90
105
    unsigned int     onucast;
91
106
} netsnmp_interface_stats;
92
107
 
 
108
/*
 
109
 *
 
110
 * NOTE: if you add fields, update code dealing with
 
111
 *       them in interface_common.c, particularly
 
112
 *       netsnmp_access_interface_entry_copy().
 
113
 */
93
114
typedef struct netsnmp_interface_entry_s {
94
115
    netsnmp_index oid_index;
95
116
 
96
 
    int     ns_flags; /* net-snmp flags */
 
117
    u_int   ns_flags; /* net-snmp flags */
97
118
    oid     index;
98
119
 
99
120
    /*
103
124
    char   *name;
104
125
    char   *descr;
105
126
    int     type;
106
 
    unsigned int     speed;
107
 
    unsigned int     speed_high;
 
127
    u_int   speed;
 
128
    u_int   speed_high;
108
129
    char   *paddr;
109
 
    int     paddr_len;
110
 
    int     mtu;
 
130
    u_int   paddr_len;
 
131
    u_int   mtu;
 
132
 
 
133
    u_int   retransmit_v4; /* milliseconds */
 
134
    u_int   retransmit_v6; /* milliseconds */
 
135
 
 
136
    u_int   reachable_time; /* ipv6 / milliseconds */
111
137
 
112
138
    u_long  lastchange;
113
139
    time_t  discontinuity;
114
140
 
115
 
   char  admin_status;
116
 
   char  oper_status;
117
 
 
118
 
   /** booleans (not TruthValues!) */
119
 
   char  promiscuous;
120
 
   char  connector_present;
121
 
 
122
 
   /*-----------------------------------------------
123
 
    * platform/arch/access specific data
124
 
    */
125
 
   unsigned int os_flags; /* iff NETSNMP_INTERFACE_FLAGS_HAS_FAMILY */
126
 
 
127
 
   /*
128
 
    * statistics
129
 
    */
130
 
   netsnmp_interface_stats stats;
131
 
 
132
 
   /** old_stats is used in netsnmp_access_interface_entry_update_stats */
133
 
   netsnmp_interface_stats *old_stats;
 
141
    uint16_t     reasm_max; /* 0..65535 */
 
142
    char  admin_status;
 
143
    char  oper_status;
 
144
 
 
145
    /** booleans (not TruthValues!) */
 
146
    char  promiscuous;
 
147
    char  connector_present;
 
148
    char  forwarding_v6;
 
149
 
 
150
    char    v6_if_id_len;
 
151
    u_char  v6_if_id[8];
 
152
 
 
153
    /*-----------------------------------------------
 
154
     * platform/arch/access specific data
 
155
     */
 
156
    u_int os_flags; /* iff NETSNMP_INTERFACE_FLAGS_HAS_IF_FLAGS */
 
157
 
 
158
    /*
 
159
     * statistics
 
160
     */
 
161
    netsnmp_interface_stats stats;
 
162
 
 
163
    /** old_stats is used in netsnmp_access_interface_entry_update_stats */
 
164
    netsnmp_interface_stats *old_stats;
134
165
 
135
166
} netsnmp_interface_entry;
136
167
 
150
181
/*
151
182
 * ACCESS function prototypes
152
183
 */
153
 
void init_interface_common(void);
 
184
void init_interface(void);
154
185
void netsnmp_access_interface_init(void);
155
186
 
156
187
/*
167
198
netsnmp_access_interface_container_load(netsnmp_container* container,
168
199
                                        u_int load_flags);
169
200
#define NETSNMP_ACCESS_INTERFACE_LOAD_NOFLAGS               0x0000
 
201
#define NETSNMP_ACCESS_INTERFACE_LOAD_NO_STATS              0x0001
 
202
#define NETSNMP_ACCESS_INTERFACE_LOAD_IP4_ONLY              0x0002
 
203
#define NETSNMP_ACCESS_INTERFACE_LOAD_IP6_ONLY              0x0004
170
204
 
171
205
void netsnmp_access_interface_container_free(netsnmp_container *container,
172
206
                                             u_int free_flags);
212
246
int netsnmp_access_interface_entry_copy(netsnmp_interface_entry * lhs,
213
247
                                        netsnmp_interface_entry * rhs);
214
248
 
 
249
/*
 
250
 * utility routines
 
251
 */
215
252
void netsnmp_access_interface_entry_guess_speed(netsnmp_interface_entry *);
216
253
void netsnmp_access_interface_entry_overrides(netsnmp_interface_entry *);
217
254
 
219
256
netsnmp_conf_if_list *
220
257
netsnmp_access_interface_entry_overrides_get(const char * name);
221
258
 
 
259
/**---------------------------------------------------------------------*/
 
260
 
 
261
#if defined( USING_IF_MIB_IFTABLE_IFTABLE_DATA_ACCESS_MODULE ) && \
 
262
    ! defined( NETSNMP_NO_BACKWARDS_COMPATABILITY )
 
263
void
 
264
Interface_Scan_Init(void);
 
265
int
 
266
Interface_Scan_Next(short *index, char *name, netsnmp_interface_entry **entry,
 
267
                    void *dc);
 
268
#endif
222
269
 
223
270
/**---------------------------------------------------------------------*/
224
271