~ubuntu-branches/debian/lenny/net-snmp/lenny

« back to all changes in this revision

Viewing changes to agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2007-05-10 22:20:23 UTC
  • 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
/*
 
2
 * Note: this file originally auto-generated by mib2c using
 
3
 *       version : 1.48 $ of : mfd-top.m2c,v $ 
 
4
 *
 
5
 * $Id: snmpNotifyFilterTable.c,v 1.2.2.1 2006/01/25 16:26:39 dts12 Exp $
 
6
 */
 
7
/** \page MFD helper for snmpNotifyFilterTable
 
8
 *
 
9
 * \section intro Introduction
 
10
 * Introductory text.
 
11
 *
 
12
 */
 
13
/*
 
14
 * standard Net-SNMP includes 
 
15
 */
 
16
#include <net-snmp/net-snmp-config.h>
 
17
#include <net-snmp/net-snmp-includes.h>
 
18
#include <net-snmp/agent/net-snmp-agent-includes.h>
 
19
 
 
20
/*
 
21
 * include our parent header 
 
22
 */
 
23
#include "snmpNotifyFilterTable.h"
 
24
 
 
25
#include <net-snmp/agent/mib_modules.h>
 
26
 
 
27
#include "snmpNotifyFilterTable_interface.h"
 
28
 
 
29
oid             snmpNotifyFilterTable_oid[] =
 
30
    { SNMPNOTIFYFILTERTABLE_OID };
 
31
int             snmpNotifyFilterTable_oid_size =
 
32
OID_LENGTH(snmpNotifyFilterTable_oid);
 
33
 
 
34
snmpNotifyFilterTable_registration snmpNotifyFilterTable_user_context;
 
35
 
 
36
void            initialize_table_snmpNotifyFilterTable(void);
 
37
void            shutdown_table_snmpNotifyFilterTable(void);
 
38
 
 
39
 
 
40
/**
 
41
 * Initializes the snmpNotifyFilterTable module
 
42
 */
 
43
void
 
44
init_snmpNotifyFilterTable(void)
 
45
{
 
46
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:init_snmpNotifyFilterTable",
 
47
                "called\n"));
 
48
 
 
49
    /*
 
50
     * TODO:300:o: Perform snmpNotifyFilterTable one-time module initialization.
 
51
     */
 
52
 
 
53
    /*
 
54
     * here we initialize all the tables we're planning on supporting
 
55
     */
 
56
    if (should_init("snmpNotifyFilterTable"))
 
57
        initialize_table_snmpNotifyFilterTable();
 
58
 
 
59
}                               /* init_snmpNotifyFilterTable */
 
60
 
 
61
/**
 
62
 * Shut-down the snmpNotifyFilterTable module (agent is exiting)
 
63
 */
 
64
void
 
65
shutdown_snmpNotifyFilterTable(void)
 
66
{
 
67
    if (should_init("snmpNotifyFilterTable"))
 
68
        shutdown_table_snmpNotifyFilterTable();
 
69
 
 
70
}
 
71
 
 
72
/**
 
73
 * Initialize the table snmpNotifyFilterTable 
 
74
 *    (Define its contents and how it's structured)
 
75
 */
 
76
void
 
77
initialize_table_snmpNotifyFilterTable(void)
 
78
{
 
79
    snmpNotifyFilterTable_registration *user_context;
 
80
    u_long          flags;
 
81
 
 
82
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:initialize_table_snmpNotifyFilterTable", "called\n"));
 
83
 
 
84
    /*
 
85
     * TODO:301:o: Perform snmpNotifyFilterTable one-time table initialization.
 
86
     */
 
87
 
 
88
    /*
 
89
     * TODO:302:o: |->Initialize snmpNotifyFilterTable user context
 
90
     * if you'd like to pass in a pointer to some data for this
 
91
     * table, allocate or set it up here.
 
92
     */
 
93
    /*
 
94
     * a netsnmp_data_list is a simple way to store void pointers. A simple
 
95
     * string token is used to add, find or remove pointers.
 
96
     */
 
97
    user_context =
 
98
        netsnmp_create_data_list("snmpNotifyFilterTable", NULL, NULL);
 
99
 
 
100
    /*
 
101
     * No support for any flags yet, but in the future you would
 
102
     * set any flags here.
 
103
     */
 
104
    flags = 0;
 
105
 
 
106
    /*
 
107
     * call interface initialization code
 
108
     */
 
109
    _snmpNotifyFilterTable_initialize_interface(user_context, flags);
 
110
}                               /* initialize_table_snmpNotifyFilterTable */
 
111
 
 
112
/**
 
113
 * Shutdown the table snmpNotifyFilterTable 
 
114
 */
 
115
void
 
116
shutdown_table_snmpNotifyFilterTable(void)
 
117
{
 
118
    /*
 
119
     * call interface shutdown code
 
120
     */
 
121
    _snmpNotifyFilterTable_shutdown_interface
 
122
        (&snmpNotifyFilterTable_user_context);
 
123
}
 
124
 
 
125
/**
 
126
 * extra context initialization (eg default values)
 
127
 *
 
128
 * @param rowreq_ctx    : row request context
 
129
 * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
 
130
 *
 
131
 * @retval MFD_SUCCESS  : no errors
 
132
 * @retval MFD_ERROR    : error (context allocate will fail)
 
133
 */
 
134
int
 
135
snmpNotifyFilterTable_rowreq_ctx_init(snmpNotifyFilterTable_rowreq_ctx *
 
136
                                      rowreq_ctx, void *user_init_ctx)
 
137
{
 
138
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_rowreq_ctx_init", "called\n"));
 
139
 
 
140
    netsnmp_assert(NULL != rowreq_ctx);
 
141
 
 
142
    /*
 
143
     * TODO:210:o: |-> Perform extra snmpNotifyFilterTable rowreq initialization. (eg DEFVALS)
 
144
     */
 
145
    /*
 
146
     * strings and oids are hard to handle automagically.
 
147
     * so all we've got for you is a hint:
 
148
     *
 
149
     * memcpy(rowreq_ctx->data.snmpNotifyFilterMask, 0,
 
150
     *        len(0) * sizeof(snmpNotifyFilterMask[0]);
 
151
     */
 
152
 
 
153
    rowreq_ctx->data.snmpNotifyFilterType = SNMPNOTIFYFILTERTYPE_INCLUDED;
 
154
 
 
155
    rowreq_ctx->data.snmpNotifyFilterStorageType = STORAGETYPE_NONVOLATILE;
 
156
 
 
157
 
 
158
    return MFD_SUCCESS;
 
159
}                               /* snmpNotifyFilterTable_rowreq_ctx_init */
 
160
 
 
161
/**
 
162
 * extra context cleanup
 
163
 * @param  rowreq_ctx
 
164
 */
 
165
void
 
166
snmpNotifyFilterTable_rowreq_ctx_cleanup(snmpNotifyFilterTable_rowreq_ctx *
 
167
                                         rowreq_ctx)
 
168
{
 
169
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_rowreq_ctx_cleanup", "called\n"));
 
170
 
 
171
    netsnmp_assert(NULL != rowreq_ctx);
 
172
 
 
173
    /*
 
174
     * TODO:211:o: |-> Perform extra snmpNotifyFilterTable rowreq cleanup.
 
175
     */
 
176
}                               /* snmpNotifyFilterTable_rowreq_ctx_cleanup */
 
177
 
 
178
/************************************************************
 
179
 * the *_should_save routine is called to determine if a row
 
180
 * should be stored persistently.
 
181
 *
 
182
 * Note that this is not a 'dirty' check (i.e. if a row has changed),
 
183
 * but a check for volatile rows that should not be saved between
 
184
 * restarts.
 
185
 * @param rowreq_ctx
 
186
 * @retval  1 if the row should be stored
 
187
 * @retval  0 if the row should not be stored
 
188
 */
 
189
int
 
190
 
 
191
    
 
192
    
 
193
    
 
194
    
 
195
    
 
196
    
 
197
    
 
198
    
 
199
    
 
200
    
 
201
    
 
202
    
 
203
    
 
204
    
 
205
    snmpNotifyFilterTable_container_should_save
 
206
    (snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx) {
 
207
    if (SNMP_STORAGE_VOLATILE ==
 
208
        rowreq_ctx->data.snmpNotifyFilterStorageType)
 
209
        return 0;
 
210
 
 
211
    return 1;                   /* save the row */
 
212
}
 
213
 
 
214
/**
 
215
 * pre-request callback
 
216
 *
 
217
 * @param user_context
 
218
 * @retval MFD_SUCCESS              : success.
 
219
 * @retval MFD_ERROR                : other error
 
220
 */
 
221
int
 
222
snmpNotifyFilterTable_pre_request(snmpNotifyFilterTable_registration *
 
223
                                  user_context)
 
224
{
 
225
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_pre_request", "called\n"));
 
226
 
 
227
    /*
 
228
     * TODO:510:o: Perform snmpNotifyFilterTable pre-request actions.
 
229
     */
 
230
 
 
231
    return MFD_SUCCESS;
 
232
}                               /* snmpNotifyFilterTable_pre_request */
 
233
 
 
234
/**
 
235
 * post-request callback
 
236
 *
 
237
 * Note:
 
238
 *   New rows have been inserted into the container, and
 
239
 *   deleted rows have been removed from the container and
 
240
 *   released.
 
241
 * @param user_context
 
242
 * @param rc : MFD_SUCCESS if all requests succeeded
 
243
 *
 
244
 * @retval MFD_SUCCESS : success.
 
245
 * @retval MFD_ERROR   : other error (ignored)
 
246
 */
 
247
int
 
248
snmpNotifyFilterTable_post_request(snmpNotifyFilterTable_registration *
 
249
                                   user_context, int rc)
 
250
{
 
251
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_post_request", "called\n"));
 
252
 
 
253
    /*
 
254
     * TODO:511:o: Perform snmpNotifyFilterTable post-request actions.
 
255
     */
 
256
 
 
257
    /*
 
258
     * check to set if any rows were changed.
 
259
     */
 
260
    if (snmpNotifyFilterTable_dirty_get()) {
 
261
        /*
 
262
         * check if request was successful. If so, this would be
 
263
         * a good place to save data to its persistent store.
 
264
         */
 
265
        if (MFD_SUCCESS == rc) {
 
266
            /*
 
267
             * save changed rows, if you haven't already
 
268
             */
 
269
            snmp_store(netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
 
270
                                             NETSNMP_DS_LIB_APPTYPE));
 
271
        }
 
272
 
 
273
        snmpNotifyFilterTable_dirty_set(0);     /* clear table dirty flag */
 
274
    }
 
275
 
 
276
    return MFD_SUCCESS;
 
277
}                               /* snmpNotifyFilterTable_post_request */
 
278
 
 
279
 
 
280
/**********************************************************************
 
281
 **********************************************************************
 
282
 ***
 
283
 *** Table snmpNotifyFilterTable
 
284
 ***
 
285
 **********************************************************************
 
286
 **********************************************************************/
 
