2
* Note: this file originally auto-generated by mib2c using
3
* version : 1.48 $ of : mfd-top.m2c,v $
5
* $Id: snmpNotifyFilterTable.c,v 1.2.2.1 2006/01/25 16:26:39 dts12 Exp $
7
/** \page MFD helper for snmpNotifyFilterTable
9
* \section intro Introduction
14
* standard Net-SNMP includes
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>
21
* include our parent header
23
#include "snmpNotifyFilterTable.h"
25
#include <net-snmp/agent/mib_modules.h>
27
#include "snmpNotifyFilterTable_interface.h"
29
oid snmpNotifyFilterTable_oid[] =
30
{ SNMPNOTIFYFILTERTABLE_OID };
31
int snmpNotifyFilterTable_oid_size =
32
OID_LENGTH(snmpNotifyFilterTable_oid);
34
snmpNotifyFilterTable_registration snmpNotifyFilterTable_user_context;
36
void initialize_table_snmpNotifyFilterTable(void);
37
void shutdown_table_snmpNotifyFilterTable(void);
41
* Initializes the snmpNotifyFilterTable module
44
init_snmpNotifyFilterTable(void)
46
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:init_snmpNotifyFilterTable",
50
* TODO:300:o: Perform snmpNotifyFilterTable one-time module initialization.
54
* here we initialize all the tables we're planning on supporting
56
if (should_init("snmpNotifyFilterTable"))
57
initialize_table_snmpNotifyFilterTable();
59
} /* init_snmpNotifyFilterTable */
62
* Shut-down the snmpNotifyFilterTable module (agent is exiting)
65
shutdown_snmpNotifyFilterTable(void)
67
if (should_init("snmpNotifyFilterTable"))
68
shutdown_table_snmpNotifyFilterTable();
73
* Initialize the table snmpNotifyFilterTable
74
* (Define its contents and how it's structured)
77
initialize_table_snmpNotifyFilterTable(void)
79
snmpNotifyFilterTable_registration *user_context;
82
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:initialize_table_snmpNotifyFilterTable", "called\n"));
85
* TODO:301:o: Perform snmpNotifyFilterTable one-time table initialization.
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.
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.
98
netsnmp_create_data_list("snmpNotifyFilterTable", NULL, NULL);
101
* No support for any flags yet, but in the future you would
102
* set any flags here.
107
* call interface initialization code
109
_snmpNotifyFilterTable_initialize_interface(user_context, flags);
110
} /* initialize_table_snmpNotifyFilterTable */
113
* Shutdown the table snmpNotifyFilterTable
116
shutdown_table_snmpNotifyFilterTable(void)
119
* call interface shutdown code
121
_snmpNotifyFilterTable_shutdown_interface
122
(&snmpNotifyFilterTable_user_context);
126
* extra context initialization (eg default values)
128
* @param rowreq_ctx : row request context
129
* @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
131
* @retval MFD_SUCCESS : no errors
132
* @retval MFD_ERROR : error (context allocate will fail)
135
snmpNotifyFilterTable_rowreq_ctx_init(snmpNotifyFilterTable_rowreq_ctx *
136
rowreq_ctx, void *user_init_ctx)
138
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_rowreq_ctx_init", "called\n"));
140
netsnmp_assert(NULL != rowreq_ctx);
143
* TODO:210:o: |-> Perform extra snmpNotifyFilterTable rowreq initialization. (eg DEFVALS)
146
* strings and oids are hard to handle automagically.
147
* so all we've got for you is a hint:
149
* memcpy(rowreq_ctx->data.snmpNotifyFilterMask, 0,
150
* len(0) * sizeof(snmpNotifyFilterMask[0]);
153
rowreq_ctx->data.snmpNotifyFilterType = SNMPNOTIFYFILTERTYPE_INCLUDED;
155
rowreq_ctx->data.snmpNotifyFilterStorageType = STORAGETYPE_NONVOLATILE;
159
} /* snmpNotifyFilterTable_rowreq_ctx_init */
162
* extra context cleanup
166
snmpNotifyFilterTable_rowreq_ctx_cleanup(snmpNotifyFilterTable_rowreq_ctx *
169
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_rowreq_ctx_cleanup", "called\n"));
171
netsnmp_assert(NULL != rowreq_ctx);
174
* TODO:211:o: |-> Perform extra snmpNotifyFilterTable rowreq cleanup.
176
} /* snmpNotifyFilterTable_rowreq_ctx_cleanup */
178
/************************************************************
179
* the *_should_save routine is called to determine if a row
180
* should be stored persistently.
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
186
* @retval 1 if the row should be stored
187
* @retval 0 if the row should not be stored
205
snmpNotifyFilterTable_container_should_save
206
(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx) {
207
if (SNMP_STORAGE_VOLATILE ==
208
rowreq_ctx->data.snmpNotifyFilterStorageType)
211
return 1; /* save the row */
215
* pre-request callback
217
* @param user_context
218
* @retval MFD_SUCCESS : success.
219
* @retval MFD_ERROR : other error
222
snmpNotifyFilterTable_pre_request(snmpNotifyFilterTable_registration *
225
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_pre_request", "called\n"));
228
* TODO:510:o: Perform snmpNotifyFilterTable pre-request actions.
232
} /* snmpNotifyFilterTable_pre_request */
235
* post-request callback
238
* New rows have been inserted into the container, and
239
* deleted rows have been removed from the container and
241
* @param user_context
242
* @param rc : MFD_SUCCESS if all requests succeeded
244
* @retval MFD_SUCCESS : success.
245
* @retval MFD_ERROR : other error (ignored)
248
snmpNotifyFilterTable_post_request(snmpNotifyFilterTable_registration *
249
user_context, int rc)
251
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_post_request", "called\n"));
254
* TODO:511:o: Perform snmpNotifyFilterTable post-request actions.
258
* check to set if any rows were changed.
260
if (snmpNotifyFilterTable_dirty_get()) {
262
* check if request was successful. If so, this would be
263
* a good place to save data to its persistent store.
265
if (MFD_SUCCESS == rc) {
267
* save changed rows, if you haven't already
269
snmp_store(netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
270
NETSNMP_DS_LIB_APPTYPE));
273
snmpNotifyFilterTable_dirty_set(0); /* clear table dirty flag */
277
} /* snmpNotifyFilterTable_post_request */
280
/**********************************************************************
281
**********************************************************************
283
*** Table snmpNotifyFilterTable
285
**********************************************************************
286
**********************************************************************/
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
294
* ---------------------------------------------------------------------
295
* * TODO:200:r: Implement snmpNotifyFilterTable data context functions.
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
308
* @retval MFD_SUCCESS : success.
309
* @retval MFD_ERROR : other error.
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.
317
snmpNotifyFilterTable_indexes_set_tbl_idx(snmpNotifyFilterTable_mib_index *
319
*snmpNotifyFilterProfileName_val_ptr,
321
snmpNotifyFilterProfileName_val_ptr_len,
323
snmpNotifyFilterSubtree_val_ptr,
325
snmpNotifyFilterSubtree_val_ptr_len)
327
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_indexes_set_tbl_idx", "called\n"));
330
* snmpNotifyFilterProfileName(1)/SnmpAdminString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
332
tbl_idx->snmpNotifyFilterProfileName_len = sizeof(tbl_idx->snmpNotifyFilterProfileName) / sizeof(tbl_idx->snmpNotifyFilterProfileName[0]); /* max length */
334
* make sure there is enough space for snmpNotifyFilterProfileName data
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");
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]));
350
* snmpNotifyFilterSubtree(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/a/w/e/r/d/h
352
tbl_idx->snmpNotifyFilterSubtree_len = sizeof(tbl_idx->snmpNotifyFilterSubtree) / sizeof(tbl_idx->snmpNotifyFilterSubtree[0]); /* max length */
354
* make sure there is enough space for snmpNotifyFilterSubtree data
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");
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]));
371
} /* snmpNotifyFilterTable_indexes_set_tbl_idx */
375
* set row context indexes
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
383
* @retval MFD_SUCCESS : success.
384
* @retval MFD_ERROR : other error.
387
* This function sets the mib indexs, then updates the oid indexs
388
* from the mib index.
391
snmpNotifyFilterTable_indexes_set(snmpNotifyFilterTable_rowreq_ctx *
393
*snmpNotifyFilterProfileName_val_ptr,
395
snmpNotifyFilterProfileName_val_ptr_len,
396
oid * snmpNotifyFilterSubtree_val_ptr,
398
snmpNotifyFilterSubtree_val_ptr_len)
400
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_indexes_set", "called\n"));
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))
411
* convert mib index to oid index
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)) {
420
} /* snmpNotifyFilterTable_indexes_set */
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
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
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.
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.
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:
455
the i-th bit of snmpNotifyFilterMask is 0, or
457
the i-th sub-identifier of X is equal to the i-th
458
sub-identifier of the value of
459
snmpNotifyFilterSubtree.
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
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.
475
* accessible 1 isscalar 0 enums 0 hasdefval 1
476
* readable 1 iscolumn 1 ranges 1 hashint 0
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)
487
* Extract the current value of the snmpNotifyFilterMask data.
489
* Set a value using the data context for the row.
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).
500
* @retval MFD_SUCCESS : success
501
* @retval MFD_SKIP : skip this node (no value for now)
502
* @retval MFD_ERROR : Any other error
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.
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.)
515
snmpNotifyFilterMask_get(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx,
516
char **snmpNotifyFilterMask_val_ptr_ptr,
517
size_t * snmpNotifyFilterMask_val_ptr_len_ptr)
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);
525
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterMask_get",
528
netsnmp_assert(NULL != rowreq_ctx);
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
535
* make sure there is enough space for snmpNotifyFilterMask data
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])))) {
542
* allocate space for snmpNotifyFilterMask data
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");
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]));
561
} /* snmpNotifyFilterMask_get */
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
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].
575
* accessible 1 isscalar 0 enums 1 hasdefval 1
576
* readable 1 iscolumn 1 ranges 0 hashint 0
580
* Enum range: 2/8. Values: included(1), excluded(2)
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)
586
* Extract the current value of the snmpNotifyFilterType data.
588
* Set a value using the data context for the row.
591
* Pointer to the row request context.
592
* @param snmpNotifyFilterType_val_ptr
593
* Pointer to storage for a long variable
595
* @retval MFD_SUCCESS : success
596
* @retval MFD_SKIP : skip this node (no value for now)
597
* @retval MFD_ERROR : Any other error
600
snmpNotifyFilterType_get(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx,
601
u_long * snmpNotifyFilterType_val_ptr)
603
/** we should have a non-NULL pointer */
604
netsnmp_assert(NULL != snmpNotifyFilterType_val_ptr);
607
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterType_get",
610
netsnmp_assert(NULL != rowreq_ctx);
613
* TODO:231:o: |-> Extract the current value of the snmpNotifyFilterType data.
614
* copy (* snmpNotifyFilterType_val_ptr ) from rowreq_ctx->data
616
(*snmpNotifyFilterType_val_ptr) =
617
rowreq_ctx->data.snmpNotifyFilterType;
620
} /* snmpNotifyFilterType_get */
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
628
The storage type for this conceptual row.
629
Conceptual rows having the value 'permanent' need not
631
allow write-access to any columnar objects in the row.
634
* accessible 1 isscalar 0 enums 1 hasdefval 1
635
* readable 1 iscolumn 1 ranges 0 hashint 0
637
* defval: nonVolatile
639
* Enum range: 4/8. Values: other(1), volatile(2), nonVolatile(3), permanent(4), readOnly(5)
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)
645
* Extract the current value of the snmpNotifyFilterStorageType data.
647
* Set a value using the data context for the row.
650
* Pointer to the row request context.
651
* @param snmpNotifyFilterStorageType_val_ptr
652
* Pointer to storage for a long variable
654
* @retval MFD_SUCCESS : success
655
* @retval MFD_SKIP : skip this node (no value for now)
656
* @retval MFD_ERROR : Any other error
659
snmpNotifyFilterStorageType_get(snmpNotifyFilterTable_rowreq_ctx *
662
snmpNotifyFilterStorageType_val_ptr)
664
/** we should have a non-NULL pointer */
665
netsnmp_assert(NULL != snmpNotifyFilterStorageType_val_ptr);
668
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterStorageType_get", "called\n"));
670
netsnmp_assert(NULL != rowreq_ctx);
673
* TODO:231:o: |-> Extract the current value of the snmpNotifyFilterStorageType data.
674
* copy (* snmpNotifyFilterStorageType_val_ptr ) from rowreq_ctx->data
676
(*snmpNotifyFilterStorageType_val_ptr) =
677
rowreq_ctx->data.snmpNotifyFilterStorageType;
680
} /* snmpNotifyFilterStorageType_get */
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
688
The status of this conceptual row.
690
To create a row in this table, a manager must
691
set this object to either createAndGo(4) or
695
* accessible 1 isscalar 0 enums 1 hasdefval 0
696
* readable 1 iscolumn 1 ranges 0 hashint 0
699
* Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
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)
705
* Extract the current value of the snmpNotifyFilterRowStatus data.
707
* Set a value using the data context for the row.
710
* Pointer to the row request context.
711
* @param snmpNotifyFilterRowStatus_val_ptr
712
* Pointer to storage for a long variable
714
* @retval MFD_SUCCESS : success
715
* @retval MFD_SKIP : skip this node (no value for now)
716
* @retval MFD_ERROR : Any other error
719
snmpNotifyFilterRowStatus_get(snmpNotifyFilterTable_rowreq_ctx *
721
u_long * snmpNotifyFilterRowStatus_val_ptr)
723
/** we should have a non-NULL pointer */
724
netsnmp_assert(NULL != snmpNotifyFilterRowStatus_val_ptr);
726
(*snmpNotifyFilterRowStatus_val_ptr) =
727
rowreq_ctx->data.snmpNotifyFilterRowStatus;
730
} /* snmpNotifyFilterRowStatus_get */
735
/**********************************************************************
736
**********************************************************************
738
*** Table snmpNotifyFilterTable
740
**********************************************************************
741
**********************************************************************/
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
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.
754
***********************************************************************
755
* Baby Steps Flow Chart (2004.06.05) *
757
* +--------------+ +================+ U = unconditional path *
758
* |optional state| ||required state|| S = path for success *
759
* +--------------+ +================+ E = path for error *
760
***********************************************************************
767
* +-------------+ +==============+
768
* | row |f|<-------|| object ||
769
* | create |1| E || lookup ||
770
* +-------------+ +==============+
772
* | +------------------>|
775
* |<---------------|| values ||
779
* | +<-------|| undo ||
781
* | | +==============+
783
* | | +==============+
784
* | | || set ||-------------------------->+
785
* | | || value || E |
786
* | | +==============+ |
788
* | | +--------------+ |
789
* | | | check |-------------------------->|
790
* | | | consistency | E |
791
* | | +--------------+ |
793
* | | +==============+ +==============+ |
794
* | | || commit ||-------->|| undo || |
795
* | | || || E || commit || |
796
* | | +==============+ +==============+ |
797
* | | | S U |<--------+
798
* | | +--------------+ +==============+
799
* | | | irreversible | || undo ||
800
* | | | commit | || set ||
801
* | | +--------------+ +==============+
803
* | +-------------->|<------------------------+
808
* +---------------------->| U
810
* (err && f1)------------------->+
812
* +--------------+ +--------------+
813
* | post |<--------| row |
814
* | request | U | release |
815
* +--------------+ +--------------+
820
* Setup up context with information needed to undo a set request.
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.
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.
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.
838
* Pointer to the table context (snmpNotifyFilterTable_rowreq_ctx)
840
* @retval MFD_SUCCESS : success
841
* @retval MFD_ERROR : error. set will fail.
844
snmpNotifyFilterTable_undo_setup(snmpNotifyFilterTable_rowreq_ctx *
847
int rc = MFD_SUCCESS;
849
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_undo_setup", "called\n"));
851
/** we should have a non-NULL pointer */
852
netsnmp_assert(NULL != rowreq_ctx);
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 )*
861
} /* snmpNotifyFilterTable_undo_setup */
864
* Undo a set request.
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.
870
* Note that an individual node's undo function will only be called
871
* if that node is being set to a new value.
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.
878
* Pointer to the table context (snmpNotifyFilterTable_rowreq_ctx)
880
* @retval MFD_SUCCESS : success
881
* @retval MFD_ERROR : error. set will fail.
884
snmpNotifyFilterTable_undo(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx)
886
int rc = MFD_SUCCESS;
888
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_undo",
891
/** we should have a non-NULL pointer */
892
netsnmp_assert(NULL != rowreq_ctx);
895
* TODO:451:M: |-> snmpNotifyFilterTable undo.
896
* snmpNotifyFilterTable undo information, in response to a failed set.
897
* Undo storage is in (* snmpNotifyFilterRowStatus_val_ptr )*
901
} /* snmpNotifyFilterTable_undo_setup */
904
* Cleanup up context undo information.
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
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.
915
* Pointer to the table context (snmpNotifyFilterTable_rowreq_ctx)
917
* @retval MFD_SUCCESS : success
918
* @retval MFD_ERROR : error
921
snmpNotifyFilterTable_undo_cleanup(snmpNotifyFilterTable_rowreq_ctx *
924
int rc = MFD_SUCCESS;
926
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_undo_cleanup", "called\n"));
928
/** we should have a non-NULL pointer */
929
netsnmp_assert(NULL != rowreq_ctx);
932
* TODO:452:M: |-> Cleanup snmpNotifyFilterTable undo.
933
* Undo storage is in (* snmpNotifyFilterRowStatus_val_ptr )*
937
} /* snmpNotifyFilterTable_undo_cleanup */
942
* At this point, you should have done everything you can to ensure that
943
* this commit will not fail.
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.
952
* Pointer to the users context.
954
* @retval MFD_SUCCESS : success
955
* @retval MFD_ERROR : error
958
snmpNotifyFilterTable_commit(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx)
960
int rc = MFD_SUCCESS;
961
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_commit", "called\n"));
963
/** we should have a non-NULL pointer */
964
netsnmp_assert(NULL != rowreq_ctx);
967
* commit snmpNotifyFilterTable data
971
* if we successfully commited this row, set the dirty flag.
973
rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
976
} /* snmpNotifyFilterTable_commit */
979
* undo commit new values.
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.
988
* Pointer to the users context.
990
* @retval MFD_SUCCESS : success
991
* @retval MFD_ERROR : error
994
snmpNotifyFilterTable_undo_commit(snmpNotifyFilterTable_rowreq_ctx *
997
int rc = MFD_SUCCESS;
999
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_undo_commit", "called\n"));
1001
/** we should have a non-NULL pointer */
1002
netsnmp_assert(NULL != rowreq_ctx);
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.
1009
* eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
1014
* if we successfully un-commited this row, clear the dirty flag.
1016
if (MFD_SUCCESS == rc) {
1017
rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
1021
} /* snmpNotifyFilterTable_undo_commit */
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.
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
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
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.
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.
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:
1061
the i-th bit of snmpNotifyFilterMask is 0, or
1063
the i-th sub-identifier of X is equal to the i-th
1064
sub-identifier of the value of
1065
snmpNotifyFilterSubtree.
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
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.
1081
* accessible 1 isscalar 0 enums 0 hasdefval 1
1082
* readable 1 iscolumn 1 ranges 1 hashint 0
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)
1093
* Check that the proposed new value is potentially valid.
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
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
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).
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
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.
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.
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
1130
* If there a no other checks you need to do, simply return MFD_SUCCESS.
1134
snmpNotifyFilterMask_check_value(snmpNotifyFilterTable_rowreq_ctx *
1136
char *snmpNotifyFilterMask_val_ptr,
1137
size_t snmpNotifyFilterMask_val_ptr_len)
1139
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterMask_check_value", "called\n"));
1141
/** should never get a NULL pointer */
1142
netsnmp_assert(NULL != rowreq_ctx);
1143
netsnmp_assert(NULL != snmpNotifyFilterMask_val_ptr);
1146
* TODO:441:o: |-> Check for valid snmpNotifyFilterMask value.
1149
return MFD_SUCCESS; /* snmpNotifyFilterMask value not illegal */
1150
} /* snmpNotifyFilterMask_check_value */
1153
* Save old value information
1156
* Pointer to the table context (snmpNotifyFilterTable_rowreq_ctx)
1158
* @retval MFD_SUCCESS : success
1159
* @retval MFD_ERROR : error. set will fail.
1161
* This function will be called after the table level undo setup function
1162
* snmpNotifyFilterTable_undo_setup has been called.
1165
* this function will only be called if a new value is set for this column.
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.
1172
snmpNotifyFilterMask_undo_setup(snmpNotifyFilterTable_rowreq_ctx *
1175
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterMask_undo_setup", "called\n"));
1177
/** should never get a NULL pointer */
1178
netsnmp_assert(NULL != rowreq_ctx);
1181
* TODO:455:o: |-> Setup snmpNotifyFilterMask undo.
1184
* copy snmpNotifyFilterMask and snmpNotifyFilterMask_len data
1185
* set rowreq_ctx->undo->snmpNotifyFilterMask from rowreq_ctx->data.snmpNotifyFilterMask
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;
1196
} /* snmpNotifyFilterMask_undo_setup */
1199
* Set the new value.
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
1210
snmpNotifyFilterMask_set(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx,
1211
char *snmpNotifyFilterMask_val_ptr,
1212
size_t snmpNotifyFilterMask_val_ptr_len)
1215
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterMask_set",
1218
/** should never get a NULL pointer */
1219
netsnmp_assert(NULL != rowreq_ctx);
1220
netsnmp_assert(NULL != snmpNotifyFilterMask_val_ptr);
1223
* TODO:461:M: |-> Set snmpNotifyFilterMask value.
1224
* set snmpNotifyFilterMask value in rowreq_ctx->data
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]);
1234
} /* snmpNotifyFilterMask_set */
1237
* undo the previous set.
1240
* Pointer to the users context.
1243
snmpNotifyFilterMask_undo(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx)
1246
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterMask_undo",
1249
netsnmp_assert(NULL != rowreq_ctx);
1252
* TODO:456:o: |-> Clean up snmpNotifyFilterMask undo.
1255
* copy snmpNotifyFilterMask and snmpNotifyFilterMask_len data
1256
* set rowreq_ctx->data.snmpNotifyFilterMask from rowreq_ctx->undo->snmpNotifyFilterMask
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;
1267
} /* snmpNotifyFilterMask_undo */
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
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].
1281
* accessible 1 isscalar 0 enums 1 hasdefval 1
1282
* readable 1 iscolumn 1 ranges 0 hashint 0
1286
* Enum range: 2/8. Values: included(1), excluded(2)
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)
1292
* Check that the proposed new value is potentially valid.
1295
* Pointer to the row request context.
1296
* @param snmpNotifyFilterType_val
1297
* A long containing the new value.
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
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).
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
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.
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.
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)
1326
* If there a no other checks you need to do, simply return MFD_SUCCESS.
1330
snmpNotifyFilterType_check_value(snmpNotifyFilterTable_rowreq_ctx *
1332
u_long snmpNotifyFilterType_val)
1334
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterType_check_value", "called\n"));
1336
/** should never get a NULL pointer */
1337
netsnmp_assert(NULL != rowreq_ctx);
1340
* TODO:441:o: |-> Check for valid snmpNotifyFilterType value.
1343
return MFD_SUCCESS; /* snmpNotifyFilterType value not illegal */
1344
} /* snmpNotifyFilterType_check_value */
1347
* Save old value information
1350
* Pointer to the table context (snmpNotifyFilterTable_rowreq_ctx)
1352
* @retval MFD_SUCCESS : success
1353
* @retval MFD_ERROR : error. set will fail.
1355
* This function will be called after the table level undo setup function
1356
* snmpNotifyFilterTable_undo_setup has been called.
1359
* this function will only be called if a new value is set for this column.
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.
1366
snmpNotifyFilterType_undo_setup(snmpNotifyFilterTable_rowreq_ctx *
1369
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterType_undo_setup", "called\n"));
1371
/** should never get a NULL pointer */
1372
netsnmp_assert(NULL != rowreq_ctx);
1375
* TODO:455:o: |-> Setup snmpNotifyFilterType undo.
1378
* copy snmpNotifyFilterType data
1379
* set rowreq_ctx->undo->snmpNotifyFilterType from rowreq_ctx->data.snmpNotifyFilterType
1381
rowreq_ctx->undo->snmpNotifyFilterType =
1382
rowreq_ctx->data.snmpNotifyFilterType;
1386
} /* snmpNotifyFilterType_undo_setup */
1389
* Set the new value.
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.
1398
snmpNotifyFilterType_set(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx,
1399
u_long snmpNotifyFilterType_val)
1402
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterType_set",
1405
/** should never get a NULL pointer */
1406
netsnmp_assert(NULL != rowreq_ctx);
1409
* TODO:461:M: |-> Set snmpNotifyFilterType value.
1410
* set snmpNotifyFilterType value in rowreq_ctx->data
1412
rowreq_ctx->data.snmpNotifyFilterType = snmpNotifyFilterType_val;
1415
} /* snmpNotifyFilterType_set */
1418
* undo the previous set.
1421
* Pointer to the users context.
1424
snmpNotifyFilterType_undo(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx)
1427
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterType_undo",
1430
netsnmp_assert(NULL != rowreq_ctx);
1433
* TODO:456:o: |-> Clean up snmpNotifyFilterType undo.
1436
* copy snmpNotifyFilterType data
1437
* set rowreq_ctx->data.snmpNotifyFilterType from rowreq_ctx->undo->snmpNotifyFilterType
1439
rowreq_ctx->data.snmpNotifyFilterType =
1440
rowreq_ctx->undo->snmpNotifyFilterType;
1444
} /* snmpNotifyFilterType_undo */
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
1452
The storage type for this conceptual row.
1453
Conceptual rows having the value 'permanent' need not
1455
allow write-access to any columnar objects in the row.
1458
* accessible 1 isscalar 0 enums 1 hasdefval 1
1459
* readable 1 iscolumn 1 ranges 0 hashint 0
1461
* defval: nonVolatile
1463
* Enum range: 4/8. Values: other(1), volatile(2), nonVolatile(3), permanent(4), readOnly(5)
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)
1469
* Check that the proposed new value is potentially valid.
1472
* Pointer to the row request context.
1473
* @param snmpNotifyFilterStorageType_val
1474
* A long containing the new value.
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
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).
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
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.
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.
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)
1503
* If there a no other checks you need to do, simply return MFD_SUCCESS.
1507
snmpNotifyFilterStorageType_check_value(snmpNotifyFilterTable_rowreq_ctx *
1510
snmpNotifyFilterStorageType_val)
1512
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterStorageType_check_value", "called\n"));
1514
/** should never get a NULL pointer */
1515
netsnmp_assert(NULL != rowreq_ctx);
1518
* TODO:441:o: |-> Check for valid snmpNotifyFilterStorageType value.
1521
return MFD_SUCCESS; /* snmpNotifyFilterStorageType value not illegal */
1522
} /* snmpNotifyFilterStorageType_check_value */
1525
* Save old value information
1528
* Pointer to the table context (snmpNotifyFilterTable_rowreq_ctx)
1530
* @retval MFD_SUCCESS : success
1531
* @retval MFD_ERROR : error. set will fail.
1533
* This function will be called after the table level undo setup function
1534
* snmpNotifyFilterTable_undo_setup has been called.
1537
* this function will only be called if a new value is set for this column.
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.
1544
snmpNotifyFilterStorageType_undo_setup(snmpNotifyFilterTable_rowreq_ctx *
1547
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterStorageType_undo_setup", "called\n"));
1549
/** should never get a NULL pointer */
1550
netsnmp_assert(NULL != rowreq_ctx);
1553
* TODO:455:o: |-> Setup snmpNotifyFilterStorageType undo.
1556
* copy snmpNotifyFilterStorageType data
1557
* set rowreq_ctx->undo->snmpNotifyFilterStorageType from rowreq_ctx->data.snmpNotifyFilterStorageType
1559
rowreq_ctx->undo->snmpNotifyFilterStorageType =
1560
rowreq_ctx->data.snmpNotifyFilterStorageType;
1564
} /* snmpNotifyFilterStorageType_undo_setup */
1567
* Set the new value.
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.
1576
snmpNotifyFilterStorageType_set(snmpNotifyFilterTable_rowreq_ctx *
1578
u_long snmpNotifyFilterStorageType_val)
1581
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterStorageType_set", "called\n"));
1583
/** should never get a NULL pointer */
1584
netsnmp_assert(NULL != rowreq_ctx);
1587
* TODO:461:M: |-> Set snmpNotifyFilterStorageType value.
1588
* set snmpNotifyFilterStorageType value in rowreq_ctx->data
1590
rowreq_ctx->data.snmpNotifyFilterStorageType =
1591
snmpNotifyFilterStorageType_val;
1594
} /* snmpNotifyFilterStorageType_set */
1597
* undo the previous set.
1600
* Pointer to the users context.
1603
snmpNotifyFilterStorageType_undo(snmpNotifyFilterTable_rowreq_ctx *
1607
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterStorageType_undo", "called\n"));
1609
netsnmp_assert(NULL != rowreq_ctx);
1612
* TODO:456:o: |-> Clean up snmpNotifyFilterStorageType undo.
1615
* copy snmpNotifyFilterStorageType data
1616
* set rowreq_ctx->data.snmpNotifyFilterStorageType from rowreq_ctx->undo->snmpNotifyFilterStorageType
1618
rowreq_ctx->data.snmpNotifyFilterStorageType =
1619
rowreq_ctx->undo->snmpNotifyFilterStorageType;
1623
} /* snmpNotifyFilterStorageType_undo */
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
1631
The status of this conceptual row.
1633
To create a row in this table, a manager must
1634
set this object to either createAndGo(4) or
1638
* accessible 1 isscalar 0 enums 1 hasdefval 0
1639
* readable 1 iscolumn 1 ranges 0 hashint 0
1642
* Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
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)
1648
* Check that the proposed new value is potentially valid.
1651
* Pointer to the row request context.
1652
* @param snmpNotifyFilterRowStatus_val
1653
* A long containing the new value.
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
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).
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
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.
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.
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)
1682
* If there a no other checks you need to do, simply return MFD_SUCCESS.
1686
snmpNotifyFilterRowStatus_check_value(snmpNotifyFilterTable_rowreq_ctx *
1688
u_long snmpNotifyFilterRowStatus_val)
1690
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterRowStatus_check_value", "called\n"));
1692
/** should never get a NULL pointer */
1693
netsnmp_assert(NULL != rowreq_ctx);
1696
* TODO:441:o: |-> Check for valid snmpNotifyFilterRowStatus value.
1699
return MFD_SUCCESS; /* snmpNotifyFilterRowStatus value not illegal */
1700
} /* snmpNotifyFilterRowStatus_check_value */
1703
* Save old value information
1706
* Pointer to the table context (snmpNotifyFilterTable_rowreq_ctx)
1708
* @retval MFD_SUCCESS : success
1709
* @retval MFD_ERROR : error. set will fail.
1711
* This function will be called after the table level undo setup function
1712
* snmpNotifyFilterTable_undo_setup has been called.
1715
* this function will only be called if a new value is set for this column.
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.
1722
snmpNotifyFilterRowStatus_undo_setup(snmpNotifyFilterTable_rowreq_ctx *
1725
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterRowStatus_undo_setup", "called\n"));
1727
/** should never get a NULL pointer */
1728
netsnmp_assert(NULL != rowreq_ctx);
1731
* TODO:455:o: |-> Setup snmpNotifyFilterRowStatus undo.
1734
* copy snmpNotifyFilterRowStatus data
1735
* set rowreq_ctx->undo->snmpNotifyFilterRowStatus from rowreq_ctx->data.snmpNotifyFilterRowStatus
1737
rowreq_ctx->undo->snmpNotifyFilterRowStatus =
1738
rowreq_ctx->data.snmpNotifyFilterRowStatus;
1742
} /* snmpNotifyFilterRowStatus_undo_setup */
1745
* Set the new value.
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.
1754
snmpNotifyFilterRowStatus_set(snmpNotifyFilterTable_rowreq_ctx *
1756
u_long snmpNotifyFilterRowStatus_val)
1759
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterRowStatus_set", "called\n"));
1761
/** should never get a NULL pointer */
1762
netsnmp_assert(NULL != rowreq_ctx);
1765
* TODO:461:M: |-> Set snmpNotifyFilterRowStatus value.
1766
* set snmpNotifyFilterRowStatus value in rowreq_ctx->data
1768
rowreq_ctx->data.snmpNotifyFilterRowStatus =
1769
snmpNotifyFilterRowStatus_val;
1772
} /* snmpNotifyFilterRowStatus_set */
1775
* undo the previous set.
1778
* Pointer to the users context.
1781
snmpNotifyFilterRowStatus_undo(snmpNotifyFilterTable_rowreq_ctx *
1785
DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterRowStatus_undo", "called\n"));
1787
netsnmp_assert(NULL != rowreq_ctx);
1790
* TODO:456:o: |-> Clean up snmpNotifyFilterRowStatus undo.
1793
* copy snmpNotifyFilterRowStatus data
1794
* set rowreq_ctx->data.snmpNotifyFilterRowStatus from rowreq_ctx->undo->snmpNotifyFilterRowStatus
1796
rowreq_ctx->data.snmpNotifyFilterRowStatus =
1797
rowreq_ctx->undo->snmpNotifyFilterRowStatus;
1801
} /* snmpNotifyFilterRowStatus_undo */
1804
* check dependencies
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%.
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.
1816
* @retval MFD_SUCCESS all the changes to the row are legal
1817
* @retval MFD_ERROR one or more changes are not legal
1819
* (see README-table-snmpNotifyFilterTable if you don't have dependencies)
1822
snmpNotifyFilterTable_check_dependencies(snmpNotifyFilterTable_rowreq_ctx *
1825
int rc = MFD_SUCCESS;
1827
DEBUGMSGTL(("internal:snmpNotifyFilterTable:snmpNotifyFilterTable_check_dependencies", "called\n"));
1829
netsnmp_assert(NULL != rowreq_ctx);
1832
* TODO:470:o: Check snmpNotifyFilterTable row dependencies.
1833
* check that all new value are legal and consistent with each other
1836
* check for valid StorageType transition (old, new)
1838
rc = check_storage_transition(rowreq_ctx->undo->
1839
snmpNotifyFilterStorageType,
1841
snmpNotifyFilterStorageType);
1842
if (MFD_SUCCESS != rc)
1846
* check RowStatus dependencies
1849
column_set_flags & COLUMN_SNMPNOTIFYFILTERROWSTATUS_FLAG) {
1851
* check for valid RowStatus transition (old, new)
1852
* (Note: move transition check to
1853
* to catch errors earlier)
1855
rc = check_rowstatus_transition(rowreq_ctx->undo->
1856
snmpNotifyFilterRowStatus,
1858
snmpNotifyFilterRowStatus);
1859
if (MFD_SUCCESS != rc)
1863
* row creation requirements
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) {
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;
1881
rowreq_ctx->data.snmpNotifyFilterRowStatus =
1884
} /* row creation */
1887
* row change requirements
1890
* don't allow a destroy if any other value was changed, since
1891
* that might call data access routines with bad info.
1893
* you may or may not require the row be notInService before it
1896
if (ROWSTATUS_DESTROY ==
1897
rowreq_ctx->data.snmpNotifyFilterRowStatus) {
1900
~COLUMN_SNMPNOTIFYFILTERROWSTATUS_FLAG) {
1901
DEBUGMSGTL(("snmpNotifyFilterTable",
1902
"destroy must be only varbind for row\n"));
1903
return MFD_NOT_VALID_NOW;
1905
rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
1911
* must have row status to create a row
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;
1918
} /* row status not set */
1920
if (MFD_SUCCESS != rc)
1924
} /* snmpNotifyFilterTable_check_dependencies */