summaryrefslogtreecommitdiff
path: root/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
blob: 6f4cafe042b68ac34f49f5b74a96507051462d32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
/*
 * Note: this file originally auto-generated by mib2c using
 *       version : 1.48 $ of : mfd-top.m2c,v $
 *
 * $Id: ipAddressTable.h 14169 2006-01-25 16:28:12Z dts12 $
 */
#ifndef IPADDRESSTABLE_H
#define IPADDRESSTABLE_H

#ifdef __cplusplus
extern          "C" {
#endif


/** @addtogroup misc misc: Miscellaneous routines
 *
 * @{
 */
#include <net-snmp/library/asn1.h>
#include <net-snmp/data_access/ipaddress.h>

    /*
     * other required module components 
     */
    /* *INDENT-OFF*  */
config_require(if-mib/data_access/interface)
config_require(ip-mib/data_access/ipaddress)
config_require(ip-mib/ipAddressTable/ipAddressTable_interface)
config_require(ip-mib/ipAddressTable/ipAddressTable_data_access)
    /* *INDENT-ON*  */

    /*
     * OID, column number and enum definions for ipAddressTable 
     */
#include "ipAddressTable_constants.h"

    /*
     *********************************************************************
     * function declarations
     */
    void            init_ipAddressTable(void);
    void            shutdown_ipAddressTable(void);

    /*
     *********************************************************************
     * Table declarations
     */
/**********************************************************************
 **********************************************************************
 ***
 *** Table ipAddressTable
 ***
 **********************************************************************
 **********************************************************************/
    /*
     * IP-MIB::ipAddressTable is subid 34 of ip.
     * Its status is Current.
     * OID: .1.3.6.1.2.1.4.34, length: 8
     */
    /*
     *********************************************************************
     * When you register your mib, you get to provide a generic
     * pointer that will be passed back to you for most of the
     * functions calls.
     *
     * TODO:100:r: Review all context structures
     */
    /*
     * TODO:101:o: |-> Review ipAddressTable registration context.
     */
    typedef netsnmp_data_list ipAddressTable_registration;

/**********************************************************************/
    /*
     * TODO:110:r: |-> Review ipAddressTable data context structure.
     * This structure is used to represent the data for ipAddressTable.
     */
    typedef netsnmp_ipaddress_entry ipAddressTable_data;


    /*
     *********************************************************************
     * TODO:115:o: |-> Review ipAddressTable undo context.
     * We're just going to use the same data structure for our
     * undo_context. If you want to do something more efficent,
     * define your typedef here.
     */
    typedef ipAddressTable_data ipAddressTable_undo_data;

    /*
     * TODO:120:r: |-> Review ipAddressTable mib index.
     * This structure is used to represent the index for ipAddressTable.
     */
    typedef struct ipAddressTable_mib_index_s {

        /*
         * ipAddressAddrType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
         */
        u_long          ipAddressAddrType;

        /*
         * ipAddressAddr(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
         */
        /** 128 - 1(other indexes) - oid length(10) = 116 */
        char            ipAddressAddr[116];
        size_t          ipAddressAddr_len;


    } ipAddressTable_mib_index;

    /*
     * TODO:121:r: |   |-> Review ipAddressTable max index length.
     * If you KNOW that your indexes will never exceed a certain
     * length, update this macro to that length.
     *
     * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
     * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
     * Guessing 128 - col/entry(2)  - oid len(8)
     */
#define MAX_ipAddressTable_IDX_LEN     118


    /*
     *********************************************************************
     * TODO:130:o: |-> Review ipAddressTable Row request (rowreq) context.
     * When your functions are called, you will be passed a
     * ipAddressTable_rowreq_ctx pointer.
     */
    typedef struct ipAddressTable_rowreq_ctx_s {

    /** this must be first for container compare to work */
        netsnmp_index   oid_idx;
        oid             oid_tmp[MAX_ipAddressTable_IDX_LEN];

        ipAddressTable_mib_index tbl_idx;

        ipAddressTable_data *data;
        ipAddressTable_undo_data *undo;
        unsigned int    column_set_flags;       /* flags for set columns */


        /*
         * flags per row. Currently, the first (lower) 8 bits are reserved
         * for the user. See mfd.h for other flags.
         */
        u_int           rowreq_flags;

        /*
         * TODO:131:o: |   |-> Add useful data to ipAddressTable rowreq context.
         */

        /*
         * not available from net-snmp ipaddress data_access
         */
        uint32_t        ipAddressCreated;       /* sysUpTime */
        uint32_t        ipAddressLastChanged, ipAddressLastChanged_undo;        /* sysUpTime */
        int             ipAddressRowStatus, ipAddressRowStatus_undo;

        /*
         * storage for future expansion
         */
        netsnmp_data_list *ipAddressTable_data_list;

    } ipAddressTable_rowreq_ctx;

    typedef struct ipAddressTable_ref_rowreq_ctx_s {
        ipAddressTable_rowreq_ctx *rowreq_ctx;
    } ipAddressTable_ref_rowreq_ctx;

    /*
     *********************************************************************
     * function prototypes
     */
    int             ipAddressTable_pre_request(ipAddressTable_registration
                                               * user_context);
    int             ipAddressTable_post_request(ipAddressTable_registration
                                                * user_context, int rc);

    int
        ipAddressTable_rowreq_ctx_init(ipAddressTable_rowreq_ctx *
                                       rowreq_ctx, void *user_init_ctx);
    void
        ipAddressTable_rowreq_ctx_cleanup(ipAddressTable_rowreq_ctx *
                                          rowreq_ctx);

    ipAddressTable_data *ipAddressTable_allocate_data(void);
    void            ipAddressTable_release_data(ipAddressTable_data *
                                                data);

    int
        ipAddressTable_check_dependencies(ipAddressTable_rowreq_ctx *
                                          rowreq_ctx);
    int             ipAddressTable_commit(ipAddressTable_rowreq_ctx *
                                          rowreq_ctx);

        ipAddressTable_rowreq_ctx
        * ipAddressTable_row_find_by_mib_index(ipAddressTable_mib_index *
                                               mib_idx);

    extern oid      ipAddressTable_oid[];
    extern int      ipAddressTable_oid_size;


#include "ipAddressTable_interface.h"
#include "ipAddressTable_data_access.h"
    /*
     *********************************************************************
     * GET function declarations
     */

    /*
     *********************************************************************
     * GET Table declarations
     */
/**********************************************************************
 **********************************************************************
 ***
 *** Table ipAddressTable
 ***
 **********************************************************************
 **********************************************************************/
    /*
     * IP-MIB::ipAddressTable is subid 34 of ip.
     * Its status is Current.
     * OID: .1.3.6.1.2.1.4.34, length: 8
     */
    /*
     * indexes
     */
    int             ipAddressAddrType_map(u_long *
                                          mib_ipAddressAddrType_val_ptr,
                                          u_long
                                          raw_ipAddressAddrType_val);

    int             ipAddressIfIndex_get(ipAddressTable_rowreq_ctx *
                                         rowreq_ctx,
                                         long *ipAddressIfIndex_val_ptr);
    int             ipAddressType_get(ipAddressTable_rowreq_ctx *
                                      rowreq_ctx,
                                      u_long * ipAddressType_val_ptr);
    int             ipAddressPrefix_get(ipAddressTable_rowreq_ctx *
                                        rowreq_ctx,
                                        oid ** ipAddressPrefix_val_ptr_ptr,
                                        size_t
                                        * ipAddressPrefix_val_ptr_len_ptr);
    int             ipAddressOrigin_get(ipAddressTable_rowreq_ctx *
                                        rowreq_ctx,
                                        u_long * ipAddressOrigin_val_ptr);
    int             ipAddressStatus_get(ipAddressTable_rowreq_ctx *
                                        rowreq_ctx,
                                        u_long * ipAddressStatus_val_ptr);
    int             ipAddressCreated_get(ipAddressTable_rowreq_ctx *
                                         rowreq_ctx,
                                         u_long *
                                         ipAddressCreated_val_ptr);
    int             ipAddressLastChanged_get(ipAddressTable_rowreq_ctx *
                                             rowreq_ctx,
                                             u_long *
                                             ipAddressLastChanged_val_ptr);
    int             ipAddressRowStatus_get(ipAddressTable_rowreq_ctx *
                                           rowreq_ctx,
                                           u_long *
                                           ipAddressRowStatus_val_ptr);
    int             ipAddressStorageType_get(ipAddressTable_rowreq_ctx *
                                             rowreq_ctx,
                                             u_long *
                                             ipAddressStorageType_val_ptr);


    int
        ipAddressTable_indexes_set_tbl_idx(ipAddressTable_mib_index *
                                           tbl_idx,
                                           u_long ipAddressAddrType_val,
                                           char *ipAddressAddr_val_ptr,
                                           size_t
                                           ipAddressAddr_val_ptr_len);
    int             ipAddressTable_indexes_set(ipAddressTable_rowreq_ctx *
                                               rowreq_ctx,
                                               u_long
                                               ipAddressAddrType_val,
                                               char *ipAddressAddr_val_ptr,
                                               size_t
                                               ipAddressAddr_val_ptr_len);



    /*
     *********************************************************************
     * SET function declarations
     */

    /*
     *********************************************************************
     * SET Table declarations
     */
/**********************************************************************
 **********************************************************************
 ***
 *** Table ipAddressTable
 ***
 **********************************************************************
 **********************************************************************/
    /*
     * IP-MIB::ipAddressTable is subid 34 of ip.
     * Its status is Current.
     * OID: .1.3.6.1.2.1.4.34, length: 8
     */


    int             ipAddressTable_undo_setup(ipAddressTable_rowreq_ctx *
                                              rowreq_ctx);
    int             ipAddressTable_undo_cleanup(ipAddressTable_rowreq_ctx *
                                                rowreq_ctx);
    int             ipAddressTable_undo(ipAddressTable_rowreq_ctx *
                                        rowreq_ctx);
    int             ipAddressTable_commit(ipAddressTable_rowreq_ctx *
                                          rowreq_ctx);
    int             ipAddressTable_undo_commit(ipAddressTable_rowreq_ctx *
                                               rowreq_ctx);


    int             ipAddressIfIndex_check_value(ipAddressTable_rowreq_ctx
                                                 * rowreq_ctx, long
                                                 ipAddressIfIndex_val);

    int             ipAddressIfIndex_undo_setup(ipAddressTable_rowreq_ctx *
                                                rowreq_ctx);
    int             ipAddressIfIndex_set(ipAddressTable_rowreq_ctx *
                                         rowreq_ctx,
                                         long ipAddressIfIndex_val);
    int             ipAddressIfIndex_undo(ipAddressTable_rowreq_ctx *
                                          rowreq_ctx);

    int             ipAddressType_check_value(ipAddressTable_rowreq_ctx *
                                              rowreq_ctx,
                                              u_long ipAddressType_val);
    int             ipAddressType_undo_setup(ipAddressTable_rowreq_ctx *
                                             rowreq_ctx);
    int             ipAddressType_set(ipAddressTable_rowreq_ctx *
                                      rowreq_ctx,
                                      u_long ipAddressType_val);
    int             ipAddressType_undo(ipAddressTable_rowreq_ctx *
                                       rowreq_ctx);

    int             ipAddressPrefix_check_value(ipAddressTable_rowreq_ctx *
                                                rowreq_ctx,
                                                oid *
                                                ipAddressPrefix_val_ptr,
                                                size_t
                                                ipAddressPrefix_val_ptr_len);
    int             ipAddressPrefix_undo_setup(ipAddressTable_rowreq_ctx *
                                               rowreq_ctx);
    int             ipAddressPrefix_set(ipAddressTable_rowreq_ctx *
                                        rowreq_ctx,
                                        oid * ipAddressPrefix_val_ptr,
                                        size_t
                                        ipAddressPrefix_val_ptr_len);
    int             ipAddressPrefix_undo(ipAddressTable_rowreq_ctx *
                                         rowreq_ctx);

    int             ipAddressOrigin_check_value(ipAddressTable_rowreq_ctx *
                                                rowreq_ctx,
                                                u_long
                                                ipAddressOrigin_val);
    int             ipAddressOrigin_undo_setup(ipAddressTable_rowreq_ctx *
                                               rowreq_ctx);
    int             ipAddressOrigin_set(ipAddressTable_rowreq_ctx *
                                        rowreq_ctx,
                                        u_long ipAddressOrigin_val);
    int             ipAddressOrigin_undo(ipAddressTable_rowreq_ctx *
                                         rowreq_ctx);

    int             ipAddressStatus_check_value(ipAddressTable_rowreq_ctx *
                                                rowreq_ctx,
                                                u_long
                                                ipAddressStatus_val);
    int             ipAddressStatus_undo_setup(ipAddressTable_rowreq_ctx *
                                               rowreq_ctx);
    int             ipAddressStatus_set(ipAddressTable_rowreq_ctx *
                                        rowreq_ctx,
                                        u_long ipAddressStatus_val);
    int             ipAddressStatus_undo(ipAddressTable_rowreq_ctx *
                                         rowreq_ctx);

    int             ipAddressCreated_check_value(ipAddressTable_rowreq_ctx
                                                 * rowreq_ctx,
                                                 u_long
                                                 ipAddressCreated_val);
    int             ipAddressCreated_undo_setup(ipAddressTable_rowreq_ctx *
                                                rowreq_ctx);
    int             ipAddressCreated_set(ipAddressTable_rowreq_ctx *
                                         rowreq_ctx,
                                         u_long ipAddressCreated_val);
    int             ipAddressCreated_undo(ipAddressTable_rowreq_ctx *
                                          rowreq_ctx);

    int
        ipAddressLastChanged_check_value(ipAddressTable_rowreq_ctx *
                                         rowreq_ctx,
                                         u_long ipAddressLastChanged_val);
    int
        ipAddressLastChanged_undo_setup(ipAddressTable_rowreq_ctx *
                                        rowreq_ctx);
    int             ipAddressLastChanged_set(ipAddressTable_rowreq_ctx *
                                             rowreq_ctx,
                                             u_long
                                             ipAddressLastChanged_val);
    int             ipAddressLastChanged_undo(ipAddressTable_rowreq_ctx *
                                              rowreq_ctx);

    int
        ipAddressRowStatus_check_value(ipAddressTable_rowreq_ctx *
                                       rowreq_ctx,
                                       u_long ipAddressRowStatus_val);
    int             ipAddressRowStatus_undo_setup(ipAddressTable_rowreq_ctx
                                                  * rowreq_ctx);
    int             ipAddressRowStatus_set(ipAddressTable_rowreq_ctx *
                                           rowreq_ctx,
                                           u_long ipAddressRowStatus_val);
    int             ipAddressRowStatus_undo(ipAddressTable_rowreq_ctx *
                                            rowreq_ctx);

    int
        ipAddressStorageType_check_value(ipAddressTable_rowreq_ctx *
                                         rowreq_ctx,
                                         u_long ipAddressStorageType_val);
    int
        ipAddressStorageType_undo_setup(ipAddressTable_rowreq_ctx *
                                        rowreq_ctx);
    int             ipAddressStorageType_set(ipAddressTable_rowreq_ctx *
                                             rowreq_ctx,
                                             u_long
                                             ipAddressStorageType_val);
    int             ipAddressStorageType_undo(ipAddressTable_rowreq_ctx *
                                              rowreq_ctx);


    int
        ipAddressTable_check_dependencies(ipAddressTable_rowreq_ctx * ctx);


    /*
     * DUMMY markers, ignore
     *
     * TODO:099:x: *************************************************************
     * TODO:199:x: *************************************************************
     * TODO:299:x: *************************************************************
     * TODO:399:x: *************************************************************
     * TODO:499:x: *************************************************************
     */

#ifdef __cplusplus
}
#endif
#endif                          /* IPADDRESSTABLE_H */
/**  @} */