287
/*
 
288
 * SNMP-NOTIFICATION-MIB::snmpNotifyFilterTable is subid 3 of snmpNotifyObjects.
 
289
 * Its status is Current.
 
290
 * OID: .1.3.6.1.6.3.13.1.3, length: 9
 
291
 */
 
292
 
 
293
/*
 
294
 * ---------------------------------------------------------------------
 
295
 * * TODO:200:r: Implement snmpNotifyFilterTable data context functions.
 
296
 */
 
297
 
 
298
 
 
299
/**
 
300
 * set mib index(es)
 
301
 *
 
302
 * @param tbl_idx mib index structure
 
303
 * @param snmpNotifyFilterProfileName_val_ptr
 
304
 * @param snmpNotifyFilterProfileName_val_ptr_len
 
305
 * @param snmpNotifyFilterSubtree_val_ptr
 
306
 * @param snmpNotifyFilterSubtree_val_ptr_len
 
307
 *
 
308
 * @retval MFD_SUCCESS     : success.
 
309
 * @retval MFD_ERROR       : other error.
 
310
 *
 
311
 * @remark
 
312
 *  This convenience function is useful for setting all the MIB index
 
313
 *  components with a single function call. It is assume that the C values
 
314
 *  have already been mapped from their native/rawformat to the MIB format.
 
315
 */
 
316
int
 
317
snmpNotifyFilterTable_indexes_set_tbl_idx(snmpNotifyFilterTable_mib_index *
 
318
                                          tbl_idx, char
 
319
                                          *snmpNotifyFilterProfileName_val_ptr,
 
320
                                          size_t
 
321
                                          snmpNotifyFilterProfileName_val_ptr_len,
 
322
                                          oid *
 
323
                                          snmpNotifyFilterSubtree_val_ptr,
 
324
                                          size_t
 
325
                                          snmpNotifyFilterSubtree_val_ptr_len)
 
326
{
 
327
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_indexes_set_tbl_idx", "called\n"));
 
328
 
 
329
    /*
 
330
     * snmpNotifyFilterProfileName(1)/SnmpAdminString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H 
 
331
     */
 
332
    tbl_idx->snmpNotifyFilterProfileName_len = sizeof(tbl_idx->snmpNotifyFilterProfileName) / sizeof(tbl_idx->snmpNotifyFilterProfileName[0]);  /* max length */
 
333
    /*
 
334
     * make sure there is enough space for snmpNotifyFilterProfileName data
 
335
     */
 
336
    if ((NULL == tbl_idx->snmpNotifyFilterProfileName) ||
 
337
        (tbl_idx->snmpNotifyFilterProfileName_len <
 
338
         (snmpNotifyFilterProfileName_val_ptr_len))) {
 
339
        snmp_log(LOG_ERR, "not enough space for value\n");
 
340
        return MFD_ERROR;
 
341
    }
 
342
    tbl_idx->snmpNotifyFilterProfileName_len =
 
343
        snmpNotifyFilterProfileName_val_ptr_len;
 
344
    memcpy(tbl_idx->snmpNotifyFilterProfileName,
 
345
           snmpNotifyFilterProfileName_val_ptr,
 
346
           snmpNotifyFilterProfileName_val_ptr_len *
 
347
           sizeof(snmpNotifyFilterProfileName_val_ptr[0]));
 
348
 
 
349
    /*
 
350
     * snmpNotifyFilterSubtree(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/a/w/e/r/d/h 
 
351
     */
 
352
    tbl_idx->snmpNotifyFilterSubtree_len = sizeof(tbl_idx->snmpNotifyFilterSubtree) / sizeof(tbl_idx->snmpNotifyFilterSubtree[0]);      /* max length */
 
353
    /*
 
354
     * make sure there is enough space for snmpNotifyFilterSubtree data
 
355
     */
 
356
    if ((NULL == tbl_idx->snmpNotifyFilterSubtree) ||
 
357
        (tbl_idx->snmpNotifyFilterSubtree_len <
 
358
         (snmpNotifyFilterSubtree_val_ptr_len))) {
 
359
        snmp_log(LOG_ERR, "not enough space for value\n");
 
360
        return MFD_ERROR;
 
361
    }
 
362
    tbl_idx->snmpNotifyFilterSubtree_len =
 
363
        snmpNotifyFilterSubtree_val_ptr_len;
 
364
    memcpy(tbl_idx->snmpNotifyFilterSubtree,
 
365
           snmpNotifyFilterSubtree_val_ptr,
 
366
           snmpNotifyFilterSubtree_val_ptr_len *
 
367
           sizeof(snmpNotifyFilterSubtree_val_ptr[0]));
 
368
 
 
369
 
 
370
    return MFD_SUCCESS;
 
371
}                               /* snmpNotifyFilterTable_indexes_set_tbl_idx */
 
372
 
 
373
/**
 
374
 * @internal
 
375
 * set row context indexes
 
376
 *
 
377
 * @param rowreq_ctx the row context that needs updated indexes
 
378
 * @param snmpNotifyFilterProfileName_val_ptr
 
379
 * @param snmpNotifyFilterProfileName_val_ptr_len
 
380
 * @param snmpNotifyFilterSubtree_val_ptr
 
381
 * @param snmpNotifyFilterSubtree_val_ptr_len
 
382
 *
 
383
 * @retval MFD_SUCCESS     : success.
 
384
 * @retval MFD_ERROR       : other error.
 
385
 *
 
386
 * @remark
 
387
 *  This function sets the mib indexs, then updates the oid indexs
 
388
 *  from the mib index.
 
389
 */
 
390
int
 
391
snmpNotifyFilterTable_indexes_set(snmpNotifyFilterTable_rowreq_ctx *
 
392
                                  rowreq_ctx, char
 
393
                                  *snmpNotifyFilterProfileName_val_ptr,
 
394
                                  size_t
 
395
                                  snmpNotifyFilterProfileName_val_ptr_len,
 
396
                                  oid * snmpNotifyFilterSubtree_val_ptr,
 
397
                                  size_t
 
398
                                  snmpNotifyFilterSubtree_val_ptr_len)
 
399
{
 
400
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_indexes_set", "called\n"));
 
401
 
 
402
    if (MFD_SUCCESS !=
 
403
        snmpNotifyFilterTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
 
404
                                                  snmpNotifyFilterProfileName_val_ptr,
 
405
                                                  snmpNotifyFilterProfileName_val_ptr_len,
 
406
                                                  snmpNotifyFilterSubtree_val_ptr,
 
407
                                                  snmpNotifyFilterSubtree_val_ptr_len))
 
408
        return MFD_ERROR;
 
409
 
 
410
    /*
 
411
     * convert mib index to oid index
 
412
     */
 
413
    rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
 
414
    if (0 != snmpNotifyFilterTable_index_to_oid(&rowreq_ctx->oid_idx,
 
415
                                                &rowreq_ctx->tbl_idx)) {
 
416
        return MFD_ERROR;
 
417
    }
 
418
 
 
419
    return MFD_SUCCESS;
 
420
}                               /* snmpNotifyFilterTable_indexes_set */
 
421
 
 
422
 
 
423
/*---------------------------------------------------------------------
 
424
 * SNMP-NOTIFICATION-MIB::snmpNotifyFilterEntry.snmpNotifyFilterMask
 
425
 * snmpNotifyFilterMask is subid 2 of snmpNotifyFilterEntry.
 
426
 * Its status is Current, and its access level is Create.
 
427
 * OID: .1.3.6.1.6.3.13.1.3.1.2
 
428
 * Description:
 
429
The bit mask which, in combination with the corresponding
 
430
         instance of snmpNotifyFilterSubtree, defines a family of
 
431
         subtrees which are included in or excluded from the
 
432
         filter profile.
 
433
 
 
434
         Each bit of this bit mask corresponds to a
 
435
         sub-identifier of snmpNotifyFilterSubtree, with the
 
436
         most significant bit of the i-th octet of this octet
 
437
         string value (extended if necessary, see below)
 
438
         corresponding to the (8*i - 7)-th sub-identifier, and
 
439
         the least significant bit of the i-th octet of this
 
440
         octet string corresponding to the (8*i)-th
 
441
         sub-identifier, where i is in the range 1 through 16.
 
442
 
 
443
         Each bit of this bit mask specifies whether or not
 
444
         the corresponding sub-identifiers must match when
 
445
         determining if an OBJECT IDENTIFIER matches this
 
446
         family of filter subtrees; a '1' indicates that an
 
447
         exact match must occur; a '0' indicates 'wild card',
 
448
         i.e., any sub-identifier value matches.
 
449
 
 
450
         Thus, the OBJECT IDENTIFIER X of an object instance
 
451
         is contained in a family of filter subtrees if, for
 
452
         each sub-identifier of the value of
 
453
         snmpNotifyFilterSubtree, either:
 
454
 
 
455
           the i-th bit of snmpNotifyFilterMask is 0, or
 
456
 
 
457
           the i-th sub-identifier of X is equal to the i-th
 
458
           sub-identifier of the value of
 
459
           snmpNotifyFilterSubtree.
 
460
 
 
461
         If the value of this bit mask is M bits long and
 
462
         there are more than M sub-identifiers in the
 
463
         corresponding instance of snmpNotifyFilterSubtree,
 
464
         then the bit mask is extended with 1's to be the
 
465
         required length.
 
466
 
 
467
         Note that when the value of this object is the
 
468
         zero-length string, this extension rule results in
 
469
         a mask of all-1's being used (i.e., no 'wild card'),
 
470
         and the family of filter subtrees is the one
 
471
         subtree uniquely identified by the corresponding
 
472
         instance of snmpNotifyFilterSubtree.
 
473
 *
 
474
 * Attributes:
 
475
 *   accessible 1     isscalar 0     enums  0      hasdefval 1
 
476
 *   readable   1     iscolumn 1     ranges 1      hashint   0
 
477
 *   settable   1
 
478
 *   defval: 0
 
479
 *
 
480
 * Ranges:  0 - 16;
 
481
 *
 
482
 * Its syntax is OCTETSTR (based on perltype OCTETSTR)
 
483
 * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
 
484
 * This data type requires a length.  (Max 16)
 
485
 */
 
486
/**
 
487
 * Extract the current value of the snmpNotifyFilterMask data.
 
488
 *
 
489
 * Set a value using the data context for the row.
 
490
 *
 
491
 * @param rowreq_ctx
 
492
 *        Pointer to the row request context.
 
493
 * @param snmpNotifyFilterMask_val_ptr_ptr
 
494
 *        Pointer to storage for a char variable
 
495
 * @param snmpNotifyFilterMask_val_ptr_len_ptr
 
496
 *        Pointer to a size_t. On entry, it will contain the size (in bytes)
 
497
 *        pointed to by snmpNotifyFilterMask.
 
498
 *        On exit, this value should contain the data size (in bytes).
 
499
 *
 
500
 * @retval MFD_SUCCESS         : success
 
501
 * @retval MFD_SKIP            : skip this node (no value for now)
 
502
 * @retval MFD_ERROR           : Any other error
 
503
*
 
504
 * @note If you need more than (*snmpNotifyFilterMask_val_ptr_len_ptr) bytes of memory,
 
505
 *       allocate it using malloc() and update snmpNotifyFilterMask_val_ptr_ptr.
 
506
 *       <b>DO NOT</b> free the previous pointer.
 
507
 *       The MFD helper will release the memory you allocate.
 
508
 *
 
509
 * @remark If you call this function yourself, you are responsible
 
510
 *         for checking if the pointer changed, and freeing any
 
511
 *         previously allocated memory. (Not necessary if you pass
 
512
 *         in a pointer to static memory, obviously.)
 
513
 */
 
