2
2
* Note: this file originally auto-generated by mib2c using
3
* version : 1.43 $ of : mfd-interface.m2c,v $
3
* version : 1.67 $ of : mfd-interface.m2c,v $
5
* $Id: usmDHUserKeyTable_interface.c,v 1.8.2.1 2005/01/27 22:56:27 rstory Exp $
5
* $Id: usmDHUserKeyTable_interface.c,v 1.9 2005/12/01 21:31:52 rstory Exp $
8
8
* *********************************************************************
39
39
#include "usmDHUserKeyTable.h"
42
#include <net-snmp/agent/table_container.h>
42
43
#include <net-snmp/library/container.h>
44
45
#include "usmDHUserKeyTable_interface.h"
46
49
/**********************************************************************
47
50
**********************************************************************
51
54
**********************************************************************
52
55
**********************************************************************/
54
* usmDHUserKeyTable is subid 2 of usmDHPublicObjects.
57
* SNMP-USM-DH-OBJECTS-MIB::usmDHUserKeyTable is subid 2 of usmDHPublicObjects.
55
58
* Its status is Current.
56
59
* OID: .1.3.6.1.3.101.1.1.2, length: 9
58
61
typedef struct usmDHUserKeyTable_interface_ctx_s {
60
63
netsnmp_container *container;
61
netsnmp_cache *cache; /* optional cache */
63
usmDHUserKeyTable_registration_ptr user_ctx;
66
usmDHUserKeyTable_registration *user_ctx;
65
68
netsnmp_table_registration_info tbl_info;
67
70
netsnmp_baby_steps_access_methods access_multiplexer;
69
74
} usmDHUserKeyTable_interface_ctx;
71
76
static usmDHUserKeyTable_interface_ctx usmDHUserKeyTable_if_ctx;
74
_usmDHUserKeyTable_container_init(usmDHUserKeyTable_interface_ctx *
79
_usmDHUserKeyTable_container_init(usmDHUserKeyTable_interface_ctx *
82
_usmDHUserKeyTable_container_shutdown(usmDHUserKeyTable_interface_ctx *
87
usmDHUserKeyTable_container_get(void)
89
return usmDHUserKeyTable_if_ctx.container;
92
usmDHUserKeyTable_registration *
93
usmDHUserKeyTable_registration_get(void)
95
return usmDHUserKeyTable_if_ctx.user_ctx;
98
usmDHUserKeyTable_registration *
99
usmDHUserKeyTable_registration_set(usmDHUserKeyTable_registration * newreg)
101
usmDHUserKeyTable_registration *old =
102
usmDHUserKeyTable_if_ctx.user_ctx;
103
usmDHUserKeyTable_if_ctx.user_ctx = newreg;
108
usmDHUserKeyTable_container_size(void)
110
return CONTAINER_SIZE(usmDHUserKeyTable_if_ctx.container);
114
usmDHUserKeyTable_dirty_get(void)
116
return usmDHUserKeyTable_if_ctx.table_dirty;
120
usmDHUserKeyTable_dirty_set(u_int status)
122
DEBUGMSGTL(("usmDHUserKeyTable:usmDHUserKeyTable_dirty_set",
123
"called. was %d, now %d\n",
124
usmDHUserKeyTable_if_ctx.table_dirty, status));
125
usmDHUserKeyTable_if_ctx.table_dirty = status;
129
* mfd multiplexer modes
78
131
static Netsnmp_Node_Handler _mfd_usmDHUserKeyTable_pre_request;
79
132
static Netsnmp_Node_Handler _mfd_usmDHUserKeyTable_post_request;
80
133
static Netsnmp_Node_Handler _mfd_usmDHUserKeyTable_object_lookup;
90
143
static Netsnmp_Node_Handler _mfd_usmDHUserKeyTable_check_dependencies;
92
145
NETSNMP_STATIC_INLINE int
93
_usmDHUserKeyTable_undo_column(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx,
146
_usmDHUserKeyTable_undo_column(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx,
94
147
netsnmp_variable_list * var,
283
336
netsnmp_register_table(reginfo, tbl_info);
284
338
} /* _usmDHUserKeyTable_initialize_interface */
342
* Shutdown the table usmDHUserKeyTable
345
_usmDHUserKeyTable_shutdown_interface(usmDHUserKeyTable_registration *
349
* shutdown the container
351
_usmDHUserKeyTable_container_shutdown(&usmDHUserKeyTable_if_ctx);
287
355
usmDHUserKeyTable_valid_columns_set(netsnmp_column_info *vc)
348
416
err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
349
417
NULL, 0, &var_usmUserEngineID);
351
snmp_log(LOG_ERR, "error %d converting index to oid\n");
419
snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
354
422
* parsing may have allocated memory. free it.
451
519
* allocate resources for a usmDHUserKeyTable_rowreq_ctx
453
521
usmDHUserKeyTable_rowreq_ctx *
454
usmDHUserKeyTable_allocate_rowreq_ctx(usmDHUserKeyTable_data * data)
522
usmDHUserKeyTable_allocate_rowreq_ctx(usmDHUserKeyTable_data * data,
456
525
usmDHUserKeyTable_rowreq_ctx *rowreq_ctx =
457
526
SNMP_MALLOC_TYPEDEF(usmDHUserKeyTable_rowreq_ctx);
483
552
rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
485
554
rowreq_ctx->usmDHUserKeyTable_data_list = NULL;
486
rowreq_ctx->usmDHUserKeyTable_reg = usmDHUserKeyTable_if_ctx.user_ctx;
557
* if we allocated data, call init routine
559
if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
560
if (SNMPERR_SUCCESS !=
561
usmDHUserKeyTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
562
usmDHUserKeyTable_release_rowreq_ctx(rowreq_ctx);
489
567
return rowreq_ctx;
490
568
} /* usmDHUserKeyTable_allocate_rowreq_ctx */
533
612
netsnmp_agent_request_info *agtreq_info,
534
613
netsnmp_request_info *requests)
537
usmDHUserKeyTable_pre_request(usmDHUserKeyTable_if_ctx.user_ctx);
617
DEBUGMSGTL(("internal:usmDHUserKeyTable:_mfd_usmDHUserKeyTable_pre_request", "called\n"));
619
if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
620
DEBUGMSGTL(("internal:usmDHUserKeyTable",
621
"skipping additional pre_request\n"));
622
return SNMP_ERR_NOERROR;
625
rc = usmDHUserKeyTable_pre_request(usmDHUserKeyTable_if_ctx.user_ctx);
538
626
if (MFD_SUCCESS != rc) {
540
628
* nothing we can do about it but log it
542
DEBUGMSGTL(("internal:usmDHUserKeyTable", "error %d from "
630
DEBUGMSGTL(("usmDHUserKeyTable", "error %d from "
543
631
"usmDHUserKeyTable_pre_request\n", rc));
544
632
netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
559
647
netsnmp_request_info *requests)
561
usmDHUserKeyTable_rowreq_ctx *rowreq_ctx;
563
usmDHUserKeyTable_post_request(usmDHUserKeyTable_if_ctx.user_ctx);
649
usmDHUserKeyTable_rowreq_ctx *rowreq_ctx =
650
netsnmp_container_table_row_extract(requests);
653
DEBUGMSGTL(("internal:usmDHUserKeyTable:_mfd_usmDHUserKeyTable_post_request", "called\n"));
656
* release row context, if deleted
658
if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
659
usmDHUserKeyTable_release_rowreq_ctx(rowreq_ctx);
662
* wait for last call before calling user
664
if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
665
DEBUGMSGTL(("internal:usmDHUserKeyTable",
666
"waiting for last post_request\n"));
667
return SNMP_ERR_NOERROR;
670
packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
671
if ((MFD_SUCCESS != packet_rc) && usmDHUserKeyTable_dirty_get()) {
673
* we shouldn't get here. the undo steps should also clear
676
snmp_log(LOG_WARNING,
677
"usmDHUserKeyTable dirty flag set in post_request "
678
"but status != SUCCESS.\n");
681
rc = usmDHUserKeyTable_post_request(usmDHUserKeyTable_if_ctx.user_ctx,
564
683
if (MFD_SUCCESS != rc) {
566
685
* nothing we can do about it but log it
568
DEBUGMSGTL(("internal:usmDHUserKeyTable", "error %d from "
687
DEBUGMSGTL(("usmDHUserKeyTable", "error %d from "
569
688
"usmDHUserKeyTable_post_request\n", rc));
573
* if there are no errors, check for and handle row creation/deletion
575
rc = netsnmp_check_requests_error(requests);
576
if ((SNMP_ERR_NOERROR == rc) &&
578
(rowreq_ctx = netsnmp_container_table_row_extract(requests)))) {
579
if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
580
rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
581
CONTAINER_INSERT(usmDHUserKeyTable_if_ctx.container,
583
} else if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
584
CONTAINER_REMOVE(usmDHUserKeyTable_if_ctx.container,
586
usmDHUserKeyTable_release_rowreq_ctx(rowreq_ctx);
590
691
return SNMP_ERR_NOERROR;
591
692
} /* _mfd_usmDHUserKeyTable_post_request */
615
717
if (NULL == rowreq_ctx) {
616
netsnmp_request_set_error_all(requests, SNMP_ERR_NOCREATION);
718
rc = SNMP_ERR_NOCREATION;
721
if (MFD_SUCCESS != rc)
722
netsnmp_request_set_error_all(requests, rc);
618
724
usmDHUserKeyTable_row_prep(rowreq_ctx);
621
return SNMP_ERR_NOERROR;
726
return SNMP_VALIDATE_ERR(rc);
622
727
} /* _mfd_usmDHUserKeyTable_object_lookup */
624
729
/***********************************************************************
637
742
int rc = SNMPERR_SUCCESS;
639
DEBUGMSGTL(("internal:usmDHUserKeyTable:_mfd_usmDHUserKeyTable_get_column", "called\n"));
744
DEBUGMSGTL(("internal:usmDHUserKeyTable:_mfd_usmDHUserKeyTable_get_column", "called for %d\n", column));
642
747
netsnmp_assert(NULL != rowreq_ctx);
788
894
int rc = SNMPERR_SUCCESS;
790
DEBUGMSGTL(("internal:usmDHUserKeyTable:_usmDHUserKeyTable_check_column", "called\n"));
896
DEBUGMSGTL(("internal:usmDHUserKeyTable:_usmDHUserKeyTable_check_column", "called for %d\n", column));
792
898
netsnmp_assert(NULL != rowreq_ctx);
799
905
case COLUMN_USMDHUSERAUTHKEYCHANGE:
800
906
rc = netsnmp_check_vb_type(var, ASN_OCTET_STR);
802
* yyy-rks: anything else we can do here?
804
if (SNMPERR_SUCCESS == rc) {
907
if (SNMPERR_SUCCESS != rc) {
908
DEBUGMSGTL(("usmDHUserKeyTable:_usmDHUserKeyTable_check_column:usmDHUserAuthKeyChange", "varbind validation failed (eg bad type or size)\n"));
805
910
rc = usmDHUserAuthKeyChange_check_value(rowreq_ctx,
806
911
(char *) var->val.
807
912
string, var->val_len);
821
926
case COLUMN_USMDHUSEROWNAUTHKEYCHANGE:
822
927
rc = netsnmp_check_vb_type(var, ASN_OCTET_STR);
824
* yyy-rks: anything else we can do here?
826
if (SNMPERR_SUCCESS == rc) {
928
if (SNMPERR_SUCCESS != rc) {
929
DEBUGMSGTL(("usmDHUserKeyTable:_usmDHUserKeyTable_check_column:usmDHUserOwnAuthKeyChange", "varbind validation failed (eg bad type or size)\n"));
827
931
rc = usmDHUserOwnAuthKeyChange_check_value(rowreq_ctx,
828
932
(char *) var->val.
844
948
case COLUMN_USMDHUSERPRIVKEYCHANGE:
845
949
rc = netsnmp_check_vb_type(var, ASN_OCTET_STR);
847
* yyy-rks: anything else we can do here?
849
if (SNMPERR_SUCCESS == rc) {
950
if (SNMPERR_SUCCESS != rc) {
951
DEBUGMSGTL(("usmDHUserKeyTable:_usmDHUserKeyTable_check_column:usmDHUserPrivKeyChange", "varbind validation failed (eg bad type or size)\n"));
850
953
rc = usmDHUserPrivKeyChange_check_value(rowreq_ctx,
851
954
(char *) var->val.
852
955
string, var->val_len);
866
969
case COLUMN_USMDHUSEROWNPRIVKEYCHANGE:
867
970
rc = netsnmp_check_vb_type(var, ASN_OCTET_STR);
869
* yyy-rks: anything else we can do here?
871
if (SNMPERR_SUCCESS == rc) {
971
if (SNMPERR_SUCCESS != rc) {
972
DEBUGMSGTL(("usmDHUserKeyTable:_usmDHUserKeyTable_check_column:usmDHUserOwnPrivKeyChange", "varbind validation failed (eg bad type or size)\n"));
872
974
rc = usmDHUserOwnPrivKeyChange_check_value(rowreq_ctx,
873
975
(char *) var->val.
958
1059
rc = usmDHUserKeyTable_check_dependencies(rowreq_ctx);
960
DEBUGMSGTL(("verbose:usmDHUserKeyTable:mfd", "error %d from "
1061
DEBUGMSGTL(("usmDHUserKeyTable:mfd", "error %d from "
961
1062
"usmDHUserKeyTable_check_dependencies\n", rc));
962
1063
netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
981
1082
int rc = SNMPERR_SUCCESS;
983
DEBUGMSGTL(("internal:usmDHUserKeyTable:_usmDHUserKeyTable_undo_setup_column", "called\n"));
1084
DEBUGMSGTL(("internal:usmDHUserKeyTable:_usmDHUserKeyTable_undo_setup_column", "called for %d\n", column));
985
1086
netsnmp_assert(NULL != rowreq_ctx);
990
1091
* usmDHUserAuthKeyChange(1)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
992
1093
case COLUMN_USMDHUSERAUTHKEYCHANGE:
993
rowreq_ctx->column_set_flags |= FLAG_USMDHUSERAUTHKEYCHANGE;
1094
rowreq_ctx->column_set_flags |= COLUMN_USMDHUSERAUTHKEYCHANGE_FLAG;
994
1095
rc = usmDHUserAuthKeyChange_undo_setup(rowreq_ctx);
998
1099
* usmDHUserOwnAuthKeyChange(2)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
1000
1101
case COLUMN_USMDHUSEROWNAUTHKEYCHANGE:
1001
rowreq_ctx->column_set_flags |= FLAG_USMDHUSEROWNAUTHKEYCHANGE;
1102
rowreq_ctx->column_set_flags |=
1103
COLUMN_USMDHUSEROWNAUTHKEYCHANGE_FLAG;
1002
1104
rc = usmDHUserOwnAuthKeyChange_undo_setup(rowreq_ctx);
1006
1108
* usmDHUserPrivKeyChange(3)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
1008
1110
case COLUMN_USMDHUSERPRIVKEYCHANGE:
1009
rowreq_ctx->column_set_flags |= FLAG_USMDHUSERPRIVKEYCHANGE;
1111
rowreq_ctx->column_set_flags |= COLUMN_USMDHUSERPRIVKEYCHANGE_FLAG;
1010
1112
rc = usmDHUserPrivKeyChange_undo_setup(rowreq_ctx);
1014
1116
* usmDHUserOwnPrivKeyChange(4)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
1016
1118
case COLUMN_USMDHUSEROWNPRIVKEYCHANGE:
1017
rowreq_ctx->column_set_flags |= FLAG_USMDHUSEROWNPRIVKEYCHANGE;
1119
rowreq_ctx->column_set_flags |=
1120
COLUMN_USMDHUSEROWNPRIVKEYCHANGE_FLAG;
1018
1121
rc = usmDHUserOwnPrivKeyChange_undo_setup(rowreq_ctx);
1064
1167
rowreq_ctx->column_set_flags = 0;
1065
1168
rc = usmDHUserKeyTable_undo_setup(rowreq_ctx);
1066
1169
if (MFD_SUCCESS != rc) {
1067
DEBUGMSGTL(("verbose:usmDHUserKeyTable:mfd", "error %d from "
1170
DEBUGMSGTL(("usmDHUserKeyTable:mfd", "error %d from "
1068
1171
"usmDHUserKeyTable_undo_setup\n", rc));
1069
1172
netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
1083
1186
rc = _usmDHUserKeyTable_undo_setup_column(rowreq_ctx,
1085
1188
if (MFD_SUCCESS != rc) {
1086
DEBUGMSGTL(("verbose:usmDHUserKeyTable:mfd",
1189
DEBUGMSGTL(("usmDHUserKeyTable:mfd", "error %d from "
1088
1190
"usmDHUserKeyTable_undo_setup_column\n", rc));
1089
1191
netsnmp_set_request_error(agtreq_info, requests,
1090
1192
SNMP_VALIDATE_ERR(rc));
1127
1229
* nothing we can do about it but log it
1129
DEBUGMSGTL(("verbose:usmDHUserKeyTable:mfd", "error %d from "
1231
DEBUGMSGTL(("usmDHUserKeyTable:mfd", "error %d from "
1130
1232
"usmDHUserKeyTable_undo_cleanup\n", rc));
1172
1270
* usmDHUserAuthKeyChange(1)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
1174
1272
case COLUMN_USMDHUSERAUTHKEYCHANGE:
1175
rowreq_ctx->column_set_flags |= FLAG_USMDHUSERAUTHKEYCHANGE;
1273
rowreq_ctx->column_set_flags |= COLUMN_USMDHUSERAUTHKEYCHANGE_FLAG;
1176
1274
rc = usmDHUserAuthKeyChange_set(rowreq_ctx,
1177
1275
(char *) var->val.string,
1182
1280
* usmDHUserOwnAuthKeyChange(2)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
1184
1282
case COLUMN_USMDHUSEROWNAUTHKEYCHANGE:
1185
rowreq_ctx->column_set_flags |= FLAG_USMDHUSEROWNAUTHKEYCHANGE;
1283
rowreq_ctx->column_set_flags |=
1284
COLUMN_USMDHUSEROWNAUTHKEYCHANGE_FLAG;
1186
1285
rc = usmDHUserOwnAuthKeyChange_set(rowreq_ctx,
1187
1286
(char *) var->val.string,
1192
1291
* usmDHUserPrivKeyChange(3)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
1194
1293
case COLUMN_USMDHUSERPRIVKEYCHANGE:
1195
rowreq_ctx->column_set_flags |= FLAG_USMDHUSERPRIVKEYCHANGE;
1294
rowreq_ctx->column_set_flags |= COLUMN_USMDHUSERPRIVKEYCHANGE_FLAG;
1196
1295
rc = usmDHUserPrivKeyChange_set(rowreq_ctx,
1197
1296
(char *) var->val.string,
1202
1301
* usmDHUserOwnPrivKeyChange(4)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
1204
1303
case COLUMN_USMDHUSEROWNPRIVKEYCHANGE:
1205
rowreq_ctx->column_set_flags |= FLAG_USMDHUSEROWNPRIVKEYCHANGE;
1304
rowreq_ctx->column_set_flags |=
1305
COLUMN_USMDHUSEROWNPRIVKEYCHANGE_FLAG;
1206
1306
rc = usmDHUserOwnPrivKeyChange_set(rowreq_ctx,
1207
1307
(char *) var->val.string,
1246
1347
requests->requestvb,
1248
1349
if (MFD_SUCCESS != rc) {
1249
DEBUGMSGTL(("verbose:usmDHUserKeyTable:mfd", "error %d from "
1350
DEBUGMSGTL(("usmDHUserKeyTable:mfd", "error %d from "
1250
1351
"usmDHUserKeyTable_set_column\n", rc));
1251
1352
netsnmp_set_request_error(agtreq_info, requests,
1252
1353
SNMP_VALIDATE_ERR(rc));
1283
1384
rc = usmDHUserKeyTable_commit(rowreq_ctx);
1284
1385
if (MFD_SUCCESS != rc) {
1285
DEBUGMSGTL(("verbose:usmDHUserKeyTable:mfd", "error %d from "
1386
DEBUGMSGTL(("usmDHUserKeyTable:mfd", "error %d from "
1286
1387
"usmDHUserKeyTable_commit\n", rc));
1287
1388
netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
1391
if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
1393
* if we successfully commited this row, set the dirty flag. Use the
1394
* current value + 1 (i.e. dirty = # rows changed).
1395
* this is checked in post_request...
1397
usmDHUserKeyTable_dirty_set(usmDHUserKeyTable_dirty_get() + 1); /* set table dirty flag */
1290
1400
return SNMP_ERR_NOERROR;
1305
1415
netsnmp_assert(NULL != rowreq_ctx);
1417
if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
1418
u_int d = usmDHUserKeyTable_dirty_get();
1420
netsnmp_assert(d != 0);
1422
usmDHUserKeyTable_dirty_set(d - 1);
1307
1425
rc = usmDHUserKeyTable_undo_commit(rowreq_ctx);
1308
1426
if (MFD_SUCCESS != rc) {
1310
1428
* nothing we can do about it but log it
1312
DEBUGMSGTL(("verbose:usmDHUserKeyTable:mfd", "error %d from "
1430
DEBUGMSGTL(("usmDHUserKeyTable:mfd", "error %d from "
1313
1431
"usmDHUserKeyTable_undo_commit\n", rc));
1434
if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
1435
snmp_log(LOG_WARNING,
1436
"usmDHUserKeyTable row dirty flag still set after undo_commit\n");
1437
rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
1316
1440
return SNMP_ERR_NOERROR;
1317
1441
} /* _mfd_usmDHUserKeyTable_commit */
1333
1457
int rc = SNMPERR_SUCCESS;
1335
DEBUGMSGTL(("internal:usmDHUserKeyTable:_usmDHUserKeyTable_undo_column", "called\n"));
1459
DEBUGMSGTL(("internal:usmDHUserKeyTable:_usmDHUserKeyTable_undo_column", "called for %d\n", column));
1337
1461
netsnmp_assert(NULL != rowreq_ctx);
1392
1516
netsnmp_assert(NULL != rowreq_ctx);
1518
rc = usmDHUserKeyTable_undo(rowreq_ctx);
1519
if (MFD_SUCCESS != rc) {
1521
* nothing we can do about it but log it
1523
DEBUGMSGTL(("usmDHUserKeyTable:mfd", "error %d from "
1524
"usmDHUserKeyTable_undo\n", rc));
1394
1527
for (; requests; requests = requests->next) {
1396
1529
* set column data
1407
1540
* nothing we can do about it but log it
1409
DEBUGMSGTL(("verbose:usmDHUserKeyTable:mfd", "error %d from "
1542
DEBUGMSGTL(("usmDHUserKeyTable:mfd", "error %d from "
1410
1543
"usmDHUserKeyTable_undo_column\n", rc));
1412
1545
} /* for results */
1440
1573
rc = usmDHUserKeyTable_irreversible_commit(rowreq_ctx);
1441
1574
if (MFD_SUCCESS != rc) {
1442
1575
netsnmp_request_set_error_all(requests, SNMP_ERR_COMMITFAILED);
1443
DEBUGMSGTL(("verbose:usmDHUserKeyTable:mfd", "error %d from "
1576
DEBUGMSGTL(("usmDHUserKeyTable:mfd", "error %d from "
1444
1577
"usmDHUserKeyTable_irreversible_commit\n", rc));
1581
* check for and handle row creation/deletion
1582
* and update column exist flags...
1584
if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
1585
CONTAINER_REMOVE(usmDHUserKeyTable_if_ctx.container, rowreq_ctx);
1587
if (rowreq_ctx->column_set_flags) {
1588
rowreq_ctx->column_set_flags = 0;
1447
1592
return SNMP_ERR_NOERROR;
1448
1593
} /* _mfd_usmDHUserKeyTable_irreversible_commit */
1473
1620
* call user code
1475
return usmDHUserKeyTable_cache_load((netsnmp_container *) cache->
1622
return usmDHUserKeyTable_container_load((netsnmp_container *) cache->
1477
1624
} /* _cache_load */
1483
_cache_item_free(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx, void *context)
1485
DEBUGMSGTL(("internal:usmDHUserKeyTable:_cache_item_free",
1488
if (NULL == rowreq_ctx)
1491
usmDHUserKeyTable_release_rowreq_ctx(rowreq_ctx);
1492
} /* _cache_item_free */
1498
1630
_cache_free(netsnmp_cache * cache, void *magic)
1500
1632
netsnmp_container *container;
1510
1642
container = (netsnmp_container *) cache->magic;
1644
_container_free(container);
1651
_container_item_free(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx,
1654
DEBUGMSGTL(("internal:usmDHUserKeyTable:_container_item_free",
1657
if (NULL == rowreq_ctx)
1660
usmDHUserKeyTable_release_rowreq_ctx(rowreq_ctx);
1661
} /* _container_item_free */
1667
_container_free(netsnmp_container * container)
1669
DEBUGMSGTL(("internal:usmDHUserKeyTable:_container_free", "called\n"));
1671
if (NULL == container) {
1673
"invalid container in usmDHUserKeyTable_container_free\n");
1513
1678
* call user code
1515
usmDHUserKeyTable_cache_free(container);
1680
usmDHUserKeyTable_container_free(container);
1518
1683
* free all items. inefficient, but easy.
1520
1685
CONTAINER_CLEAR(container,
1521
(netsnmp_container_obj_func *) _cache_item_free, NULL);
1686
(netsnmp_container_obj_func *) _container_item_free,
1688
} /* _container_free */
1526
* initialize the iterator container with functions or wrappers
1692
* initialize the container with functions or wrappers
1529
1695
_usmDHUserKeyTable_container_init(usmDHUserKeyTable_interface_ctx * if_ctx)
1554
1720
"usmDHUserKeyTable_container_init\n");
1557
if_ctx->cache->magic = (void *) if_ctx->container;
1724
if (NULL != if_ctx->cache)
1725
if_ctx->cache->magic = (void *) if_ctx->container;
1558
1726
} /* _usmDHUserKeyTable_container_init */
1730
* shutdown the container with functions or wrappers
1733
_usmDHUserKeyTable_container_shutdown(usmDHUserKeyTable_interface_ctx *
1736
DEBUGMSGTL(("internal:usmDHUserKeyTable:_usmDHUserKeyTable_container_shutdown", "called\n"));
1738
usmDHUserKeyTable_container_shutdown(if_ctx->container);
1740
_container_free(if_ctx->container);
1742
} /* _usmDHUserKeyTable_container_shutdown */
1745
usmDHUserKeyTable_rowreq_ctx *
1746
usmDHUserKeyTable_row_find_by_mib_index(usmDHUserKeyTable_mib_index *
1749
usmDHUserKeyTable_rowreq_ctx *rowreq_ctx;
1750
oid oid_tmp[MAX_OID_LEN];
1751
netsnmp_index oid_idx;
1755
* set up storage for OID
1757
oid_idx.oids = oid_tmp;
1758
oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
1763
rc = usmDHUserKeyTable_index_to_oid(&oid_idx, mib_idx);
1764
if (MFD_SUCCESS != rc)
1768
CONTAINER_FIND(usmDHUserKeyTable_if_ctx.container, &oid_idx);