1 /* 2 * Note: this file originally auto-generated by mib2c using 3 * version : 1.48 $ of : mfd-top.m2c,v $ 4 * 5 * $Id$ 6 */ 7 #ifndef IPADDRESSTABLE_H 8 #define IPADDRESSTABLE_H 9 10 #ifdef __cplusplus 11 extern "C" { 12 #endif 13 14 15 /** @addtogroup misc misc: Miscellaneous routines 16 * 17 * @{ 18 */ 19 #include <net-snmp/library/asn1.h> 20 #include <net-snmp/data_access/ipaddress.h> 21 22 /* 23 * other required module components 24 */ 25 /* *INDENT-OFF* */ 26 config_require(if-mib/data_access/interface) 27 config_require(ip-mib/data_access/ipaddress) 28 config_require(ip-mib/ipAddressTable/ipAddressTable_interface) 29 config_require(ip-mib/ipAddressTable/ipAddressTable_data_access) 30 /* *INDENT-ON* */ 31 32 /* 33 * OID, column number and enum definions for ipAddressTable 34 */ 35 #include "ipAddressTable_constants.h" 36 37 /* 38 ********************************************************************* 39 * function declarations 40 */ 41 void init_ipAddressTable(void); 42 void shutdown_ipAddressTable(void); 43 44 /* 45 ********************************************************************* 46 * Table declarations 47 */ 48 /********************************************************************** 49 ********************************************************************** 50 *** 51 *** Table ipAddressTable 52 *** 53 ********************************************************************** 54 **********************************************************************/ 55 /* 56 * IP-MIB::ipAddressTable is subid 34 of ip. 57 * Its status is Current. 58 * OID: .1.3.6.1.2.1.4.34, length: 8 59 */ 60 /* 61 ********************************************************************* 62 * When you register your mib, you get to provide a generic 63 * pointer that will be passed back to you for most of the 64 * functions calls. 65 * 66 * TODO:100:r: Review all context structures 67 */ 68 /* 69 * TODO:101:o: |-> Review ipAddressTable registration context. 70 */ 71 typedef netsnmp_data_list ipAddressTable_registration; 72 73 /**********************************************************************/ 74 /* 75 * TODO:110:r: |-> Review ipAddressTable data context structure. 76 * This structure is used to represent the data for ipAddressTable. 77 */ 78 typedef netsnmp_ipaddress_entry ipAddressTable_data; 79 80 81 /* 82 ********************************************************************* 83 * TODO:115:o: |-> Review ipAddressTable undo context. 84 * We're just going to use the same data structure for our 85 * undo_context. If you want to do something more efficent, 86 * define your typedef here. 87 */ 88 typedef ipAddressTable_data ipAddressTable_undo_data; 89 90 /* 91 * TODO:120:r: |-> Review ipAddressTable mib index. 92 * This structure is used to represent the index for ipAddressTable. 93 */ 94 typedef struct ipAddressTable_mib_index_s { 95 96 /* 97 * ipAddressAddrType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h 98 */ 99 long ipAddressAddrType; 100 101 /* 102 * ipAddressAddr(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h 103 */ 104 /** 128 - 1(other indexes) - oid length(10) = 116 */ 105 u_char ipAddressAddr[116]; 106 size_t ipAddressAddr_len; 107 108 109 } ipAddressTable_mib_index; 110 111 /* 112 * TODO:121:r: | |-> Review ipAddressTable max index length. 113 * If you KNOW that your indexes will never exceed a certain 114 * length, update this macro to that length. 115 * 116 * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM 117 * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX! 118 * Guessing 128 - col/entry(2) - oid len(8) 119 */ 120 #define MAX_ipAddressTable_IDX_LEN 118 121 122 123 /* 124 ********************************************************************* 125 * TODO:130:o: |-> Review ipAddressTable Row request (rowreq) context. 126 * When your functions are called, you will be passed a 127 * ipAddressTable_rowreq_ctx pointer. 128 */ 129 typedef struct ipAddressTable_rowreq_ctx_s { 130 131 /** this must be first for container compare to work */ 132 netsnmp_index oid_idx; 133 oid oid_tmp[MAX_ipAddressTable_IDX_LEN]; 134 135 ipAddressTable_mib_index tbl_idx; 136 137 ipAddressTable_data *data; 138 ipAddressTable_undo_data *undo; 139 unsigned int column_set_flags; /* flags for set columns */ 140 141 142 /* 143 * flags per row. Currently, the first (lower) 8 bits are reserved 144 * for the user. See mfd.h for other flags. 145 */ 146 u_int rowreq_flags; 147 148 /* 149 * TODO:131:o: | |-> Add useful data to ipAddressTable rowreq context. 150 */ 151 152 /* 153 * not available from net-snmp ipaddress data_access 154 */ 155 uint32_t ipAddressCreated; /* sysUpTime */ 156 uint32_t ipAddressLastChanged, ipAddressLastChanged_undo; /* sysUpTime */ 157 int ipAddressRowStatus, ipAddressRowStatus_undo; 158 159 /* 160 * storage for future expansion 161 */ 162 netsnmp_data_list *ipAddressTable_data_list; 163 164 } ipAddressTable_rowreq_ctx; 165 166 typedef struct ipAddressTable_ref_rowreq_ctx_s { 167 ipAddressTable_rowreq_ctx *rowreq_ctx; 168 } ipAddressTable_ref_rowreq_ctx; 169 170 /* 171 ********************************************************************* 172 * function prototypes 173 */ 174 int ipAddressTable_pre_request(ipAddressTable_registration 175 * user_context); 176 int ipAddressTable_post_request(ipAddressTable_registration 177 * user_context, int rc); 178 179 int 180 ipAddressTable_rowreq_ctx_init(ipAddressTable_rowreq_ctx * 181 rowreq_ctx, void *user_init_ctx); 182 void 183 ipAddressTable_rowreq_ctx_cleanup(ipAddressTable_rowreq_ctx * 184 rowreq_ctx); 185 186 ipAddressTable_data *ipAddressTable_allocate_data(void); 187 void ipAddressTable_release_data(ipAddressTable_data * 188 data); 189 190 int 191 ipAddressTable_check_dependencies(ipAddressTable_rowreq_ctx * 192 rowreq_ctx); 193 int ipAddressTable_commit(ipAddressTable_rowreq_ctx * 194 rowreq_ctx); 195 196 ipAddressTable_rowreq_ctx 197 * ipAddressTable_row_find_by_mib_index(ipAddressTable_mib_index * 198 mib_idx); 199 200 extern const oid ipAddressTable_oid[]; 201 extern const int ipAddressTable_oid_size; 202 203 204 #include "ipAddressTable_interface.h" 205 #include "ipAddressTable_data_access.h" 206 /* 207 ********************************************************************* 208 * GET function declarations 209 */ 210 211 /* 212 ********************************************************************* 213 * GET Table declarations 214 */ 215 /********************************************************************** 216 ********************************************************************** 217 *** 218 *** Table ipAddressTable 219 *** 220 ********************************************************************** 221 **********************************************************************/ 222 /* 223 * IP-MIB::ipAddressTable is subid 34 of ip. 224 * Its status is Current. 225 * OID: .1.3.6.1.2.1.4.34, length: 8 226 */ 227 /* 228 * indexes 229 */ 230 int ipAddressAddrType_map(long * 231 mib_ipAddressAddrType_val_ptr, 232 long 233 raw_ipAddressAddrType_val); 234 235 int ipAddressIfIndex_get(ipAddressTable_rowreq_ctx * 236 rowreq_ctx, 237 long *ipAddressIfIndex_val_ptr); 238 int ipAddressType_get(ipAddressTable_rowreq_ctx * 239 rowreq_ctx, 240 u_long * ipAddressType_val_ptr); 241 int ipAddressPrefix_get(ipAddressTable_rowreq_ctx * 242 rowreq_ctx, 243 oid ** ipAddressPrefix_val_ptr_ptr, 244 size_t 245 * ipAddressPrefix_val_ptr_len_ptr); 246 int ipAddressOrigin_get(ipAddressTable_rowreq_ctx * 247 rowreq_ctx, 248 u_long * ipAddressOrigin_val_ptr); 249 int ipAddressStatus_get(ipAddressTable_rowreq_ctx * 250 rowreq_ctx, 251 u_long * ipAddressStatus_val_ptr); 252 int ipAddressCreated_get(ipAddressTable_rowreq_ctx * 253 rowreq_ctx, 254 u_long * 255 ipAddressCreated_val_ptr); 256 int ipAddressLastChanged_get(ipAddressTable_rowreq_ctx * 257 rowreq_ctx, 258 u_long * 259 ipAddressLastChanged_val_ptr); 260 int ipAddressRowStatus_get(ipAddressTable_rowreq_ctx * 261 rowreq_ctx, 262 u_long * 263 ipAddressRowStatus_val_ptr); 264 int ipAddressStorageType_get(ipAddressTable_rowreq_ctx * 265 rowreq_ctx, 266 u_long * 267 ipAddressStorageType_val_ptr); 268 269 270 int 271 ipAddressTable_indexes_set_tbl_idx(ipAddressTable_mib_index * 272 tbl_idx, 273 long ipAddressAddrType_val, 274 u_char *ipAddressAddr_val_ptr, 275 size_t 276 ipAddressAddr_val_ptr_len); 277 int ipAddressTable_indexes_set(ipAddressTable_rowreq_ctx * 278 rowreq_ctx, 279 u_long 280 ipAddressAddrType_val, 281 u_char *ipAddressAddr_val_ptr, 282 size_t 283 ipAddressAddr_val_ptr_len); 284 285 286 287 /* 288 ********************************************************************* 289 * SET function declarations 290 */ 291 292 /* 293 ********************************************************************* 294 * SET Table declarations 295 */ 296 /********************************************************************** 297 ********************************************************************** 298 *** 299 *** Table ipAddressTable 300 *** 301 ********************************************************************** 302 **********************************************************************/ 303 /* 304 * IP-MIB::ipAddressTable is subid 34 of ip. 305 * Its status is Current. 306 * OID: .1.3.6.1.2.1.4.34, length: 8 307 */ 308 309 310 int ipAddressTable_undo_setup(ipAddressTable_rowreq_ctx * 311 rowreq_ctx); 312 int ipAddressTable_undo_cleanup(ipAddressTable_rowreq_ctx * 313 rowreq_ctx); 314 int ipAddressTable_undo(ipAddressTable_rowreq_ctx * 315 rowreq_ctx); 316 int ipAddressTable_commit(ipAddressTable_rowreq_ctx * 317 rowreq_ctx); 318 int ipAddressTable_undo_commit(ipAddressTable_rowreq_ctx * 319 rowreq_ctx); 320 321 322 int ipAddressIfIndex_check_value(ipAddressTable_rowreq_ctx 323 * rowreq_ctx, long 324 ipAddressIfIndex_val); 325 326 int ipAddressIfIndex_undo_setup(ipAddressTable_rowreq_ctx * 327 rowreq_ctx); 328 int ipAddressIfIndex_set(ipAddressTable_rowreq_ctx * 329 rowreq_ctx, 330 long ipAddressIfIndex_val); 331 int ipAddressIfIndex_undo(ipAddressTable_rowreq_ctx * 332 rowreq_ctx); 333 334 int ipAddressType_check_value(ipAddressTable_rowreq_ctx * 335 rowreq_ctx, 336 u_long ipAddressType_val); 337 int ipAddressType_undo_setup(ipAddressTable_rowreq_ctx * 338 rowreq_ctx); 339 int ipAddressType_set(ipAddressTable_rowreq_ctx * 340 rowreq_ctx, 341 u_long ipAddressType_val); 342 int ipAddressType_undo(ipAddressTable_rowreq_ctx * 343 rowreq_ctx); 344 345 int ipAddressPrefix_check_value(ipAddressTable_rowreq_ctx * 346 rowreq_ctx, 347 oid * 348 ipAddressPrefix_val_ptr, 349 size_t 350 ipAddressPrefix_val_ptr_len); 351 int ipAddressPrefix_undo_setup(ipAddressTable_rowreq_ctx * 352 rowreq_ctx); 353 int ipAddressPrefix_set(ipAddressTable_rowreq_ctx * 354 rowreq_ctx, 355 oid * ipAddressPrefix_val_ptr, 356 size_t 357 ipAddressPrefix_val_ptr_len); 358 int ipAddressPrefix_undo(ipAddressTable_rowreq_ctx * 359 rowreq_ctx); 360 361 int ipAddressOrigin_check_value(ipAddressTable_rowreq_ctx * 362 rowreq_ctx, 363 u_long 364 ipAddressOrigin_val); 365 int ipAddressOrigin_undo_setup(ipAddressTable_rowreq_ctx * 366 rowreq_ctx); 367 int ipAddressOrigin_set(ipAddressTable_rowreq_ctx * 368 rowreq_ctx, 369 u_long ipAddressOrigin_val); 370 int ipAddressOrigin_undo(ipAddressTable_rowreq_ctx * 371 rowreq_ctx); 372 373 int ipAddressStatus_check_value(ipAddressTable_rowreq_ctx * 374 rowreq_ctx, 375 u_long 376 ipAddressStatus_val); 377 int ipAddressStatus_undo_setup(ipAddressTable_rowreq_ctx * 378 rowreq_ctx); 379 int ipAddressStatus_set(ipAddressTable_rowreq_ctx * 380 rowreq_ctx, 381 u_long ipAddressStatus_val); 382 int ipAddressStatus_undo(ipAddressTable_rowreq_ctx * 383 rowreq_ctx); 384 385 int ipAddressCreated_check_value(ipAddressTable_rowreq_ctx 386 * rowreq_ctx, 387 u_long 388 ipAddressCreated_val); 389 int ipAddressCreated_undo_setup(ipAddressTable_rowreq_ctx * 390 rowreq_ctx); 391 int ipAddressCreated_set(ipAddressTable_rowreq_ctx * 392 rowreq_ctx, 393 u_long ipAddressCreated_val); 394 int ipAddressCreated_undo(ipAddressTable_rowreq_ctx * 395 rowreq_ctx); 396 397 int 398 ipAddressLastChanged_check_value(ipAddressTable_rowreq_ctx * 399 rowreq_ctx, 400 u_long ipAddressLastChanged_val); 401 int 402 ipAddressLastChanged_undo_setup(ipAddressTable_rowreq_ctx * 403 rowreq_ctx); 404 int ipAddressLastChanged_set(ipAddressTable_rowreq_ctx * 405 rowreq_ctx, 406 u_long 407 ipAddressLastChanged_val); 408 int ipAddressLastChanged_undo(ipAddressTable_rowreq_ctx * 409 rowreq_ctx); 410 411 int 412 ipAddressRowStatus_check_value(ipAddressTable_rowreq_ctx * 413 rowreq_ctx, 414 u_long ipAddressRowStatus_val); 415 int ipAddressRowStatus_undo_setup(ipAddressTable_rowreq_ctx 416 * rowreq_ctx); 417 int ipAddressRowStatus_set(ipAddressTable_rowreq_ctx * 418 rowreq_ctx, 419 u_long ipAddressRowStatus_val); 420 int ipAddressRowStatus_undo(ipAddressTable_rowreq_ctx * 421 rowreq_ctx); 422 423 int 424 ipAddressStorageType_check_value(ipAddressTable_rowreq_ctx * 425 rowreq_ctx, 426 u_long ipAddressStorageType_val); 427 int 428 ipAddressStorageType_undo_setup(ipAddressTable_rowreq_ctx * 429 rowreq_ctx); 430 int ipAddressStorageType_set(ipAddressTable_rowreq_ctx * 431 rowreq_ctx, 432 u_long 433 ipAddressStorageType_val); 434 int ipAddressStorageType_undo(ipAddressTable_rowreq_ctx * 435 rowreq_ctx); 436 437 438 int 439 ipAddressTable_check_dependencies(ipAddressTable_rowreq_ctx * ctx); 440 441 442 /* 443 * DUMMY markers, ignore 444 * 445 * TODO:099:x: ************************************************************* 446 * TODO:199:x: ************************************************************* 447 * TODO:299:x: ************************************************************* 448 * TODO:399:x: ************************************************************* 449 * TODO:499:x: ************************************************************* 450 */ 451 452 #ifdef __cplusplus 453 } 454 #endif 455 #endif /* IPADDRESSTABLE_H */ 456 /** @} */ 457 458