514
int
 
515
snmpNotifyFilterMask_get(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx,
 
516
                         char **snmpNotifyFilterMask_val_ptr_ptr,
 
517
                         size_t * snmpNotifyFilterMask_val_ptr_len_ptr)
 
518
{
 
519
   /** we should have a non-NULL pointer and enough storage */
 
520
    netsnmp_assert((NULL != snmpNotifyFilterMask_val_ptr_ptr)
 
521
                   && (NULL != *snmpNotifyFilterMask_val_ptr_ptr));
 
522
    netsnmp_assert(NULL != snmpNotifyFilterMask_val_ptr_len_ptr);
 
523
 
 
524
 
 
525
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterMask_get",
 
526
                "called\n"));
 
527
 
 
528
    netsnmp_assert(NULL != rowreq_ctx);
 
529
 
 
530
    /*
 
531
     * TODO:231:o: |-> Extract the current value of the snmpNotifyFilterMask data.
 
532
     * copy (* snmpNotifyFilterMask_val_ptr_ptr ) data and (* snmpNotifyFilterMask_val_ptr_len_ptr ) from rowreq_ctx->data
 
533
     */
 
534
    /*
 
535
     * make sure there is enough space for snmpNotifyFilterMask data
 
536
     */
 
537
    if ((NULL == (*snmpNotifyFilterMask_val_ptr_ptr)) ||
 
538
        ((*snmpNotifyFilterMask_val_ptr_len_ptr) <
 
539
         (rowreq_ctx->data.snmpNotifyFilterMask_len *
 
540
          sizeof(rowreq_ctx->data.snmpNotifyFilterMask[0])))) {
 
541
        /*
 
542
         * allocate space for snmpNotifyFilterMask data
 
543
         */
 
544
        (*snmpNotifyFilterMask_val_ptr_ptr) =
 
545
            malloc(rowreq_ctx->data.snmpNotifyFilterMask_len *
 
546
                   sizeof(rowreq_ctx->data.snmpNotifyFilterMask[0]));
 
547
        if (NULL == (*snmpNotifyFilterMask_val_ptr_ptr)) {
 
548
            snmp_log(LOG_ERR, "could not allocate memory\n");
 
549
            return MFD_ERROR;
 
550
        }
 
551
    }
 
552
    (*snmpNotifyFilterMask_val_ptr_len_ptr) =
 
553
        rowreq_ctx->data.snmpNotifyFilterMask_len *
 
554
        sizeof(rowreq_ctx->data.snmpNotifyFilterMask[0]);
 
555
    memcpy((*snmpNotifyFilterMask_val_ptr_ptr),
 
556
           rowreq_ctx->data.snmpNotifyFilterMask,
 
557
           rowreq_ctx->data.snmpNotifyFilterMask_len *
 
558
           sizeof(rowreq_ctx->data.snmpNotifyFilterMask[0]));
 
559
 
 
560
    return MFD_SUCCESS;
 
561
}                               /* snmpNotifyFilterMask_get */
 
562
 
 
563
/*---------------------------------------------------------------------
 
564
 * SNMP-NOTIFICATION-MIB::snmpNotifyFilterEntry.snmpNotifyFilterType
 
565
 * snmpNotifyFilterType is subid 3 of snmpNotifyFilterEntry.
 
566
 * Its status is Current, and its access level is Create.
 
567
 * OID: .1.3.6.1.6.3.13.1.3.1.3
 
568
 * Description:
 
569
This object indicates whether the family of filter subtrees
 
570
         defined by this entry are included in or excluded from a
 
571
         filter.  A more detailed discussion of the use of this
 
572
         object can be found in section 6. of [SNMP-APPL].
 
573
 *
 
574
 * Attributes:
 
575
 *   accessible 1     isscalar 0     enums  1      hasdefval 1
 
576
 *   readable   1     iscolumn 1     ranges 0      hashint   0
 
577
 *   settable   1
 
578
 *   defval: included
 
579
 *
 
580
 * Enum range: 2/8. Values:  included(1), excluded(2)
 
581
 *
 
582
 * Its syntax is INTEGER (based on perltype INTEGER)
 
583
 * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
 
584
 */
 
585
/**
 
586
 * Extract the current value of the snmpNotifyFilterType data.
 
587
 *
 
588
 * Set a value using the data context for the row.
 
589
 *
 
590
 * @param rowreq_ctx
 
591
 *        Pointer to the row request context.
 
592
 * @param snmpNotifyFilterType_val_ptr
 
593
 *        Pointer to storage for a long variable
 
594
 *
 
595
 * @retval MFD_SUCCESS         : success
 
596
 * @retval MFD_SKIP            : skip this node (no value for now)
 
597
 * @retval MFD_ERROR           : Any other error
 
598
 */
 
599
int
 
600
snmpNotifyFilterType_get(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx,
 
601
                         u_long * snmpNotifyFilterType_val_ptr)
 
602
{
 
603
   /** we should have a non-NULL pointer */
 
604
    netsnmp_assert(NULL != snmpNotifyFilterType_val_ptr);
 
605
 
 
606
 
 
607
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterType_get",
 
608
                "called\n"));
 
609
 
 
610
    netsnmp_assert(NULL != rowreq_ctx);
 
611
 
 
612
    /*
 
613
     * TODO:231:o: |-> Extract the current value of the snmpNotifyFilterType data.
 
614
     * copy (* snmpNotifyFilterType_val_ptr ) from rowreq_ctx->data
 
615
     */
 
616
    (*snmpNotifyFilterType_val_ptr) =
 
617
        rowreq_ctx->data.snmpNotifyFilterType;
 
618
 
 
619
    return MFD_SUCCESS;
 
620
}                               /* snmpNotifyFilterType_get */
 
621
 
 
622
/*---------------------------------------------------------------------
 
623
 * SNMP-NOTIFICATION-MIB::snmpNotifyFilterEntry.snmpNotifyFilterStorageType
 
624
 * snmpNotifyFilterStorageType is subid 4 of snmpNotifyFilterEntry.
 
625
 * Its status is Current, and its access level is Create.
 
626
 * OID: .1.3.6.1.6.3.13.1.3.1.4
 
627
 * Description:
 
628
The storage type for this conceptual row.
 
629
         Conceptual rows having the value 'permanent' need not
 
630
 
 
631
         allow write-access to any columnar objects in the row.
 
632
 *
 
633
 * Attributes:
 
634
 *   accessible 1     isscalar 0     enums  1      hasdefval 1
 
635
 *   readable   1     iscolumn 1     ranges 0      hashint   0
 
636
 *   settable   1
 
637
 *   defval: nonVolatile
 
638
 *
 
639
 * Enum range: 4/8. Values:  other(1), volatile(2), nonVolatile(3), permanent(4), readOnly(5)
 
640
 *
 
641
 * Its syntax is StorageType (based on perltype INTEGER)
 
642
 * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
 
643
 */
 
644
/**
 
645
 * Extract the current value of the snmpNotifyFilterStorageType data.
 
646
 *
 
647
 * Set a value using the data context for the row.
 
648
 *
 
649
 * @param rowreq_ctx
 
650
 *        Pointer to the row request context.
 
651
 * @param snmpNotifyFilterStorageType_val_ptr
 
652
 *        Pointer to storage for a long variable
 
653
 *
 
654
 * @retval MFD_SUCCESS         : success
 
655
 * @retval MFD_SKIP            : skip this node (no value for now)
 
656
 * @retval MFD_ERROR           : Any other error
 
657
 */
 
658
int
 
659
snmpNotifyFilterStorageType_get(snmpNotifyFilterTable_rowreq_ctx *
 
660
                                rowreq_ctx,
 
661
                                u_long *
 
662
                                snmpNotifyFilterStorageType_val_ptr)
 
663
{
 
664
   /** we should have a non-NULL pointer */
 
665
    netsnmp_assert(NULL != snmpNotifyFilterStorageType_val_ptr);
 
666
 
 
667
 
 
668
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterStorageType_get", "called\n"));
 
669
 
 
670
    netsnmp_assert(NULL != rowreq_ctx);
 
671
 
 
672
    /*
 
673
     * TODO:231:o: |-> Extract the current value of the snmpNotifyFilterStorageType data.
 
674
     * copy (* snmpNotifyFilterStorageType_val_ptr ) from rowreq_ctx->data
 
675
     */
 
676
    (*snmpNotifyFilterStorageType_val_ptr) =
 
677
        rowreq_ctx->data.snmpNotifyFilterStorageType;
 
678
 
 
679
    return MFD_SUCCESS;
 
680
}                               /* snmpNotifyFilterStorageType_get */
 
681
 
 
682
/*---------------------------------------------------------------------
 
683
 * SNMP-NOTIFICATION-MIB::snmpNotifyFilterEntry.snmpNotifyFilterRowStatus
 
684
 * snmpNotifyFilterRowStatus is subid 5 of snmpNotifyFilterEntry.
 
685
 * Its status is Current, and its access level is Create.
 
686
 * OID: .1.3.6.1.6.3.13.1.3.1.5
 
687
 * Description:
 
688
The status of this conceptual row.
 
689
 
 
690
         To create a row in this table, a manager must
 
691
         set this object to either createAndGo(4) or
 
692
         createAndWait(5).
 
693
 *
 
694
 * Attributes:
 
695
 *   accessible 1     isscalar 0     enums  1      hasdefval 0
 
696
 *   readable   1     iscolumn 1     ranges 0      hashint   0
 
697
 *   settable   1
 
698
 *
 
699
 * Enum range: 3/8. Values:  active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
 
700
 *
 
701
 * Its syntax is RowStatus (based on perltype INTEGER)
 
702
 * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
 
703
 */
 
704
/**
 
705
 * Extract the current value of the snmpNotifyFilterRowStatus data.
 
706
 *
 
707
 * Set a value using the data context for the row.
 
708
 *
 
709
 * @param rowreq_ctx
 
710
 *        Pointer to the row request context.
 
711
 * @param snmpNotifyFilterRowStatus_val_ptr
 
712
 *        Pointer to storage for a long variable
 
713
 *
 
714
 * @retval MFD_SUCCESS         : success
 
715
 * @retval MFD_SKIP            : skip this node (no value for now)
 
716
 * @retval MFD_ERROR           : Any other error
 
717
 */
 
718
int
 
719
snmpNotifyFilterRowStatus_get(snmpNotifyFilterTable_rowreq_ctx *
 
720
                              rowreq_ctx,
 
721
                              u_long * snmpNotifyFilterRowStatus_val_ptr)
 
