2
2
* Note: this file originally auto-generated by mib2c using
3
* version : 1.32 $ of : mfd-top.m2c,v $
3
* version : 1.48 $ of : mfd-top.m2c,v $
5
* $Id: ifTable.c,v 1.17.2.3 2006/01/15 14:07:01 rstory Exp $
5
* $Id: ifTable.c,v 1.22.2.5 2006/02/14 14:40:55 dts12 Exp $
7
/** \mainpage MFD helper for ifTable
7
/** \page MFD helper for ifTable
9
9
* \section intro Introduction
10
10
* Introductory text.
27
27
#include "ifTable_interface.h"
29
#ifdef USING_IP_MIB_IPV4INTERFACETABLE_IPV4INTERFACETABLE_MODULE
30
# include "ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h"
32
#ifdef USING_IP_MIB_IPV6INTERFACETABLE_IPV6INTERFACETABLE_MODULE
33
# include "ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h"
35
#ifdef USING_IF_MIB_IFXTABLE_IFXTABLE_MODULE
36
# include "if-mib/ifXTable/ifXTable.h"
29
39
oid ifTable_oid[] = { IFTABLE_OID };
30
40
int ifTable_oid_size = OID_LENGTH(ifTable_oid);
42
ifTable_registration ifTable_user_context;
32
44
void initialize_table_ifTable(void);
45
void shutdown_table_ifTable(void);
48
_if_number_handler(netsnmp_mib_handler *handler,
49
netsnmp_handler_registration *reginfo,
50
netsnmp_agent_request_info *reqinfo,
51
netsnmp_request_info *requests);
60
static int ifTable_did_init = 0;
41
62
DEBUGMSGTL(("verbose:ifTable:init_ifTable", "called\n"));
44
65
* TODO:300:o: Perform ifTable one-time module initialization.
67
if (++ifTable_did_init != 1) {
68
DEBUGMSGTL(("ifTable:init_ifTable", "ignoring duplicate call\n"));
48
73
* here we initialize all the tables we're planning on supporting
50
if (should_init("ifTable"))
75
if (should_init("ifTable")) {
77
#ifdef USING_IP_MIB_IPV4INTERFACETABLE_IPV4INTERFACETABLE_MODULE
78
if (should_init("ipv4InterfaceTable"))
79
initialize_table_ipv4InterfaceTable();
82
#ifdef USING_IP_MIB_IPV6INTERFACETABLE_IPV6INTERFACETABLE_MODULE
83
if (should_init("ipv6InterfaceTable"))
84
initialize_table_ipv6InterfaceTable();
51
87
initialize_table_ifTable();
89
#ifdef USING_IF_MIB_IFXTABLE_IFXTABLE_MODULE
90
if (should_init("ifXTable"))
91
initialize_table_ifXTable();
53
94
} /* init_ifTable */
97
* Shut-down the ifTable module (agent is exiting)
100
shutdown_ifTable(void)
102
if (should_init("ifTable"))
103
shutdown_table_ifTable();
56
108
* Initialize the table ifTable
57
109
* (Define its contents and how it's structured)
60
112
initialize_table_ifTable(void)
62
ifTable_registration_ptr user_context;
114
ifTable_registration *user_context;
65
117
DEBUGMSGTL(("verbose:ifTable:initialize_table_ifTable", "called\n"));
89
141
* call interface initialization code
91
143
_ifTable_initialize_interface(user_context, flags);
146
* register scalar for ifNumber
151
netsnmp_handler_registration *myreg;
154
netsnmp_create_handler_registration("if number",
159
netsnmp_register_scalar(myreg);
92
162
} /* initialize_table_ifTable */
95
* extra context initialization
165
* Shutdown the table ifTable
168
shutdown_table_ifTable(void)
171
* call interface shutdown code
173
_ifTable_shutdown_interface(&ifTable_user_context);
177
* extra context initialization (eg default values)
97
179
* @param rowreq_ctx : row request context
98
180
* @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
109
191
netsnmp_assert(NULL != rowreq_ctx);
112
* TODO:210:o: |-> Perform extra ifTable rowreq initialization.
194
* TODO:210:o: |-> Perform extra ifTable rowreq initialization. (eg DEFVALS)
114
196
if (NULL == user_init_ctx)
115
197
rowreq_ctx->data.ifentry =
116
netsnmp_access_interface_entry_create(NULL,0);
198
netsnmp_access_interface_entry_create(NULL, 0);
118
200
rowreq_ctx->data.ifentry =
119
201
(netsnmp_interface_entry *) user_init_ctx;
145
227
* pre-request callback
228
* @param user_context
148
231
* @retval MFD_SUCCESS : success.
149
232
* @retval MFD_ERROR : other error
152
ifTable_pre_request(ifTable_registration_ptr user_context)
235
ifTable_pre_request(ifTable_registration * user_context)
154
237
DEBUGMSGTL(("verbose:ifTable:ifTable_pre_request", "called\n"));
164
247
* post-request callback
250
* New rows have been inserted into the container, and
251
* deleted rows have been removed from the container and
254
* @param user_context
255
* @param rc : MFD_SUCCESS if all requests succeeded
167
257
* @retval MFD_SUCCESS : success.
168
258
* @retval MFD_ERROR : other error (ignored)
171
ifTable_post_request(ifTable_registration_ptr user_context)
261
ifTable_post_request(ifTable_registration * user_context, int rc)
173
263
DEBUGMSGTL(("verbose:ifTable:ifTable_post_request", "called\n"));
176
* TODO:511:o: Perform ifTable pos-request actions.
266
* TODO:511:o: Perform ifTable post-request actions.
270
* check to set if any rows were changed.
272
if (ifTable_dirty_get()) {
274
* check if request was successful. If so, this would be
275
* a good place to save data to its persistent store.
277
if (MFD_SUCCESS == rc) {
279
* save changed rows, if you haven't already
281
snmp_store(netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
282
NETSNMP_DS_LIB_APPTYPE));
285
ifTable_dirty_set(0); /* clear table dirty flag */
179
288
return MFD_SUCCESS;
180
289
} /* ifTable_post_request */
188
297
**********************************************************************
189
298
**********************************************************************/
191
* ifTable is subid 2 of interfaces.
300
* IF-MIB::ifTable is subid 2 of interfaces.
192
301
* Its status is Current.
193
302
* OID: .1.3.6.1.2.1.2.2, length: 8
306
* ---------------------------------------------------------------------
307
* * TODO:200:r: Implement ifTable data context functions.
199
312
* set mib index(es)
201
314
* @param tbl_idx mib index structure
203
317
* @retval MFD_SUCCESS : success.
204
318
* @retval MFD_ERROR : other error.
347
462
* TODO:231:o: |-> Extract the current value of the ifDescr data.
348
* set (* ifDescr_val_ptr_ptr ) and (* ifDescr_val_ptr_len_ptr ) from rowreq_ctx->data
463
* copy (* ifDescr_val_ptr_ptr ) data and (* ifDescr_val_ptr_len_ptr ) from rowreq_ctx->data
351
466
* make sure there is enough space for ifDescr data
353
if ((NULL == (*ifDescr_val_ptr_ptr))
354
|| ((*ifDescr_val_ptr_len_ptr) < tmp_len)) {
468
if ((NULL == (*ifDescr_val_ptr_ptr)) ||
469
((*ifDescr_val_ptr_len_ptr) < tmp_len)) {
356
471
* allocate space for ifDescr data
358
473
(*ifDescr_val_ptr_ptr) =
359
malloc(tmp_len * sizeof((*ifDescr_val_ptr_ptr)[0]));
474
malloc(tmp_len * sizeof(rowreq_ctx->data.ifDescr[0]));
360
475
if (NULL == (*ifDescr_val_ptr_ptr)) {
361
476
snmp_log(LOG_ERR, "could not allocate memory\n");
362
477
return MFD_ERROR;
365
(*ifDescr_val_ptr_len_ptr) = tmp_len;
366
memcpy((*ifDescr_val_ptr_ptr), tmp_descr,
367
(*ifDescr_val_ptr_len_ptr) * sizeof((*ifDescr_val_ptr_ptr)[0]));
480
(*ifDescr_val_ptr_len_ptr) =
481
tmp_len * sizeof(rowreq_ctx->data.ifDescr[0]);
482
memcpy((*ifDescr_val_ptr_ptr), tmp_descr, (*ifDescr_val_ptr_len_ptr));
369
484
return MFD_SUCCESS;
370
485
} /* ifDescr_get */
419
534
* TODO:231:o: |-> Extract the current value of the ifType data.
420
* set (* ifType_val_ptr ) from rowreq_ctx->data
535
* copy (* ifType_val_ptr ) from rowreq_ctx->data
422
537
(*ifType_val_ptr) = rowreq_ctx->data.ifType;
533
648
* TODO:231:o: |-> Extract the current value of the ifSpeed data.
534
* set (* ifSpeed_val_ptr ) from rowreq_ctx->data
649
* copy (* ifSpeed_val_ptr ) from rowreq_ctx->data
536
651
(*ifSpeed_val_ptr) = rowreq_ctx->data.ifSpeed;
595
710
ifPhysAddress_get(ifTable_rowreq_ctx * rowreq_ctx,
596
711
char **ifPhysAddress_val_ptr_ptr,
597
size_t *ifPhysAddress_val_ptr_len_ptr)
712
size_t * ifPhysAddress_val_ptr_len_ptr)
599
714
/** we should have a non-NULL pointer and enough storage */
600
715
netsnmp_assert((NULL != ifPhysAddress_val_ptr_ptr)
623
738
* TODO:231:o: |-> Extract the current value of the ifPhysAddress data.
624
* set (* ifPhysAddress_val_ptr_ptr ) and (* ifPhysAddress_val_ptr_len_ptr ) from rowreq_ctx->data
739
* copy (* ifPhysAddress_val_ptr_ptr ) data and (* ifPhysAddress_val_ptr_len_ptr ) from rowreq_ctx->data
627
742
* make sure there is enough space for ifPhysAddress data
629
if ((NULL == (*ifPhysAddress_val_ptr_ptr))
630
|| ((*ifPhysAddress_val_ptr_len_ptr) <
631
rowreq_ctx->data.ifPhysAddress_len)) {
744
if ((NULL == (*ifPhysAddress_val_ptr_ptr)) ||
745
((*ifPhysAddress_val_ptr_len_ptr) <
746
(rowreq_ctx->data.ifPhysAddress_len *
747
sizeof(rowreq_ctx->data.ifPhysAddress[0])))) {
633
749
* allocate space for ifPhysAddress data
635
751
(*ifPhysAddress_val_ptr_ptr) =
636
752
malloc(rowreq_ctx->data.ifPhysAddress_len *
637
sizeof((*ifPhysAddress_val_ptr_ptr)[0]));
753
sizeof(rowreq_ctx->data.ifPhysAddress[0]));
638
754
if (NULL == (*ifPhysAddress_val_ptr_ptr)) {
639
755
snmp_log(LOG_ERR, "could not allocate memory\n");
640
756
return MFD_ERROR;
643
(*ifPhysAddress_val_ptr_len_ptr) = rowreq_ctx->data.ifPhysAddress_len;
759
(*ifPhysAddress_val_ptr_len_ptr) =
760
rowreq_ctx->data.ifPhysAddress_len *
761
sizeof(rowreq_ctx->data.ifPhysAddress[0]);
644
762
memcpy((*ifPhysAddress_val_ptr_ptr), rowreq_ctx->data.ifPhysAddress,
645
(*ifPhysAddress_val_ptr_len_ptr) *
646
sizeof((*ifPhysAddress_val_ptr_ptr)[0]));
763
(*ifPhysAddress_val_ptr_len_ptr));
648
765
return MFD_SUCCESS;
649
766
} /* ifPhysAddress_get */
703
820
* TODO:231:o: |-> Extract the current value of the ifAdminStatus data.
704
* set (* ifAdminStatus_val_ptr ) from rowreq_ctx->data
821
* copy (* ifAdminStatus_val_ptr ) from rowreq_ctx->data
706
823
(*ifAdminStatus_val_ptr) = rowreq_ctx->data.ifAdminStatus;
768
885
* TODO:231:o: |-> Extract the current value of the ifOperStatus data.
769
* set (* ifOperStatus_val_ptr ) from rowreq_ctx->data
886
* copy (* ifOperStatus_val_ptr ) from rowreq_ctx->data
771
888
(*ifOperStatus_val_ptr) = rowreq_ctx->data.ifOperStatus;
824
941
* TODO:231:o: |-> Extract the current value of the ifLastChange data.
825
* set (* ifLastChange_val_ptr ) from rowreq_ctx->data
942
* copy (* ifLastChange_val_ptr ) from rowreq_ctx->data
827
944
(*ifLastChange_val_ptr) = rowreq_ctx->data.ifLastChange;
882
999
* TODO:231:o: |-> Extract the current value of the ifInOctets data.
883
* set (* ifInOctets_val_ptr ) from rowreq_ctx->data
1000
* copy (* ifInOctets_val_ptr ) from rowreq_ctx->data
885
1002
(*ifInOctets_val_ptr) = rowreq_ctx->data.ifInOctets;
941
1058
* TODO:231:o: |-> Extract the current value of the ifInUcastPkts data.
942
* set (* ifInUcastPkts_val_ptr ) from rowreq_ctx->data
1059
* copy (* ifInUcastPkts_val_ptr ) from rowreq_ctx->data
944
1061
(*ifInUcastPkts_val_ptr) = rowreq_ctx->data.ifInUcastPkts;
1003
1120
* TODO:231:o: |-> Extract the current value of the ifInNUcastPkts data.
1004
* set (* ifInNUcastPkts_val_ptr ) from rowreq_ctx->data
1121
* copy (* ifInNUcastPkts_val_ptr ) from rowreq_ctx->data
1006
1123
(*ifInNUcastPkts_val_ptr) = rowreq_ctx->data.ifInNUcastPkts;
1065
1182
* TODO:231:o: |-> Extract the current value of the ifInDiscards data.
1066
* set (* ifInDiscards_val_ptr ) from rowreq_ctx->data
1183
* copy (* ifInDiscards_val_ptr ) from rowreq_ctx->data
1068
1185
(*ifInDiscards_val_ptr) = rowreq_ctx->data.ifInDiscards;
1127
1244
* TODO:231:o: |-> Extract the current value of the ifInErrors data.
1128
* set (* ifInErrors_val_ptr ) from rowreq_ctx->data
1245
* copy (* ifInErrors_val_ptr ) from rowreq_ctx->data
1130
1247
(*ifInErrors_val_ptr) = rowreq_ctx->data.ifInErrors;
1192
1309
* TODO:231:o: |-> Extract the current value of the ifInUnknownProtos data.
1193
* set (* ifInUnknownProtos_val_ptr ) from rowreq_ctx->data
1310
* copy (* ifInUnknownProtos_val_ptr ) from rowreq_ctx->data
1195
1312
(*ifInUnknownProtos_val_ptr) = rowreq_ctx->data.ifInUnknownProtos;
1250
1367
* TODO:231:o: |-> Extract the current value of the ifOutOctets data.
1251
* set (* ifOutOctets_val_ptr ) from rowreq_ctx->data
1368
* copy (* ifOutOctets_val_ptr ) from rowreq_ctx->data
1253
1370
(*ifOutOctets_val_ptr) = rowreq_ctx->data.ifOutOctets;
1310
1427
* TODO:231:o: |-> Extract the current value of the ifOutUcastPkts data.
1311
* set (* ifOutUcastPkts_val_ptr ) from rowreq_ctx->data
1428
* copy (* ifOutUcastPkts_val_ptr ) from rowreq_ctx->data
1313
1430
(*ifOutUcastPkts_val_ptr) = rowreq_ctx->data.ifOutUcastPkts;
1373
1490
* TODO:231:o: |-> Extract the current value of the ifOutNUcastPkts data.
1374
* set (* ifOutNUcastPkts_val_ptr ) from rowreq_ctx->data
1491
* copy (* ifOutNUcastPkts_val_ptr ) from rowreq_ctx->data
1376
(*ifOutNUcastPkts_val_ptr) = rowreq_ctx->data.ifentry->stats.onucast;
1493
(*ifOutNUcastPkts_val_ptr) = rowreq_ctx->data.ifOutNUcastPkts;
1378
1495
return MFD_SUCCESS;
1379
1496
} /* ifOutNUcastPkts_get */
1433
1550
* TODO:231:o: |-> Extract the current value of the ifOutDiscards data.
1434
* set (* ifOutDiscards_val_ptr ) from rowreq_ctx->data
1551
* copy (* ifOutDiscards_val_ptr ) from rowreq_ctx->data
1436
1553
(*ifOutDiscards_val_ptr) = rowreq_ctx->data.ifOutDiscards;
1494
1611
* TODO:231:o: |-> Extract the current value of the ifOutErrors data.
1495
* set (* ifOutErrors_val_ptr ) from rowreq_ctx->data
1612
* copy (* ifOutErrors_val_ptr ) from rowreq_ctx->data
1497
1614
(*ifOutErrors_val_ptr) = rowreq_ctx->data.ifOutErrors;
1545
1662
* TODO:231:o: |-> Extract the current value of the ifOutQLen data.
1546
* set (* ifOutQLen_val_ptr ) from rowreq_ctx->data
1663
* copy (* ifOutQLen_val_ptr ) from rowreq_ctx->data
1548
1665
(*ifOutQLen_val_ptr) = rowreq_ctx->data.ifOutQLen;
1610
1727
ifSpecific_get(ifTable_rowreq_ctx * rowreq_ctx,
1611
1728
oid ** ifSpecific_val_ptr_ptr,
1612
size_t *ifSpecific_val_ptr_len_ptr)
1729
size_t * ifSpecific_val_ptr_len_ptr)
1614
1731
/** we should have a non-NULL pointer and enough storage */
1615
1732
netsnmp_assert((NULL != ifSpecific_val_ptr_ptr)
1625
1742
* TODO:231:o: |-> Extract the current value of the ifSpecific data.
1626
* set (* ifSpecific_val_ptr_ptr ) and (* ifSpecific_val_ptr_len_ptr ) from rowreq_ctx->data
1743
* copy (* ifSpecific_val_ptr_ptr ) data and (* ifSpecific_val_ptr_len_ptr ) from rowreq_ctx->data
1628
1745
#ifdef IFTABLE_HAS_IFSPECIFIC
1630
1747
* make sure there is enough space for ifSpecific data
1632
if ((NULL == (*ifSpecific_val_ptr_ptr))
1633
|| ((*ifSpecific_val_ptr_len_ptr) <
1634
rowreq_ctx->data.ifSpecific_len)) {
1749
if ((NULL == (*ifSpecific_val_ptr_ptr)) ||
1750
((*ifSpecific_val_ptr_len_ptr) <
1751
(rowreq_ctx->data.ifSpecific_len *
1752
sizeof(rowreq_ctx->data.ifSpecific[0])))) {
1636
1754
* allocate space for ifSpecific data
1638
1756
(*ifSpecific_val_ptr_ptr) =
1639
1757
malloc(rowreq_ctx->data.ifSpecific_len *
1640
sizeof((*ifSpecific_val_ptr_ptr)[0]));
1758
sizeof(rowreq_ctx->data.ifSpecific[0]));
1641
1759
if (NULL == (*ifSpecific_val_ptr_ptr)) {
1642
1760
snmp_log(LOG_ERR, "could not allocate memory\n");
1643
1761
return MFD_ERROR;
1646
(*ifSpecific_val_ptr_len_ptr) = rowreq_ctx->data.ifSpecific_len;
1764
(*ifSpecific_val_ptr_len_ptr) =
1765
rowreq_ctx->data.ifSpecific_len *
1766
sizeof(rowreq_ctx->data.ifSpecific[0]);
1647
1767
memcpy((*ifSpecific_val_ptr_ptr), rowreq_ctx->data.ifSpecific,
1648
(*ifSpecific_val_ptr_len_ptr) *
1649
sizeof((*ifSpecific_val_ptr_ptr)[0]));
1768
(*ifSpecific_val_ptr_len_ptr));
1669
1789
**********************************************************************
1670
1790
**********************************************************************/
1672
* ifTable is subid 2 of interfaces.
1792
* IF-MIB::ifTable is subid 2 of interfaces.
1673
1793
* Its status is Current.
1674
1794
* OID: .1.3.6.1.2.1.2.2, length: 8
1745
1865
* Setup up context with information needed to undo a set request.
1867
* Undo storage is in (* ifSpecific_val_ptr_ptr )*
1747
1868
* This function will be called before the individual node undo setup
1748
1869
* functions are called. If you need to do any undo setup that is not
1749
1870
* related to a specific column, you can do it here.
1779
1901
* TODO:451:M: |-> Setup ifTable undo.
1780
1902
* set up ifTable undo information, in preparation for a set.
1903
* Undo storage is in (* ifSpecific_val_ptr_ptr )*
1907
} /* ifTable_undo_setup */
1910
* Undo a set request.
1912
* This function will be called before the individual node undo
1913
* functions are called. If you need to do any undo that is not
1914
* related to a specific column, you can do it here.
1916
* Note that an individual node's undo function will only be called
1917
* if that node is being set to a new value.
1919
* If there is anything specific to a particular column (e.g. releasing
1920
* memory for a string), you should do that setup in the node's undo
1921
* function, so it won't be done unless it is necessary.
1924
* Pointer to the table context (ifTable_rowreq_ctx)
1926
* @retval MFD_SUCCESS : success
1927
* @retval MFD_ERROR : error. set will fail.
1930
ifTable_undo(ifTable_rowreq_ctx * rowreq_ctx)
1932
int rc = MFD_SUCCESS;
1934
DEBUGMSGTL(("verbose:ifTable:ifTable_undo", "called\n"));
1936
/** we should have a non-NULL pointer */
1937
netsnmp_assert(NULL != rowreq_ctx);
1940
* TODO:451:M: |-> ifTable undo.
1941
* ifTable undo information, in response to a failed set.
1942
* Undo storage is in (* ifSpecific_val_ptr_ptr )*
1826
1989
* Should you need different behavior depending on which columns were
1827
1990
* set, rowreq_ctx->column_set_flags will indicate which writeable columns were
1828
* set. The definitions for the FLAG_* bits can be found in
1991
* set. The definitions for the COLUMN_*_FLAG bits can be found in
1830
1993
* A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
1832
* @param ifTable_rowreq_ctx
1833
* Pointer to the users context.
1995
* @param rowreq_ctx Pointer to the users context.
1835
1997
* @retval MFD_SUCCESS : success
1836
1998
* @retval MFD_ERROR : error
1859
2021
* 3) set the column's flag in column_set_flags if it needs undo
1860
2022
* processing in case of a failure.
1862
if (save_flags & FLAG_IFADMINSTATUS) {
1863
save_flags &= ~FLAG_IFADMINSTATUS; /* clear ifAdminStatus */
2024
if (save_flags & COLUMN_IFADMINSTATUS_FLAG) {
2025
save_flags &= ~COLUMN_IFADMINSTATUS_FLAG; /* clear ifAdminStatus */
1865
2027
* TODO:482:o: |-> commit column ifAdminStatus.
1877
2039
* set flag, in case we need to undo ifAdminStatus
1879
rowreq_ctx->column_set_flags |= FLAG_IFADMINSTATUS;
2041
rowreq_ctx->column_set_flags |= COLUMN_IFADMINSTATUS_FLAG;
2046
* if we successfully commited this row, set the dirty flag.
2048
if (MFD_SUCCESS == rc) {
2049
rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
1883
2052
if (save_flags) {
1884
2053
snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
1895
2064
* Should you need different behavior depending on which columns were
1896
2065
* set, rowreq_ctx->column_set_flags will indicate which writeable columns were
1897
* set. The definitions for the FLAG_* bits can be found in
2066
* set. The definitions for the COLUMN_*_FLAG bits can be found in
1899
2068
* A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
1901
* @param ifTable_rowreq_ctx
1902
2071
* Pointer to the users context.
1904
2073
* @retval MFD_SUCCESS : success
1919
2088
* check the column's flag in rowreq_ctx->column_set_flags to see
1920
2089
* if it was set during commit, then undo it.
1922
* eg: if (rowreq_ctx->column_set_flags & FLAG_) {}
2091
* eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
1925
2094
* no undo cleanup, undo entry simply freed
2099
* if we successfully un-commited this row, clear the dirty flag.
2101
if (MFD_SUCCESS == rc) {
2102
rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
1929
2106
} /* ifTable_undo_commit */
1932
* TODO:420:r: Implement ifTable index validation.
1935
2109
* TODO:440:M: Implement ifTable node value checks.
1936
2110
* TODO:450:M: Implement ifTable undo functions.
1937
2111
* TODO:460:M: Implement ifTable set functions.
2125
2299
* Should you need different behavior depending on which columns were
2126
2300
* set, rowreq_ctx->column_set_flags will indicate which writeable columns were
2127
* set. The definitions for the FLAG_* bits can be found in
2301
* set. The definitions for the COLUMN_*_FLAG bits can be found in
2129
2303
* A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
2131
2307
* @retval MFD_SUCCESS all the changes to the row are legal
2132
2308
* @retval MFD_ERROR one or more changes are not legal
2151
2327
} /* ifTable_check_dependencies */
2331
_if_number_handler(netsnmp_mib_handler *handler,
2332
netsnmp_handler_registration *reginfo,
2333
netsnmp_agent_request_info *reqinfo,
2334
netsnmp_request_info *requests)
2336
if (MODE_GET == reqinfo->mode) {
2337
int val = ifTable_container_size();
2338
snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
2339
(u_char *) &val, sizeof(val));
2341
netsnmp_assert("bad mode in RO handler");
2343
if (handler->next && handler->next->access_method)
2344
return netsnmp_call_next_handler(handler, reginfo, reqinfo,
2347
return SNMP_ERR_NOERROR;