722
{
 
723
   /** we should have a non-NULL pointer */
 
724
    netsnmp_assert(NULL != snmpNotifyFilterRowStatus_val_ptr);
 
725
 
 
726
    (*snmpNotifyFilterRowStatus_val_ptr) =
 
727
        rowreq_ctx->data.snmpNotifyFilterRowStatus;
 
728
 
 
729
    return MFD_SUCCESS;
 
730
}                               /* snmpNotifyFilterRowStatus_get */
 
731
 
 
732
 
 
733
 
 
734
/** @} */
 
735
/**********************************************************************
 
736
 **********************************************************************
 
737
 ***
 
738
 *** Table snmpNotifyFilterTable
 
739
 ***
 
740
 **********************************************************************
 
741
 **********************************************************************/
 
742
/*
 
743
 * SNMP-NOTIFICATION-MIB::snmpNotifyFilterTable is subid 3 of snmpNotifyObjects.
 
744
 * Its status is Current.
 
745
 * OID: .1.3.6.1.6.3.13.1.3, length: 9
 
746
 */
 
747
    /*
 
748
     * NOTE: if you update this chart, please update the versions in
 
749
     *       local/mib2c-conf.d/parent-set.m2i
 
750
     *       agent/mibgroup/helpers/baby_steps.c
 
751
     * while you're at it.
 
752
     */
 
753
    /*
 
754
     ***********************************************************************
 
755
     * Baby Steps Flow Chart (2004.06.05)                                  *
 
756
     *                                                                     *
 
757
     * +--------------+    +================+    U = unconditional path    *
 
758
     * |optional state|    ||required state||    S = path for success      *
 
759
     * +--------------+    +================+    E = path for error        *
 
760
     ***********************************************************************
 
761
     *
 
762
     *                        +--------------+
 
763
     *                        |     pre      |
 
764
     *                        |   request    |
 
765
     *                        +--------------+
 
766
     *                               | U
 
767
     * +-------------+        +==============+
 
768
     * |    row    |f|<-------||  object    ||
 
769
     * |  create   |1|      E ||  lookup    ||
 
770
     * +-------------+        +==============+
 
771
     *     E |   | S                 | S
 
772
     *       |   +------------------>|
 
773
     *       |                +==============+
 
774
     *       |              E ||   check    ||
 
775
     *       |<---------------||   values   ||
 
776
     *       |                +==============+
 
777
     *       |                       | S
 
778
     *       |                +==============+
 
779
     *       |       +<-------||   undo     ||
 
780
     *       |       |      E ||   setup    ||
 
781
     *       |       |        +==============+
 
782
     *       |       |               | S
 
783
     *       |       |        +==============+
 
784
     *       |       |        ||    set     ||-------------------------->+
 
785
     *       |       |        ||   value    || E                         |
 
786
     *       |       |        +==============+                           |
 
787
     *       |       |               | S                                 |
 
788
     *       |       |        +--------------+                           |
 
789
     *       |       |        |    check     |-------------------------->|
 
790
     *       |       |        |  consistency | E                         |
 
791
     *       |       |        +--------------+                           |
 
792
     *       |       |               | S                                 |
 
793
     *       |       |        +==============+         +==============+  |
 
794
     *       |       |        ||   commit   ||-------->||     undo   ||  |
 
795
     *       |       |        ||            || E       ||    commit  ||  |
 
796
     *       |       |        +==============+         +==============+  |
 
797
     *       |       |               | S                     U |<--------+
 
798
     *       |       |        +--------------+         +==============+
 
799
     *       |       |        | irreversible |         ||    undo    ||
 
800
     *       |       |        |    commit    |         ||     set    ||
 
801
     *       |       |        +--------------+         +==============+
 
802
     *       |       |               | U                     U |
 
803
     *       |       +-------------->|<------------------------+
 
804
     *       |                +==============+
 
805
     *       |                ||   undo     ||
 
806
     *       |                ||  cleanup   ||
 
807
     *       |                +==============+
 
808
     *       +---------------------->| U
 
809
     *                               |
 
810
     *                          (err && f1)------------------->+
 
811
     *                               |                         |
 
812
     *                        +--------------+         +--------------+
 
813
     *                        |    post      |<--------|      row     |
 
814
     *                        |   request    |       U |    release   |
 
815
     *                        +--------------+         +--------------+
 
816
     *
 
817
     */
 
818
 
 
819
/**
 
820
 * Setup up context with information needed to undo a set request.
 
821
 *
 
822
 * This function will be called before the individual node undo setup
 
823
 * functions are called. If you need to do any undo setup that is not
 
824
 * related to a specific column, you can do it here.
 
825
 *
 
826
 * Note that the undo context has been allocated with
 
827
 * snmpNotifyFilterTable_allocate_data(), but may need extra
 
828
 * initialization similar to what you may have done in
 
829
 * snmpNotifyFilterTable_rowreq_ctx_init().
 
830
 * Note that an individual node's undo_setup function will only be called
 
831
 * if that node is being set to a new value.
 
832
 *
 
833
 * If there is any setup specific to a particular column (e.g. allocating
 
834
 * memory for a string), you should do that setup in the node's undo_setup
 
835
 * function, so it won't be done unless it is necessary.
 
836
 *
 
837
 * @param rowreq_ctx
 
838
 *        Pointer to the table context (snmpNotifyFilterTable_rowreq_ctx)
 
839
 *
 
840
 * @retval MFD_SUCCESS : success
 
841
 * @retval MFD_ERROR   : error. set will fail.
 
842
 */
 
843
int
 
844
snmpNotifyFilterTable_undo_setup(snmpNotifyFilterTable_rowreq_ctx *
 
845
                                 rowreq_ctx)
 
846
{
 
847
    int             rc = MFD_SUCCESS;
 
848
 
 
849
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_undo_setup", "called\n"));
 
850
 
 
851
    /** we should have a non-NULL pointer */
 
852
    netsnmp_assert(NULL != rowreq_ctx);
 
853
 
 
854
    /*
 
855
     * TODO:451:M: |-> Setup snmpNotifyFilterTable undo.
 
856
     * set up snmpNotifyFilterTable undo information, in preparation for a set.
 
857
     * Undo storage is in (* snmpNotifyFilterRowStatus_val_ptr )*
 
858
     */
 
859
 
 
860
    return rc;
 
861
}                               /* snmpNotifyFilterTable_undo_setup */
 
862
 
 
863
/**
 
864
 * Undo a set request.
 
865
 *
 
866
 * This function will be called before the individual node undo
 
867
 * functions are called. If you need to do any undo that is not
 
868
 * related to a specific column, you can do it here.
 
869
 *
 
870
 * Note that an individual node's undo function will only be called
 
871
 * if that node is being set to a new value.
 
872
 *
 
873
 * If there is anything  specific to a particular column (e.g. releasing
 
874
 * memory for a string), you should do that setup in the node's undo
 
875
 * function, so it won't be done unless it is necessary.
 
876
 *
 
877
 * @param rowreq_ctx
 
878
 *        Pointer to the table context (snmpNotifyFilterTable_rowreq_ctx)
 
879
 *
 
880
 * @retval MFD_SUCCESS : success
 
881
 * @retval MFD_ERROR   : error. set will fail.
 
882
 */
 
883
int
 
884
snmpNotifyFilterTable_undo(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx)
 
885
{
 
886
    int             rc = MFD_SUCCESS;
 
887
 
 
888
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_undo",
 
889
                "called\n"));
 
890
 
 
891
    /** we should have a non-NULL pointer */
 
892
    netsnmp_assert(NULL != rowreq_ctx);
 
893
 
 
894
    /*
 
895
     * TODO:451:M: |-> snmpNotifyFilterTable undo.
 
896
     * snmpNotifyFilterTable undo information, in response to a failed set.
 
897
     * Undo storage is in (* snmpNotifyFilterRowStatus_val_ptr )*
 
898
     */
 
899
 
 
900
    return rc;
 
901
}                               /* snmpNotifyFilterTable_undo_setup */
 
902
 
 
903
/**
 
904
 * Cleanup up context undo information.
 
905
 *
 
906
 * This function will be called after set/commit processing. If you
 
907
 * allocated any resources in undo_setup, this is the place to release
 
908
 * those resources.
 
909
 *
 
910
 * This function is called regardless of the success or failure of the set
 
911
 * request. If you need to perform different steps for cleanup depending
 
912
 * on success or failure, you can add a flag to the rowreq_ctx.
 
913
 *
 
914
 * @param rowreq_ctx
 
915
 *        Pointer to the table context (snmpNotifyFilterTable_rowreq_ctx)
 
916
 *
 
917
 * @retval MFD_SUCCESS : success
 
918
 * @retval MFD_ERROR   : error
 
919
 */
 
920
int
 
921
snmpNotifyFilterTable_undo_cleanup(snmpNotifyFilterTable_rowreq_ctx *
 
922
                                   rowreq_ctx)
 
923
{
 
924
    int             rc = MFD_SUCCESS;
 
925
 
 
926
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_undo_cleanup", "called\n"));
 
927
 
 
928
    /** we should have a non-NULL pointer */
 
929
    netsnmp_assert(NULL != rowreq_ctx);
 
930
 
 
931
    /*
 
932
     * TODO:452:M: |-> Cleanup snmpNotifyFilterTable undo.
 
933
     * Undo storage is in (* snmpNotifyFilterRowStatus_val_ptr )*
 
934
     */
 
935
 
 
936
    return rc;
 
937
}                               /* snmpNotifyFilterTable_undo_cleanup */
 
938
 
 
939
/**
 
940
 * commit new values.
 
941
 *
 
942
 * At this point, you should have done everything you can to ensure that
 
943
 * this commit will not fail.
 
944
 *
 
945
 * Should you need different behavior depending on which columns were
 
946
 * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
 
947
 * set. The definitions for the COLUMN_*_FLAG bits can be found in
 
948
 * snmpNotifyFilterTable.h.
 
949
 * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
 
950
 *
 
951
 * @param rowreq_ctx
 
952
 *        Pointer to the users context.
 
953
 *
 
954
 * @retval MFD_SUCCESS : success
 
955
 * @retval MFD_ERROR   : error
 
956
 */
 
957
int
 
958
snmpNotifyFilterTable_commit(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx)
 
959
{
 
960
    int             rc = MFD_SUCCESS;
 
961
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_commit", "called\n"));
 
962
 
 
963
    /** we should have a non-NULL pointer */
 
964
    netsnmp_assert(NULL != rowreq_ctx);
 
965
 
 
966
    /*
 
967
     * commit snmpNotifyFilterTable data
 
968
     */
 
969
 
 
970
    /*
 
971
     * if we successfully commited this row, set the dirty flag.
 
972
     */
 
973
    rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
 
974
 
 
975
    return rc;
 
976
}                               /* snmpNotifyFilterTable_commit */
 
977
 
 
978
/**
 
979
 * undo commit new values.
 
980
 *
 
981
 * Should you need different behavior depending on which columns were
 
982
 * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
 
983
 * set. The definitions for the COLUMN_*_FLAG bits can be found in
 
984
 * snmpNotifyFilterTable.h.
 
985
 * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
 
986
 *
 
987
 * @param rowreq_ctx
 
988
 *        Pointer to the users context.
 
989
 *
 
990
 * @retval MFD_SUCCESS : success
 
991
 * @retval MFD_ERROR   : error
 
992
 */
 
993
int
 
994
snmpNotifyFilterTable_undo_commit(snmpNotifyFilterTable_rowreq_ctx *
 
995
                                  rowreq_ctx)
 
996
{
 
997
    int             rc = MFD_SUCCESS;
 
998
 
 
999
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_undo_commit", "called\n"));
 
1000
 
 
1001
    /** we should have a non-NULL pointer */
 
1002
    netsnmp_assert(NULL != rowreq_ctx);
 
1003
 
 
1004
    /*
 
1005
     * TODO:485:M: |-> Undo snmpNotifyFilterTable commit.
 
1006
     * check the column's flag in rowreq_ctx->column_set_flags to see
 
1007
     * if it was set during commit, then undo it.
 
1008
     *
 
1009
     * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
 
1010
     */
 
1011
 
 
1012
 
 
1013
    /*
 
1014
     * if we successfully un-commited this row, clear the dirty flag.
 
1015
     */
 
1016
    if (MFD_SUCCESS == rc) {
 
1017
        rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
 
1018
    }
 
1019
 
 
1020
    return rc;
 
1021
}                               /* snmpNotifyFilterTable_undo_commit */
 
1022
 
 
1023
/*
 
1024
 * TODO:440:M: Implement snmpNotifyFilterTable node value checks.
 
1025
 * TODO:450:M: Implement snmpNotifyFilterTable undo functions.
 
1026
 * TODO:460:M: Implement snmpNotifyFilterTable set functions.
 
1027
 * TODO:480:M: Implement snmpNotifyFilterTable commit functions.
 
1028
 */
 
1029
/*---------------------------------------------------------------------
 
1030
 * SNMP-NOTIFICATION-MIB::snmpNotifyFilterEntry.snmpNotifyFilterMask
 
1031
 * snmpNotifyFilterMask is subid 2 of snmpNotifyFilterEntry.
 
1032
 * Its status is Current, and its access level is Create.
 
1033
 * OID: .1.3.6.1.6.3.13.1.3.1.2
 
1034
 * Description:
 
1035
The bit mask which, in combination with the corresponding
 
1036
         instance of snmpNotifyFilterSubtree, defines a family of
 
1037
         subtrees which are included in or excluded from the
 
1038
         filter profile.
 
1039
 
 
1040
         Each bit of this bit mask corresponds to a
 
1041
         sub-identifier of snmpNotifyFilterSubtree, with the
 
1042
         most significant bit of the i-th octet of this octet
 
1043
         string value (extended if necessary, see below)
 
1044
         corresponding to the (8*i - 7)-th sub-identifier, and
 
1045
         the least significant bit of the i-th octet of this
 
1046
         octet string corresponding to the (8*i)-th
 
1047
         sub-identifier, where i is in the range 1 through 16.
 
1048
 
 
1049
         Each bit of this bit mask specifies whether or not
 
1050
         the corresponding sub-identifiers must match when
 
1051
         determining if an OBJECT IDENTIFIER matches this
 
1052
         family of filter subtrees; a '1' indicates that an
 
1053
         exact match must occur; a '0' indicates 'wild card',
 
1054
         i.e., any sub-identifier value matches.
 
1055
 
 
1056
         Thus, the OBJECT IDENTIFIER X of an object instance
 
1057
         is contained in a family of filter subtrees if, for
 
1058
         each sub-identifier of the value of
 
1059
         snmpNotifyFilterSubtree, either:
 
1060
 
 
1061
           the i-th bit of snmpNotifyFilterMask is 0, or
 
1062
 
 
1063
           the i-th sub-identifier of X is equal to the i-th
 
1064
           sub-identifier of the value of
 
1065
           snmpNotifyFilterSubtree.
 
1066
 
 
1067
         If the value of this bit mask is M bits long and
 
1068
         there are more than M sub-identifiers in the
 
1069
         corresponding instance of snmpNotifyFilterSubtree,
 
1070
         then the bit mask is extended with 1's to be the
 
1071
         required length.
 
1072
 
 
1073
         Note that when the value of this object is the
 
1074
         zero-length string, this extension rule results in
 
1075
         a mask of all-1's being used (i.e., no 'wild card'),
 
1076
         and the family of filter subtrees is the one
 
1077
         subtree uniquely identified by the corresponding
 
1078
         instance of snmpNotifyFilterSubtree.
 
1079
 *
 
1080
 * Attributes:
 
1081
 *   accessible 1     isscalar 0     enums  0      hasdefval 1
 
1082
 *   readable   1     iscolumn 1     ranges 1      hashint   0
 
1083
 *   settable   1
 
1084
 *   defval: 0
 
1085
 *
 
1086
 * Ranges:  0 - 16;
 
1087
 *
 
1088
 * Its syntax is OCTETSTR (based on perltype OCTETSTR)
 
1089
 * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
 
1090
 * This data type requires a length.  (Max 16)
 
1091
 */
 
1092
/**
 
1093
 * Check that the proposed new value is potentially valid.
 
1094
 *
 
1095
 * @param rowreq_ctx
 
1096
 *        Pointer to the row request context.
 
1097
 * @param snmpNotifyFilterMask_val_ptr
 
1098
 *        A char containing the new value.
 
1099
 * @param snmpNotifyFilterMask_val_ptr_len
 
1100
 *        The size (in bytes) of the data pointed to by snmpNotifyFilterMask_val_ptr
 
1101
 *
 
1102
 * @retval MFD_SUCCESS        : incoming value is legal
 
1103
 * @retval MFD_NOT_VALID_NOW  : incoming value is not valid now
 
1104
 * @retval MFD_NOT_VALID_EVER : incoming value is never valid
 
1105
 *
 
1106
 * This is the place to check for requirements that are not
 
1107
 * expressed in the mib syntax (for example, a requirement that
 
1108
 * is detailed in the description for an object).
 
1109
 *
 
1110
 * You should check that the requested change between the undo value and the
 
1111
 * new value is legal (ie, the transistion from one value to another
 
1112
 * is legal).
 
1113
 *      
 
1114
 *@note
 
1115
 * This check is only to determine if the new value
 
1116
 * is \b potentially valid. This is the first check of many, and
 
1117
 * is one of the simplest ones.
 
1118
 * 
 
1119
 *@note
 
1120
 * this is not the place to do any checks for values
 
1121
 * which depend on some other value in the mib. Those
 
1122
 * types of checks should be done in the
 
1123
 * snmpNotifyFilterTable_check_dependencies() function.
 
1124
 *
 
1125
 * The following checks have already been done for you:
 
1126
 *    The syntax is ASN_OCTET_STR
 
1127
 *    The length is < sizeof(rowreq_ctx->data.snmpNotifyFilterMask).
 
1128
 *    The length is in (one of) the range set(s):  0 - 16
 
1129
 *
 
1130
 * If there a no other checks you need to do, simply return MFD_SUCCESS.
 
1131
 *
 
1132
 */
 
1133
int
 
1134
snmpNotifyFilterMask_check_value(snmpNotifyFilterTable_rowreq_ctx *
 
1135
                                 rowreq_ctx,
 
1136
                                 char *snmpNotifyFilterMask_val_ptr,
 
1137
                                 size_t snmpNotifyFilterMask_val_ptr_len)
 
1138
{
 
1139
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterMask_check_value", "called\n"));
 
1140
 
 
1141
    /** should never get a NULL pointer */
 
1142
    netsnmp_assert(NULL != rowreq_ctx);
 
1143
    netsnmp_assert(NULL != snmpNotifyFilterMask_val_ptr);
 
1144
 
 
1145
    /*
 
1146
     * TODO:441:o: |-> Check for valid snmpNotifyFilterMask value.
 
1147
     */
 
1148
 
 
1149
    return MFD_SUCCESS;         /* snmpNotifyFilterMask value not illegal */
 
1150
}                               /* snmpNotifyFilterMask_check_value */
 
1151
 
 
1152
/**
 
1153
 * Save old value information
 
1154
 *
 
1155
 * @param rowreq_ctx
 
1156
 *        Pointer to the table context (snmpNotifyFilterTable_rowreq_ctx)
 
1157
 *
 
1158
 * @retval MFD_SUCCESS : success
 
1159
 * @retval MFD_ERROR   : error. set will fail.
 
1160
 *
 
1161
 * This function will be called after the table level undo setup function
 
1162
 * snmpNotifyFilterTable_undo_setup has been called.
 
1163
 *
 
1164
 *@note
 
1165
 * this function will only be called if a new value is set for this column.
 
1166
 *
 
1167
 * If there is any setup specific to a particular column (e.g. allocating
 
1168
 * memory for a string), you should do that setup in this function, so it
 
1169
 * won't be done unless it is necessary.
 
1170
 */
 
1171
int
 
1172
snmpNotifyFilterMask_undo_setup(snmpNotifyFilterTable_rowreq_ctx *
 
1173
                                rowreq_ctx)
 
1174
{
 
1175
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterMask_undo_setup", "called\n"));
 
1176
 
 
1177
    /** should never get a NULL pointer */
 
1178
    netsnmp_assert(NULL != rowreq_ctx);
 
1179
 
 
1180
    /*
 
1181
     * TODO:455:o: |-> Setup snmpNotifyFilterMask undo.
 
1182
     */
 
1183
    /*
 
1184
     * copy snmpNotifyFilterMask and snmpNotifyFilterMask_len data
 
1185
     * set rowreq_ctx->undo->snmpNotifyFilterMask from rowreq_ctx->data.snmpNotifyFilterMask
 
1186
     */
 
1187
    memcpy(rowreq_ctx->undo->snmpNotifyFilterMask,
 
1188
           rowreq_ctx->data.snmpNotifyFilterMask,
 
1189
           (rowreq_ctx->data.snmpNotifyFilterMask_len *
 
1190
            sizeof(rowreq_ctx->undo->snmpNotifyFilterMask[0])));
 
1191
    rowreq_ctx->undo->snmpNotifyFilterMask_len =
 
1192
        rowreq_ctx->data.snmpNotifyFilterMask_len;
 
1193
 
 
1194
 
 
1195
    return MFD_SUCCESS;
 
1196
}                               /* snmpNotifyFilterMask_undo_setup */
 
1197
 
 
1198
/**
 
1199
 * Set the new value.
 
1200
 *
 
1201
 * @param rowreq_ctx
 
1202
 *        Pointer to the users context. You should know how to
 
1203
 *        manipulate the value from this object.
 
1204
 * @param snmpNotifyFilterMask_val_ptr
 
1205
 *        A char containing the new value.
 
1206
 * @param snmpNotifyFilterMask_val_ptr_len
 
1207
 *        The size (in bytes) of the data pointed to by snmpNotifyFilterMask_val_ptr
 
1208
 */
 
1209
int
 
1210
snmpNotifyFilterMask_set(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx,
 
1211
                         char *snmpNotifyFilterMask_val_ptr,
 
1212
                         size_t snmpNotifyFilterMask_val_ptr_len)
 
1213
{
 
1214
 
 
1215
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterMask_set",
 
1216
                "called\n"));
 
1217
 
 
1218
    /** should never get a NULL pointer */
 
1219
    netsnmp_assert(NULL != rowreq_ctx);
 
1220
    netsnmp_assert(NULL != snmpNotifyFilterMask_val_ptr);
 
1221
 
 
1222
    /*
 
1223
     * TODO:461:M: |-> Set snmpNotifyFilterMask value.
 
1224
     * set snmpNotifyFilterMask value in rowreq_ctx->data
 
1225
     */
 
1226
    memcpy(rowreq_ctx->data.snmpNotifyFilterMask,
 
1227
           snmpNotifyFilterMask_val_ptr, snmpNotifyFilterMask_val_ptr_len);
 
1228
    /** convert bytes to number of char */
 
1229
    rowreq_ctx->data.snmpNotifyFilterMask_len =
 
1230
        snmpNotifyFilterMask_val_ptr_len /
 
1231
        sizeof(snmpNotifyFilterMask_val_ptr[0]);
 
1232
 
 
1233
    return MFD_SUCCESS;
 
1234
}                               /* snmpNotifyFilterMask_set */
 
1235
 
 
1236
/**
 
1237
 * undo the previous set.
 
1238
 *
 
1239
 * @param rowreq_ctx
 
1240
 *        Pointer to the users context.
 
1241
 */
 
1242
int
 
1243
snmpNotifyFilterMask_undo(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx)
 
1244
{
 
1245
 
 
1246
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterMask_undo",
 
1247
                "called\n"));
 
1248
 
 
1249
    netsnmp_assert(NULL != rowreq_ctx);
 
1250
 
 
1251
    /*
 
1252
     * TODO:456:o: |-> Clean up snmpNotifyFilterMask undo.
 
1253
     */
 
1254
    /*
 
1255
     * copy snmpNotifyFilterMask and snmpNotifyFilterMask_len data
 
1256
     * set rowreq_ctx->data.snmpNotifyFilterMask from rowreq_ctx->undo->snmpNotifyFilterMask
 
1257
     */
 
1258
    memcpy(rowreq_ctx->data.snmpNotifyFilterMask,
 
1259
           rowreq_ctx->undo->snmpNotifyFilterMask,
 
1260
           (rowreq_ctx->undo->snmpNotifyFilterMask_len *
 
1261
            sizeof(rowreq_ctx->data.snmpNotifyFilterMask[0])));
 
1262
    rowreq_ctx->data.snmpNotifyFilterMask_len =
 
1263
        rowreq_ctx->undo->snmpNotifyFilterMask_len;
 
1264
 
 
1265
 
 
1266
    return MFD_SUCCESS;
 
1267
}                               /* snmpNotifyFilterMask_undo */
 
1268
 
 
1269
/*---------------------------------------------------------------------
 
1270
 * SNMP-NOTIFICATION-MIB::snmpNotifyFilterEntry.snmpNotifyFilterType
 
1271
 * snmpNotifyFilterType is subid 3 of snmpNotifyFilterEntry.
 
1272
 * Its status is Current, and its access level is Create.
 
1273
 * OID: .1.3.6.1.6.3.13.1.3.1.3
 
1274
 * Description:
 
1275
This object indicates whether the family of filter subtrees
 
1276
         defined by this entry are included in or excluded from a
 
1277
         filter.  A more detailed discussion of the use of this
 
1278
         object can be found in section 6. of [SNMP-APPL].
 
1279
 *
 
1280
 * Attributes:
 
1281
 *   accessible 1     isscalar 0     enums  1      hasdefval 1
 
1282
 *   readable   1     iscolumn 1     ranges 0      hashint   0
 
1283
 *   settable   1
 
1284
 *   defval: included
 
1285
 *
 
1286
 * Enum range: 2/8. Values:  included(1), excluded(2)
 
1287
 *
 
1288
 * Its syntax is INTEGER (based on perltype INTEGER)
 
1289
 * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
 
1290
 */
 
1291
/**
 
1292
 * Check that the proposed new value is potentially valid.
 
1293
 *
 
1294
 * @param rowreq_ctx
 
1295
 *        Pointer to the row request context.
 
1296
 * @param snmpNotifyFilterType_val
 
1297
 *        A long containing the new value.
 
1298
 *
 
1299
 * @retval MFD_SUCCESS        : incoming value is legal
 
1300
 * @retval MFD_NOT_VALID_NOW  : incoming value is not valid now
 
1301
 * @retval MFD_NOT_VALID_EVER : incoming value is never valid
 
1302
 *
 
1303
 * This is the place to check for requirements that are not
 
1304
 * expressed in the mib syntax (for example, a requirement that
 
1305
 * is detailed in the description for an object).
 
1306
 *
 
1307
 * You should check that the requested change between the undo value and the
 
1308
 * new value is legal (ie, the transistion from one value to another
 
1309
 * is legal).
 
1310
 *      
 
1311
 *@note
 
1312
 * This check is only to determine if the new value
 
1313
 * is \b potentially valid. This is the first check of many, and
 
1314
 * is one of the simplest ones.
 
1315
 * 
 
1316
 *@note
 
1317
 * this is not the place to do any checks for values
 
1318
 * which depend on some other value in the mib. Those
 
1319
 * types of checks should be done in the
 
1320
 * snmpNotifyFilterTable_check_dependencies() function.
 
1321
 *
 
1322
 * The following checks have already been done for you:
 
1323
 *    The syntax is ASN_INTEGER
 
1324
 *    The value is one of  included(1), excluded(2)
 
1325
 *
 
1326
 * If there a no other checks you need to do, simply return MFD_SUCCESS.
 
1327
 *
 
1328
 */
 
1329
int
 
1330
snmpNotifyFilterType_check_value(snmpNotifyFilterTable_rowreq_ctx *
 
1331
                                 rowreq_ctx,
 
1332
                                 u_long snmpNotifyFilterType_val)
 
1333
{
 
1334
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterType_check_value", "called\n"));
 
1335
 
 
1336
    /** should never get a NULL pointer */
 
1337
    netsnmp_assert(NULL != rowreq_ctx);
 
1338
 
 
1339
    /*
 
1340
     * TODO:441:o: |-> Check for valid snmpNotifyFilterType value.
 
1341
     */
 
1342
 
 
1343
    return MFD_SUCCESS;         /* snmpNotifyFilterType value not illegal */
 
1344
}                               /* snmpNotifyFilterType_check_value */
 
1345
 
 
1346
/**
 
1347
 * Save old value information
 
1348
 *
 
1349
 * @param rowreq_ctx
 
1350
 *        Pointer to the table context (snmpNotifyFilterTable_rowreq_ctx)
 
1351
 *
 
1352
 * @retval MFD_SUCCESS : success
 
1353
 * @retval MFD_ERROR   : error. set will fail.
 
1354
 *
 
1355
 * This function will be called after the table level undo setup function
 
1356
 * snmpNotifyFilterTable_undo_setup has been called.
 
1357
 *
 
1358
 *@note
 
1359
 * this function will only be called if a new value is set for this column.
 
1360
 *
 
1361
 * If there is any setup specific to a particular column (e.g. allocating
 
1362
 * memory for a string), you should do that setup in this function, so it
 
1363
 * won't be done unless it is necessary.
 
1364
 */
 
1365
int
 
1366
snmpNotifyFilterType_undo_setup(snmpNotifyFilterTable_rowreq_ctx *
 
1367
                                rowreq_ctx)
 
1368
{
 
1369
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterType_undo_setup", "called\n"));
 
1370
 
 
1371
    /** should never get a NULL pointer */
 
1372
    netsnmp_assert(NULL != rowreq_ctx);
 
1373
 
 
1374
    /*
 
1375
     * TODO:455:o: |-> Setup snmpNotifyFilterType undo.
 
1376
     */
 
1377
    /*
 
1378
     * copy snmpNotifyFilterType data
 
1379
     * set rowreq_ctx->undo->snmpNotifyFilterType from rowreq_ctx->data.snmpNotifyFilterType
 
1380
     */
 
1381
    rowreq_ctx->undo->snmpNotifyFilterType =
 
1382
        rowreq_ctx->data.snmpNotifyFilterType;
 
1383
 
 
1384
 
 
1385
    return MFD_SUCCESS;
 
1386
}                               /* snmpNotifyFilterType_undo_setup */
 
1387
 
 
1388
/**
 
1389
 * Set the new value.
 
1390
 *
 
1391
 * @param rowreq_ctx
 
1392
 *        Pointer to the users context. You should know how to
 
1393
 *        manipulate the value from this object.
 
1394
 * @param snmpNotifyFilterType_val
 
1395
 *        A long containing the new value.
 
1396
 */
 
1397
int
 
1398
snmpNotifyFilterType_set(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx,
 
1399
                         u_long snmpNotifyFilterType_val)
 
1400
{
 
1401
 
 
1402
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterType_set",
 
1403
                "called\n"));
 
1404
 
 
1405
    /** should never get a NULL pointer */
 
1406
    netsnmp_assert(NULL != rowreq_ctx);
 
1407
 
 
1408
    /*
 
1409
     * TODO:461:M: |-> Set snmpNotifyFilterType value.
 
1410
     * set snmpNotifyFilterType value in rowreq_ctx->data
 
1411
     */
 
1412
    rowreq_ctx->data.snmpNotifyFilterType = snmpNotifyFilterType_val;
 
1413
 
 
1414
    return MFD_SUCCESS;
 
1415
}                               /* snmpNotifyFilterType_set */
 
1416
 
 
1417
/**
 
1418
 * undo the previous set.
 
1419
 *
 
1420
 * @param rowreq_ctx
 
1421
 *        Pointer to the users context.
 
1422
 */
 
1423
int
 
1424
snmpNotifyFilterType_undo(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx)
 
1425
{
 
1426
 
 
1427
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterType_undo",
 
1428
                "called\n"));
 
1429
 
 
1430
    netsnmp_assert(NULL != rowreq_ctx);
 
1431
 
 
1432
    /*
 
1433
     * TODO:456:o: |-> Clean up snmpNotifyFilterType undo.
 
1434
     */
 
1435
    /*
 
1436
     * copy snmpNotifyFilterType data
 
1437
     * set rowreq_ctx->data.snmpNotifyFilterType from rowreq_ctx->undo->snmpNotifyFilterType
 
1438
     */
 
1439
    rowreq_ctx->data.snmpNotifyFilterType =
 
1440
        rowreq_ctx->undo->snmpNotifyFilterType;
 
1441
 
 
1442
 
 
1443
    return MFD_SUCCESS;
 
1444
}                               /* snmpNotifyFilterType_undo */
 
1445
 
 
1446
/*---------------------------------------------------------------------
 
1447
 * SNMP-NOTIFICATION-MIB::snmpNotifyFilterEntry.snmpNotifyFilterStorageType
 
1448
 * snmpNotifyFilterStorageType is subid 4 of snmpNotifyFilterEntry.
 
1449
 * Its status is Current, and its access level is Create.
 
1450
 * OID: .1.3.6.1.6.3.13.1.3.1.4
 
1451
 * Description:
 
1452
The storage type for this conceptual row.
 
1453
         Conceptual rows having the value 'permanent' need not
 
1454
 
 
1455
         allow write-access to any columnar objects in the row.
 
1456
 *
 
1457
 * Attributes:
 
1458
 *   accessible 1     isscalar 0     enums  1      hasdefval 1
 
1459
 *   readable   1     iscolumn 1     ranges 0      hashint   0
 
1460
 *   settable   1
 
1461
 *   defval: nonVolatile
 
1462
 *
 
1463
 * Enum range: 4/8. Values:  other(1), volatile(2), nonVolatile(3), permanent(4), readOnly(5)
 
1464
 *
 
1465
 * Its syntax is StorageType (based on perltype INTEGER)
 
1466
 * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
 
1467
 */
 
1468
/**
 
1469
 * Check that the proposed new value is potentially valid.
 
1470
 *
 
1471
 * @param rowreq_ctx
 
1472
 *        Pointer to the row request context.
 
1473
 * @param snmpNotifyFilterStorageType_val
 
1474
 *        A long containing the new value.
 
1475
 *
 
1476
 * @retval MFD_SUCCESS        : incoming value is legal
 
1477
 * @retval MFD_NOT_VALID_NOW  : incoming value is not valid now
 
1478
 * @retval MFD_NOT_VALID_EVER : incoming value is never valid
 
1479
 *
 
1480
 * This is the place to check for requirements that are not
 
1481
 * expressed in the mib syntax (for example, a requirement that
 
1482
 * is detailed in the description for an object).
 
1483
 *
 
1484
 * You should check that the requested change between the undo value and the
 
1485
 * new value is legal (ie, the transistion from one value to another
 
1486
 * is legal).
 
1487
 *      
 
1488
 *@note
 
1489
 * This check is only to determine if the new value
 
1490
 * is \b potentially valid. This is the first check of many, and
 
1491
 * is one of the simplest ones.
 
1492
 * 
 
1493
 *@note
 
1494
 * this is not the place to do any checks for values
 
1495
 * which depend on some other value in the mib. Those
 
1496
 * types of checks should be done in the
 
1497
 * snmpNotifyFilterTable_check_dependencies() function.
 
1498
 *
 
1499
 * The following checks have already been done for you:
 
1500
 *    The syntax is ASN_INTEGER
 
1501
 *    The value is one of  other(1), volatile(2), nonVolatile(3), permanent(4), readOnly(5)
 
1502
 *
 
1503
 * If there a no other checks you need to do, simply return MFD_SUCCESS.
 
1504
 *
 
1505
 */
 
1506
int
 
1507
snmpNotifyFilterStorageType_check_value(snmpNotifyFilterTable_rowreq_ctx *
 
1508
                                        rowreq_ctx,
 
1509
                                        u_long
 
1510
                                        snmpNotifyFilterStorageType_val)
 
1511
{
 
1512
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterStorageType_check_value", "called\n"));
 
1513
 
 
1514
    /** should never get a NULL pointer */
 
1515
    netsnmp_assert(NULL != rowreq_ctx);
 
1516
 
 
1517
    /*
 
1518
     * TODO:441:o: |-> Check for valid snmpNotifyFilterStorageType value.
 
1519
     */
 
1520
 
 
1521
    return MFD_SUCCESS;         /* snmpNotifyFilterStorageType value not illegal */
 
1522
}                               /* snmpNotifyFilterStorageType_check_value */
 
1523
 
 
1524
/**
 
1525
 * Save old value information
 
1526
 *
 
1527
 * @param rowreq_ctx
 
1528
 *        Pointer to the table context (snmpNotifyFilterTable_rowreq_ctx)
 
1529
 *
 
1530
 * @retval MFD_SUCCESS : success
 
1531
 * @retval MFD_ERROR   : error. set will fail.
 
1532
 *
 
1533
 * This function will be called after the table level undo setup function
 
1534
 * snmpNotifyFilterTable_undo_setup has been called.
 
1535
 *
 
1536
 *@note
 
1537
 * this function will only be called if a new value is set for this column.
 
1538
 *
 
1539
 * If there is any setup specific to a particular column (e.g. allocating
 
1540
 * memory for a string), you should do that setup in this function, so it
 
1541
 * won't be done unless it is necessary.
 
1542
 */
 
1543
int
 
1544
snmpNotifyFilterStorageType_undo_setup(snmpNotifyFilterTable_rowreq_ctx *
 
1545
                                       rowreq_ctx)
 
1546
{
 
1547
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterStorageType_undo_setup", "called\n"));
 
1548
 
 
1549
    /** should never get a NULL pointer */
 
1550
    netsnmp_assert(NULL != rowreq_ctx);
 
1551
 
 
1552
    /*
 
1553
     * TODO:455:o: |-> Setup snmpNotifyFilterStorageType undo.
 
1554
     */
 
1555
    /*
 
1556
     * copy snmpNotifyFilterStorageType data
 
1557
     * set rowreq_ctx->undo->snmpNotifyFilterStorageType from rowreq_ctx->data.snmpNotifyFilterStorageType
 
1558
     */
 
1559
    rowreq_ctx->undo->snmpNotifyFilterStorageType =
 
1560
        rowreq_ctx->data.snmpNotifyFilterStorageType;
 
1561
 
 
1562
 
 
1563
    return MFD_SUCCESS;
 
1564
}                               /* snmpNotifyFilterStorageType_undo_setup */
 
1565
 
 
1566
/**
 
1567
 * Set the new value.
 
1568
 *
 
1569
 * @param rowreq_ctx
 
1570
 *        Pointer to the users context. You should know how to
 
1571
 *        manipulate the value from this object.
 
1572
 * @param snmpNotifyFilterStorageType_val
 
1573
 *        A long containing the new value.
 
1574
 */
 
1575
int
 
1576
snmpNotifyFilterStorageType_set(snmpNotifyFilterTable_rowreq_ctx *
 
1577
                                rowreq_ctx,
 
1578
                                u_long snmpNotifyFilterStorageType_val)
 
1579
{
 
1580
 
 
1581
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterStorageType_set", "called\n"));
 
1582
 
 
1583
    /** should never get a NULL pointer */
 
1584
    netsnmp_assert(NULL != rowreq_ctx);
 
1585
 
 
1586
    /*
 
1587
     * TODO:461:M: |-> Set snmpNotifyFilterStorageType value.
 
1588
     * set snmpNotifyFilterStorageType value in rowreq_ctx->data
 
1589
     */
 
1590
    rowreq_ctx->data.snmpNotifyFilterStorageType =
 
1591
        snmpNotifyFilterStorageType_val;
 
1592
 
 
1593
    return MFD_SUCCESS;
 
1594
}                               /* snmpNotifyFilterStorageType_set */
 
1595
 
 
1596
/**
 
1597
 * undo the previous set.
 
1598
 *
 
1599
 * @param rowreq_ctx
 
1600
 *        Pointer to the users context.
 
1601
 */
 
1602
int
 
1603
snmpNotifyFilterStorageType_undo(snmpNotifyFilterTable_rowreq_ctx *
 
1604
                                 rowreq_ctx)
 
1605
{
 
1606
 
 
1607
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterStorageType_undo", "called\n"));
 
1608
 
 
1609
    netsnmp_assert(NULL != rowreq_ctx);
 
1610
 
 
1611
    /*
 
1612
     * TODO:456:o: |-> Clean up snmpNotifyFilterStorageType undo.
 
1613
     */
 
1614
    /*
 
1615
     * copy snmpNotifyFilterStorageType data
 
1616
     * set rowreq_ctx->data.snmpNotifyFilterStorageType from rowreq_ctx->undo->snmpNotifyFilterStorageType
 
1617
     */
 
1618
    rowreq_ctx->data.snmpNotifyFilterStorageType =
 
1619
        rowreq_ctx->undo->snmpNotifyFilterStorageType;
 
1620
 
 
1621
 
 
1622
    return MFD_SUCCESS;
 
1623
}                               /* snmpNotifyFilterStorageType_undo */
 
1624
 
 
1625
/*---------------------------------------------------------------------
 
1626
 * SNMP-NOTIFICATION-MIB::snmpNotifyFilterEntry.snmpNotifyFilterRowStatus
 
1627
 * snmpNotifyFilterRowStatus is subid 5 of snmpNotifyFilterEntry.
 
1628
 * Its status is Current, and its access level is Create.
 
1629
 * OID: .1.3.6.1.6.3.13.1.3.1.5
 
1630
 * Description:
 
1631
The status of this conceptual row.
 
1632
 
 
1633
         To create a row in this table, a manager must
 
1634
         set this object to either createAndGo(4) or
 
1635
         createAndWait(5).
 
1636
 *
 
1637
 * Attributes:
 
1638
 *   accessible 1     isscalar 0     enums  1      hasdefval 0
 
1639
 *   readable   1     iscolumn 1     ranges 0      hashint   0
 
1640
 *   settable   1
 
1641
 *
 
1642
 * Enum range: 3/8. Values:  active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
 
1643
 *
 
1644
 * Its syntax is RowStatus (based on perltype INTEGER)
 
1645
 * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
 
1646
 */
 
1647
/**
 
1648
 * Check that the proposed new value is potentially valid.
 
1649
 *
 
1650
 * @param rowreq_ctx
 
1651
 *        Pointer to the row request context.
 
1652
 * @param snmpNotifyFilterRowStatus_val
 
1653
 *        A long containing the new value.
 
1654
 *
 
1655
 * @retval MFD_SUCCESS        : incoming value is legal
 
1656
 * @retval MFD_NOT_VALID_NOW  : incoming value is not valid now
 
1657
 * @retval MFD_NOT_VALID_EVER : incoming value is never valid
 
1658
 *
 
1659
 * This is the place to check for requirements that are not
 
1660
 * expressed in the mib syntax (for example, a requirement that
 
1661
 * is detailed in the description for an object).
 
1662
 *
 
1663
 * You should check that the requested change between the undo value and the
 
1664
 * new value is legal (ie, the transistion from one value to another
 
1665
 * is legal).
 
1666
 *      
 
1667
 *@note
 
1668
 * This check is only to determine if the new value
 
1669
 * is \b potentially valid. This is the first check of many, and
 
1670
 * is one of the simplest ones.
 
1671
 * 
 
1672
 *@note
 
1673
 * this is not the place to do any checks for values
 
1674
 * which depend on some other value in the mib. Those
 
1675
 * types of checks should be done in the
 
1676
 * snmpNotifyFilterTable_check_dependencies() function.
 
1677
 *
 
1678
 * The following checks have already been done for you:
 
1679
 *    The syntax is ASN_INTEGER
 
1680
 *    The value is one of  active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
 
1681
 *
 
1682
 * If there a no other checks you need to do, simply return MFD_SUCCESS.
 
1683
 *
 
1684
 */
 
1685
int
 
1686
snmpNotifyFilterRowStatus_check_value(snmpNotifyFilterTable_rowreq_ctx *
 
1687
                                      rowreq_ctx,
 
1688
                                      u_long snmpNotifyFilterRowStatus_val)
 
1689
{
 
1690
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterRowStatus_check_value", "called\n"));
 
1691
 
 
1692
    /** should never get a NULL pointer */
 
1693
    netsnmp_assert(NULL != rowreq_ctx);
 
1694
 
 
1695
    /*
 
1696
     * TODO:441:o: |-> Check for valid snmpNotifyFilterRowStatus value.
 
1697
     */
 
1698
 
 
1699
    return MFD_SUCCESS;         /* snmpNotifyFilterRowStatus value not illegal */
 
1700
}                               /* snmpNotifyFilterRowStatus_check_value */
 
1701
 
 
1702
/**
 
1703
 * Save old value information
 
1704
 *
 
1705
 * @param rowreq_ctx
 
1706
 *        Pointer to the table context (snmpNotifyFilterTable_rowreq_ctx)
 
1707
 *
 
1708
 * @retval MFD_SUCCESS : success
 
1709
 * @retval MFD_ERROR   : error. set will fail.
 
1710
 *
 
1711
 * This function will be called after the table level undo setup function
 
1712
 * snmpNotifyFilterTable_undo_setup has been called.
 
1713
 *
 
1714
 *@note
 
1715
 * this function will only be called if a new value is set for this column.
 
1716
 *
 
1717
 * If there is any setup specific to a particular column (e.g. allocating
 
1718
 * memory for a string), you should do that setup in this function, so it
 
1719
 * won't be done unless it is necessary.
 
1720
 */
 
1721
int
 
1722
snmpNotifyFilterRowStatus_undo_setup(snmpNotifyFilterTable_rowreq_ctx *
 
1723
                                     rowreq_ctx)
 
1724
{
 
1725
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterRowStatus_undo_setup", "called\n"));
 
1726
 
 
1727
    /** should never get a NULL pointer */
 
1728
    netsnmp_assert(NULL != rowreq_ctx);
 
1729
 
 
1730
    /*
 
1731
     * TODO:455:o: |-> Setup snmpNotifyFilterRowStatus undo.
 
1732
     */
 
1733
    /*
 
1734
     * copy snmpNotifyFilterRowStatus data
 
1735
     * set rowreq_ctx->undo->snmpNotifyFilterRowStatus from rowreq_ctx->data.snmpNotifyFilterRowStatus
 
1736
     */
 
1737
    rowreq_ctx->undo->snmpNotifyFilterRowStatus =
 
1738
        rowreq_ctx->data.snmpNotifyFilterRowStatus;
 
1739
 
 
1740
 
 
1741
    return MFD_SUCCESS;
 
1742
}                               /* snmpNotifyFilterRowStatus_undo_setup */
 
1743
 
 
1744
/**
 
1745
 * Set the new value.
 
1746
 *
 
1747
 * @param rowreq_ctx
 
1748
 *        Pointer to the users context. You should know how to
 
1749
 *        manipulate the value from this object.
 
1750
 * @param snmpNotifyFilterRowStatus_val
 
1751
 *        A long containing the new value.
 
1752
 */
 
1753
int
 
1754
snmpNotifyFilterRowStatus_set(snmpNotifyFilterTable_rowreq_ctx *
 
1755
                              rowreq_ctx,
 
1756
                              u_long snmpNotifyFilterRowStatus_val)
 
1757
{
 
1758
 
 
1759
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterRowStatus_set", "called\n"));
 
1760
 
 
1761
    /** should never get a NULL pointer */
 
1762
    netsnmp_assert(NULL != rowreq_ctx);
 
1763
 
 
1764
    /*
 
1765
     * TODO:461:M: |-> Set snmpNotifyFilterRowStatus value.
 
1766
     * set snmpNotifyFilterRowStatus value in rowreq_ctx->data
 
1767
     */
 
1768
    rowreq_ctx->data.snmpNotifyFilterRowStatus =
 
1769
        snmpNotifyFilterRowStatus_val;
 
1770
 
 
1771
    return MFD_SUCCESS;
 
1772
}                               /* snmpNotifyFilterRowStatus_set */
 
1773
 
 
1774
/**
 
1775
 * undo the previous set.
 
1776
 *
 
1777
 * @param rowreq_ctx
 
1778
 *        Pointer to the users context.
 
1779
 */
 
1780
int
 
1781
snmpNotifyFilterRowStatus_undo(snmpNotifyFilterTable_rowreq_ctx *
 
1782
                               rowreq_ctx)
 
1783
{
 
1784
 
 
1785
    DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterRowStatus_undo", "called\n"));
 
1786
 
 
1787
    netsnmp_assert(NULL != rowreq_ctx);
 
1788
 
 
1789
    /*
 
1790
     * TODO:456:o: |-> Clean up snmpNotifyFilterRowStatus undo.
 
1791
     */
 
1792
    /*
 
1793
     * copy snmpNotifyFilterRowStatus data
 
1794
     * set rowreq_ctx->data.snmpNotifyFilterRowStatus from rowreq_ctx->undo->snmpNotifyFilterRowStatus
 
1795
     */
 
1796
    rowreq_ctx->data.snmpNotifyFilterRowStatus =
 
1797
        rowreq_ctx->undo->snmpNotifyFilterRowStatus;
 
1798
 
 
1799
 
 
1800
    return MFD_SUCCESS;
 
1801
}                               /* snmpNotifyFilterRowStatus_undo */
 
1802
 
 
1803
/**
 
1804
 * check dependencies
 
1805
 *
 
1806
 * This is useful for for tables which have dependencies between columns
 
1807
 * (or rows, or tables). For example, two columns allocating a percentage
 
1808
 * of something add up 100%.
 
1809
 *
 
1810
 * Should you need different behavior depending on which columns were
 
1811
 * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
 
1812
 * set. The definitions for the COLUMN_*_FLAG bits can be found in
 
1813
 * snmpNotifyFilterTable.h.
 
1814
 * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
 
1815
 *
 
1816
 * @retval MFD_SUCCESS all the changes to the row are legal
 
1817
 * @retval MFD_ERROR   one or more changes are not legal
 
1818
 *
 
1819
 * (see README-table-snmpNotifyFilterTable if you don't have dependencies)
 
1820
 */
 
1821
int
 
1822
snmpNotifyFilterTable_check_dependencies(snmpNotifyFilterTable_rowreq_ctx *
 
1823
                                         rowreq_ctx)
 
1824
{
 
1825
    int             rc = MFD_SUCCESS;
 
1826
 
 
1827
    DEBUGMSGTL(("internal:snmpNotifyFilterTable:snmpNotifyFilterTable_check_dependencies", "called\n"));
 
1828
 
 
1829
    netsnmp_assert(NULL != rowreq_ctx);
 
1830
 
 
1831
    /*
 
1832
     * TODO:470:o: Check snmpNotifyFilterTable row dependencies.
 
1833
     * check that all new value are legal and consistent with each other
 
1834
     */
 
1835
    /*
 
1836
     * check for valid StorageType transition (old, new)
 
1837
     */
 
1838
    rc = check_storage_transition(rowreq_ctx->undo->
 
1839
                                  snmpNotifyFilterStorageType,
 
1840
                                  rowreq_ctx->data.
 
1841
                                  snmpNotifyFilterStorageType);
 
1842
    if (MFD_SUCCESS != rc)
 
1843
        return rc;
 
1844
 
 
1845
    /*
 
1846
     * check RowStatus dependencies
 
1847
     */
 
1848
    if (rowreq_ctx->
 
1849
        column_set_flags & COLUMN_SNMPNOTIFYFILTERROWSTATUS_FLAG) {
 
1850
        /*
 
1851
         * check for valid RowStatus transition (old, new)
 
1852
         * (Note: move transition check to 
 
1853
         *  to catch errors earlier)
 
1854
         */
 
1855
        rc = check_rowstatus_transition(rowreq_ctx->undo->
 
1856
                                        snmpNotifyFilterRowStatus,
 
1857
                                        rowreq_ctx->data.
 
1858
                                        snmpNotifyFilterRowStatus);
 
1859
        if (MFD_SUCCESS != rc)
 
1860
            return rc;
 
1861
 
 
1862
        /*
 
1863
         * row creation requirements
 
1864
         */
 
1865
        if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
 
1866
            if (ROWSTATUS_DESTROY ==
 
1867
                rowreq_ctx->data.snmpNotifyFilterRowStatus) {
 
1868
                rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
 
1869
            } else if (ROWSTATUS_CREATEANDGO ==
 
1870
                       rowreq_ctx->data.snmpNotifyFilterRowStatus) {
 
1871
                if ((rowreq_ctx->
 
1872
                     column_set_flags &
 
1873
                     SNMPNOTIFYFILTERTABLE_REQUIRED_COLS)
 
1874
                    != SNMPNOTIFYFILTERTABLE_REQUIRED_COLS) {
 
1875
                    DEBUGMSGTL(("snmpNotifyFilterTable",
 
1876
                                "required columns missing (0x%0x != 0x%0x)\n",
 
1877
                                rowreq_ctx->column_set_flags,
 
1878
                                SNMPNOTIFYFILTERTABLE_REQUIRED_COLS));
 
1879
                    return MFD_CANNOT_CREATE_NOW;
 
1880
                }
 
1881
                rowreq_ctx->data.snmpNotifyFilterRowStatus =
 
1882
                    ROWSTATUS_ACTIVE;
 
1883
            }
 
1884
        } /* row creation */
 
1885
        else {
 
1886
            /*
 
1887
             * row change requirements
 
1888
             */
 
1889
            /*
 
1890
             * don't allow a destroy if any other value was changed, since
 
1891
             * that might call data access routines with bad info.
 
1892
             *
 
1893
             * you may or may not require the row be notInService before it
 
1894
             * can be destroyed.
 
1895
             */
 
1896
            if (ROWSTATUS_DESTROY ==
 
1897
                rowreq_ctx->data.snmpNotifyFilterRowStatus) {
 
1898
                if (rowreq_ctx->
 
1899
                    column_set_flags &
 
1900
                    ~COLUMN_SNMPNOTIFYFILTERROWSTATUS_FLAG) {
 
1901
                    DEBUGMSGTL(("snmpNotifyFilterTable",
 
1902
                                "destroy must be only varbind for row\n"));
 
1903
                    return MFD_NOT_VALID_NOW;
 
1904
                }
 
1905
                rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
 
1906
 
 
1907
            }                   /* row destroy */
 
1908
        }                       /* row change */
 
1909
    } else {
 
1910
        /*
 
1911
         * must have row status to create a row
 
1912
         */
 
1913
        if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
 
1914
            DEBUGMSGTL(("snmpNotifyFilterTable",
 
1915
                        "must use RowStatus to create rows\n"));
 
1916
            return MFD_CANNOT_CREATE_NOW;
 
1917
        }
 
1918
    }                           /* row status not set */
 
1919
 
 
1920
    if (MFD_SUCCESS != rc)
 
1921
        return rc;
 
1922
 
 
1923
    return rc;
 
1924
}                               /* snmpNotifyFilterTable_check_dependencies */
 
1925
 
 
1926
/** @} */
 
1927
/** @{ */