| 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 |
/** \page MFD helper for ipAddressPrefixTable |
| 8 |
* |
| 9 |
* \section intro Introduction |
| 10 |
* Introductory text. |
| 11 |
* |
| 12 |
*/ |
| 13 |
/* |
| 14 |
* standard Net-SNMP includes |
| 15 |
*/ |
| 16 |
#include <net-snmp/net-snmp-config.h> |
| 17 |
#include <net-snmp/net-snmp-includes.h> |
| 18 |
#include <net-snmp/agent/net-snmp-agent-includes.h> |
| 19 |
|
| 20 |
/* |
| 21 |
* include our parent header |
| 22 |
*/ |
| 23 |
#include "ipAddressPrefixTable.h" |
| 24 |
|
| 25 |
#include <net-snmp/agent/mib_modules.h> |
| 26 |
|
| 27 |
#include "ipAddressPrefixTable_interface.h" |
| 28 |
|
| 29 |
const oid ipAddressPrefixTable_oid[] = { IPADDRESSPREFIXTABLE_OID }; |
| 30 |
const int ipAddressPrefixTable_oid_size = |
| 31 |
OID_LENGTH(ipAddressPrefixTable_oid); |
| 32 |
|
| 33 |
ipAddressPrefixTable_registration ipAddressPrefixTable_user_context; |
| 34 |
static ipAddressPrefixTable_registration *ipAddressPrefixTable_user_context_p; |
| 35 |
|
| 36 |
void initialize_table_ipAddressPrefixTable(void); |
| 37 |
void shutdown_table_ipAddressPrefixTable(void); |
| 38 |
|
| 39 |
|
| 40 |
/** |
| 41 |
* Initializes the ipAddressPrefixTable module |
| 42 |
*/ |
| 43 |
void |
| 44 |
init_ipAddressPrefixTable(void) |
| 45 |
{ |
| 46 |
DEBUGMSGTL(("verbose:ipAddressPrefixTable:init_ipAddressPrefixTable", |
| 47 |
"called\n")); |
| 48 |
|
| 49 |
/* |
| 50 |
* TODO:300:o: Perform ipAddressPrefixTable one-time module initialization. |
| 51 |
*/ |
| 52 |
|
| 53 |
/* |
| 54 |
* here we initialize all the tables we're planning on supporting |
| 55 |
*/ |
| 56 |
if (should_init("ipAddressPrefixTable")) |
| 57 |
initialize_table_ipAddressPrefixTable(); |
| 58 |
|
| 59 |
} /* init_ipAddressPrefixTable */ |
| 60 |
|
| 61 |
/** |
| 62 |
* Shut-down the ipAddressPrefixTable module (agent is exiting) |
| 63 |
*/ |
| 64 |
void |
| 65 |
shutdown_ipAddressPrefixTable(void) |
| 66 |
{ |
| 67 |
if (should_init("ipAddressPrefixTable")) |
| 68 |
shutdown_table_ipAddressPrefixTable(); |
| 69 |
|
| 70 |
} |
| 71 |
|
| 72 |
/** |
| 73 |
* Initialize the table ipAddressPrefixTable |
| 74 |
* (Define its contents and how it's structured) |
| 75 |
*/ |
| 76 |
void |
| 77 |
initialize_table_ipAddressPrefixTable(void) |
| 78 |
{ |
| 79 |
u_long flags; |
| 80 |
|
| 81 |
DEBUGMSGTL(("verbose:ipAddressPrefixTable:initialize_table_ipAddressPrefixTable", "called\n")); |
| 82 |
|
| 83 |
/* |
| 84 |
* TODO:301:o: Perform ipAddressPrefixTable one-time table initialization. |
| 85 |
*/ |
| 86 |
|
| 87 |
/* |
| 88 |
* TODO:302:o: |->Initialize ipAddressPrefixTable user context |
| 89 |
* if you'd like to pass in a pointer to some data for this |
| 90 |
* table, allocate or set it up here. |
| 91 |
*/ |
| 92 |
/* |
| 93 |
* a netsnmp_data_list is a simple way to store void pointers. A simple |
| 94 |
* string token is used to add, find or remove pointers. |
| 95 |
*/ |
| 96 |
ipAddressPrefixTable_user_context_p |
| 97 |
= netsnmp_create_data_list("ipAddressPrefixTable", NULL, NULL); |
| 98 |
|
| 99 |
/* |
| 100 |
* No support for any flags yet, but in the future you would |
| 101 |
* set any flags here. |
| 102 |
*/ |
| 103 |
flags = 0; |
| 104 |
|
| 105 |
/* |
| 106 |
* call interface initialization code |
| 107 |
*/ |
| 108 |
_ipAddressPrefixTable_initialize_interface |
| 109 |
(ipAddressPrefixTable_user_context_p, flags); |
| 110 |
} /* initialize_table_ipAddressPrefixTable */ |
| 111 |
|
| 112 |
/** |
| 113 |
* Shutdown the table ipAddressPrefixTable |
| 114 |
*/ |
| 115 |
void |
| 116 |
shutdown_table_ipAddressPrefixTable(void) |
| 117 |
{ |
| 118 |
/* |
| 119 |
* call interface shutdown code |
| 120 |
*/ |
| 121 |
_ipAddressPrefixTable_shutdown_interface |
| 122 |
(ipAddressPrefixTable_user_context_p); |
| 123 |
netsnmp_free_all_list_data(ipAddressPrefixTable_user_context_p); |
| 124 |
ipAddressPrefixTable_user_context_p = NULL; |
| 125 |
} |
| 126 |
|
| 127 |
/** |
| 128 |
* extra context initialization (eg default values) |
| 129 |
* |
| 130 |
* @param rowreq_ctx : row request context |
| 131 |
* @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate) |
| 132 |
* |
| 133 |
* @retval MFD_SUCCESS : no errors |
| 134 |
* @retval MFD_ERROR : error (context allocate will fail) |
| 135 |
*/ |
| 136 |
int |
| 137 |
ipAddressPrefixTable_rowreq_ctx_init(ipAddressPrefixTable_rowreq_ctx * |
| 138 |
rowreq_ctx, void *user_init_ctx) |
| 139 |
{ |
| 140 |
DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_rowreq_ctx_init", "called\n")); |
| 141 |
|
| 142 |
netsnmp_assert(NULL != rowreq_ctx); |
| 143 |
|
| 144 |
/* |
| 145 |
* TODO:210:o: |-> Perform extra ipAddressPrefixTable rowreq initialization. (eg DEFVALS) |
| 146 |
*/ |
| 147 |
|
| 148 |
return MFD_SUCCESS; |
| 149 |
} /* ipAddressPrefixTable_rowreq_ctx_init */ |
| 150 |
|
| 151 |
/** |
| 152 |
* extra context cleanup |
| 153 |
* |
| 154 |
*/ |
| 155 |
void |
| 156 |
ipAddressPrefixTable_rowreq_ctx_cleanup(ipAddressPrefixTable_rowreq_ctx * |
| 157 |
rowreq_ctx) |
| 158 |
{ |
| 159 |
DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_rowreq_ctx_cleanup", "called\n")); |
| 160 |
|
| 161 |
netsnmp_assert(NULL != rowreq_ctx); |
| 162 |
|
| 163 |
/* |
| 164 |
* TODO:211:o: |-> Perform extra ipAddressPrefixTable rowreq cleanup. |
| 165 |
*/ |
| 166 |
} /* ipAddressPrefixTable_rowreq_ctx_cleanup */ |
| 167 |
|
| 168 |
/** |
| 169 |
* pre-request callback |
| 170 |
* |
| 171 |
* |
| 172 |
* @retval MFD_SUCCESS : success. |
| 173 |
* @retval MFD_ERROR : other error |
| 174 |
*/ |
| 175 |
int |
| 176 |
ipAddressPrefixTable_pre_request(ipAddressPrefixTable_registration * |
| 177 |
user_context) |
| 178 |
{ |
| 179 |
DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_pre_request", "called\n")); |
| 180 |
|
| 181 |
/* |
| 182 |
* TODO:510:o: Perform ipAddressPrefixTable pre-request actions. |
| 183 |
*/ |
| 184 |
|
| 185 |
return MFD_SUCCESS; |
| 186 |
} /* ipAddressPrefixTable_pre_request */ |
| 187 |
|
| 188 |
/** |
| 189 |
* post-request callback |
| 190 |
* |
| 191 |
* Note: |
| 192 |
* New rows have been inserted into the container, and |
| 193 |
* deleted rows have been removed from the container and |
| 194 |
* released. |
| 195 |
* |
| 196 |
* @param user_context |
| 197 |
* @param rc : MFD_SUCCESS if all requests succeeded |
| 198 |
* |
| 199 |
* @retval MFD_SUCCESS : success. |
| 200 |
* @retval MFD_ERROR : other error (ignored) |
| 201 |
*/ |
| 202 |
int |
| 203 |
ipAddressPrefixTable_post_request(ipAddressPrefixTable_registration * |
| 204 |
user_context, int rc) |
| 205 |
{ |
| 206 |
DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_post_request", "called\n")); |
| 207 |
|
| 208 |
/* |
| 209 |
* TODO:511:o: Perform ipAddressPrefixTable post-request actions. |
| 210 |
*/ |
| 211 |
|
| 212 |
return MFD_SUCCESS; |
| 213 |
} /* ipAddressPrefixTable_post_request */ |
| 214 |
|
| 215 |
|
| 216 |
/********************************************************************** |
| 217 |
********************************************************************** |
| 218 |
*** |
| 219 |
*** Table ipAddressPrefixTable |
| 220 |
*** |
| 221 |
********************************************************************** |
| 222 |
**********************************************************************/ |
| 223 |
/* |
| 224 |
* IP-MIB::ipAddressPrefixTable is subid 32 of ip. |
| 225 |
* Its status is Current. |
| 226 |
* OID: .1.3.6.1.2.1.4.32, length: 8 |
| 227 |
*/ |
| 228 |
|
| 229 |
/* |
| 230 |
* --------------------------------------------------------------------- |
| 231 |
* * TODO:200:r: Implement ipAddressPrefixTable data context functions. |
| 232 |
*/ |
| 233 |
|
| 234 |
|
| 235 |
/** |
| 236 |
* set mib index(es) |
| 237 |
* |
| 238 |
* @param tbl_idx mib index structure |
| 239 |
* @param ipAddressPrefixIfIndex_val |
| 240 |
* @param ipAddressPrefixType_val |
| 241 |
* @param ipAddressPrefixPrefix_val_ptr |
| 242 |
* @param ipAddressPrefixPrefix_val_ptr_len |
| 243 |
* @param ipAddressPrefixLength_val |
| 244 |
* |
| 245 |
* @retval MFD_SUCCESS : success. |
| 246 |
* @retval MFD_ERROR : other error. |
| 247 |
* |
| 248 |
* @remark |
| 249 |
* This convenience function is useful for setting all the MIB index |
| 250 |
* components with a single function call. It is assume that the C values |
| 251 |
* have already been mapped from their native/rawformat to the MIB format. |
| 252 |
*/ |
| 253 |
int |
| 254 |
ipAddressPrefixTable_indexes_set_tbl_idx(ipAddressPrefixTable_mib_index * |
| 255 |
tbl_idx, |
| 256 |
long ipAddressPrefixIfIndex_val, |
| 257 |
u_long ipAddressPrefixType_val, |
| 258 |
u_char |
| 259 |
*ipAddressPrefixPrefix_val_ptr, |
| 260 |
size_t |
| 261 |
ipAddressPrefixPrefix_val_ptr_len, |
| 262 |
u_long ipAddressPrefixLength_val) |
| 263 |
{ |
| 264 |
DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_indexes_set_tbl_idx", "called\n")); |
| 265 |
|
| 266 |
/* |
| 267 |
* ipAddressPrefixIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H |
| 268 |
*/ |
| 269 |
tbl_idx->ipAddressPrefixIfIndex = ipAddressPrefixIfIndex_val; |
| 270 |
|
| 271 |
/* |
| 272 |
* ipAddressPrefixType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h |
| 273 |
*/ |
| 274 |
tbl_idx->ipAddressPrefixType = ipAddressPrefixType_val; |
| 275 |
|
| 276 |
/* |
| 277 |
* ipAddressPrefixPrefix(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h |
| 278 |
*/ |
| 279 |
tbl_idx->ipAddressPrefixPrefix_len = sizeof(tbl_idx->ipAddressPrefixPrefix) / sizeof(tbl_idx->ipAddressPrefixPrefix[0]); /* max length */ |
| 280 |
/* |
| 281 |
* make sure there is enough space for ipAddressPrefixPrefix data |
| 282 |
*/ |
| 283 |
if (tbl_idx->ipAddressPrefixPrefix_len < |
| 284 |
ipAddressPrefixPrefix_val_ptr_len) { |
| 285 |
snmp_log(LOG_ERR, "not enough space for value\n"); |
| 286 |
return MFD_ERROR; |
| 287 |
} |
| 288 |
tbl_idx->ipAddressPrefixPrefix_len = ipAddressPrefixPrefix_val_ptr_len; |
| 289 |
memcpy(tbl_idx->ipAddressPrefixPrefix, ipAddressPrefixPrefix_val_ptr, |
| 290 |
ipAddressPrefixPrefix_val_ptr_len * |
| 291 |
sizeof(ipAddressPrefixPrefix_val_ptr[0])); |
| 292 |
|
| 293 |
/* |
| 294 |
* ipAddressPrefixLength(4)/InetAddressPrefixLength/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H |
| 295 |
*/ |
| 296 |
tbl_idx->ipAddressPrefixLength = ipAddressPrefixLength_val; |
| 297 |
|
| 298 |
|
| 299 |
return MFD_SUCCESS; |
| 300 |
} /* ipAddressPrefixTable_indexes_set_tbl_idx */ |
| 301 |
|
| 302 |
/** |
| 303 |
* @internal |
| 304 |
* set row context indexes |
| 305 |
* |
| 306 |
* @param reqreq_ctx the row context that needs updated indexes |
| 307 |
* |
| 308 |
* @retval MFD_SUCCESS : success. |
| 309 |
* @retval MFD_ERROR : other error. |
| 310 |
* |
| 311 |
* @remark |
| 312 |
* This function sets the mib indexs, then updates the oid indexs |
| 313 |
* from the mib index. |
| 314 |
*/ |
| 315 |
int |
| 316 |
ipAddressPrefixTable_indexes_set(ipAddressPrefixTable_rowreq_ctx * |
| 317 |
rowreq_ctx, |
| 318 |
long ipAddressPrefixIfIndex_val, |
| 319 |
u_long ipAddressPrefixType_val, |
| 320 |
u_char *ipAddressPrefixPrefix_val_ptr, |
| 321 |
size_t ipAddressPrefixPrefix_val_ptr_len, |
| 322 |
u_long ipAddressPrefixLength_val) |
| 323 |
{ |
| 324 |
DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_indexes_set", "called\n")); |
| 325 |
|
| 326 |
if (MFD_SUCCESS != |
| 327 |
ipAddressPrefixTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx, |
| 328 |
ipAddressPrefixIfIndex_val, |
| 329 |
ipAddressPrefixType_val, |
| 330 |
ipAddressPrefixPrefix_val_ptr, |
| 331 |
ipAddressPrefixPrefix_val_ptr_len, |
| 332 |
ipAddressPrefixLength_val)) |
| 333 |
return MFD_ERROR; |
| 334 |
|
| 335 |
/* |
| 336 |
* convert mib index to oid index |
| 337 |
*/ |
| 338 |
rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid); |
| 339 |
if (0 != ipAddressPrefixTable_index_to_oid(&rowreq_ctx->oid_idx, |
| 340 |
&rowreq_ctx->tbl_idx)) { |
| 341 |
return MFD_ERROR; |
| 342 |
} |
| 343 |
|
| 344 |
return MFD_SUCCESS; |
| 345 |
} /* ipAddressPrefixTable_indexes_set */ |
| 346 |
|
| 347 |
|
| 348 |
/*--------------------------------------------------------------------- |
| 349 |
* IP-MIB::ipAddressPrefixEntry.ipAddressPrefixOrigin |
| 350 |
* ipAddressPrefixOrigin is subid 5 of ipAddressPrefixEntry. |
| 351 |
* Its status is Current, and its access level is ReadOnly. |
| 352 |
* OID: .1.3.6.1.2.1.4.32.1.5 |
| 353 |
* Description: |
| 354 |
The origin of this prefix. |
| 355 |
* |
| 356 |
* Attributes: |
| 357 |
* accessible 1 isscalar 0 enums 1 hasdefval 0 |
| 358 |
* readable 1 iscolumn 1 ranges 0 hashint 0 |
| 359 |
* settable 0 |
| 360 |
* |
| 361 |
* Enum range: 4/8. Values: other(1), manual(2), wellknown(3), dhcp(4), routeradv(5) |
| 362 |
* |
| 363 |
* Its syntax is IpAddressPrefixOriginTC (based on perltype INTEGER) |
| 364 |
* The net-snmp type is ASN_INTEGER. The C type decl is long (u_long) |
| 365 |
*/ |
| 366 |
/** |
| 367 |
* Extract the current value of the ipAddressPrefixOrigin data. |
| 368 |
* |
| 369 |
* Set a value using the data context for the row. |
| 370 |
* |
| 371 |
* @param rowreq_ctx |
| 372 |
* Pointer to the row request context. |
| 373 |
* @param ipAddressPrefixOrigin_val_ptr |
| 374 |
* Pointer to storage for a long variable |
| 375 |
* |
| 376 |
* @retval MFD_SUCCESS : success |
| 377 |
* @retval MFD_SKIP : skip this node (no value for now) |
| 378 |
* @retval MFD_ERROR : Any other error |
| 379 |
*/ |
| 380 |
int |
| 381 |
ipAddressPrefixOrigin_get(ipAddressPrefixTable_rowreq_ctx * rowreq_ctx, |
| 382 |
u_long * ipAddressPrefixOrigin_val_ptr) |
| 383 |
{ |
| 384 |
/** we should have a non-NULL pointer */ |
| 385 |
netsnmp_assert(NULL != ipAddressPrefixOrigin_val_ptr); |
| 386 |
|
| 387 |
|
| 388 |
DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixOrigin_get", |
| 389 |
"called\n")); |
| 390 |
|
| 391 |
netsnmp_assert(NULL != rowreq_ctx); |
| 392 |
|
| 393 |
/* |
| 394 |
* TODO:231:o: |-> Extract the current value of the ipAddressPrefixOrigin data. |
| 395 |
* copy (* ipAddressPrefixOrigin_val_ptr ) from rowreq_ctx->data |
| 396 |
*/ |
| 397 |
(*ipAddressPrefixOrigin_val_ptr) = rowreq_ctx->data.ipAddressPrefixOrigin; |
| 398 |
|
| 399 |
return MFD_SUCCESS; |
| 400 |
} /* ipAddressPrefixOrigin_get */ |
| 401 |
|
| 402 |
/*--------------------------------------------------------------------- |
| 403 |
* IP-MIB::ipAddressPrefixEntry.ipAddressPrefixOnLinkFlag |
| 404 |
* ipAddressPrefixOnLinkFlag is subid 6 of ipAddressPrefixEntry. |
| 405 |
* Its status is Current, and its access level is ReadOnly. |
| 406 |
* OID: .1.3.6.1.2.1.4.32.1.6 |
| 407 |
* Description: |
| 408 |
This object has the value 'true(1)', if this prefix can be |
| 409 |
used for on-link determination and the value 'false(2)' |
| 410 |
otherwise. |
| 411 |
|
| 412 |
|
| 413 |
The default for IPv4 prefixes is 'true(1)'. |
| 414 |
* |
| 415 |
* Attributes: |
| 416 |
* accessible 1 isscalar 0 enums 1 hasdefval 0 |
| 417 |
* readable 1 iscolumn 1 ranges 0 hashint 0 |
| 418 |
* settable 0 |
| 419 |
* |
| 420 |
* Enum range: 2/8. Values: true(1), false(2) |
| 421 |
* |
| 422 |
* Its syntax is TruthValue (based on perltype INTEGER) |
| 423 |
* The net-snmp type is ASN_INTEGER. The C type decl is long (u_long) |
| 424 |
*/ |
| 425 |
/** |
| 426 |
* Extract the current value of the ipAddressPrefixOnLinkFlag data. |
| 427 |
* |
| 428 |
* Set a value using the data context for the row. |
| 429 |
* |
| 430 |
* @param rowreq_ctx |
| 431 |
* Pointer to the row request context. |
| 432 |
* @param ipAddressPrefixOnLinkFlag_val_ptr |
| 433 |
* Pointer to storage for a long variable |
| 434 |
* |
| 435 |
* @retval MFD_SUCCESS : success |
| 436 |
* @retval MFD_SKIP : skip this node (no value for now) |
| 437 |
* @retval MFD_ERROR : Any other error |
| 438 |
*/ |
| 439 |
int |
| 440 |
ipAddressPrefixOnLinkFlag_get(ipAddressPrefixTable_rowreq_ctx * rowreq_ctx, |
| 441 |
u_long * ipAddressPrefixOnLinkFlag_val_ptr) |
| 442 |
{ |
| 443 |
/** we should have a non-NULL pointer */ |
| 444 |
netsnmp_assert(NULL != ipAddressPrefixOnLinkFlag_val_ptr); |
| 445 |
|
| 446 |
|
| 447 |
DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixOnLinkFlag_get", "called\n")); |
| 448 |
|
| 449 |
netsnmp_assert(NULL != rowreq_ctx); |
| 450 |
|
| 451 |
/* |
| 452 |
* TODO:231:o: |-> Extract the current value of the ipAddressPrefixOnLinkFlag data. |
| 453 |
* copy (* ipAddressPrefixOnLinkFlag_val_ptr ) from rowreq_ctx->data |
| 454 |
*/ |
| 455 |
if (INETADDRESSTYPE_IPV4 == rowreq_ctx->tbl_idx.ipAddressPrefixType) { |
| 456 |
(*ipAddressPrefixOnLinkFlag_val_ptr) = 1; /* per MIB */ |
| 457 |
} else |
| 458 |
(*ipAddressPrefixOnLinkFlag_val_ptr) = |
| 459 |
rowreq_ctx->data.ipAddressPrefixOnLinkFlag; |
| 460 |
|
| 461 |
return MFD_SUCCESS; |
| 462 |
} /* ipAddressPrefixOnLinkFlag_get */ |
| 463 |
|
| 464 |
/*--------------------------------------------------------------------- |
| 465 |
* IP-MIB::ipAddressPrefixEntry.ipAddressPrefixAutonomousFlag |
| 466 |
* ipAddressPrefixAutonomousFlag is subid 7 of ipAddressPrefixEntry. |
| 467 |
* Its status is Current, and its access level is ReadOnly. |
| 468 |
* OID: .1.3.6.1.2.1.4.32.1.7 |
| 469 |
* Description: |
| 470 |
Autonomous address configuration flag. When true(1), |
| 471 |
indicates that this prefix can be used for autonomous |
| 472 |
address configuration (i.e. can be used to form a local |
| 473 |
interface address). If false(2), it is not used to auto- |
| 474 |
configure a local interface address. |
| 475 |
|
| 476 |
|
| 477 |
The default for IPv4 prefixes is 'false(2)'. |
| 478 |
* |
| 479 |
* Attributes: |
| 480 |
* accessible 1 isscalar 0 enums 1 hasdefval 0 |
| 481 |
* readable 1 iscolumn 1 ranges 0 hashint 0 |
| 482 |
* settable 0 |
| 483 |
* |
| 484 |
* Enum range: 2/8. Values: true(1), false(2) |
| 485 |
* |
| 486 |
* Its syntax is TruthValue (based on perltype INTEGER) |
| 487 |
* The net-snmp type is ASN_INTEGER. The C type decl is long (u_long) |
| 488 |
*/ |
| 489 |
/** |
| 490 |
* Extract the current value of the ipAddressPrefixAutonomousFlag data. |
| 491 |
* |
| 492 |
* Set a value using the data context for the row. |
| 493 |
* |
| 494 |
* @param rowreq_ctx |
| 495 |
* Pointer to the row request context. |
| 496 |
* @param ipAddressPrefixAutonomousFlag_val_ptr |
| 497 |
* Pointer to storage for a long variable |
| 498 |
* |
| 499 |
* @retval MFD_SUCCESS : success |
| 500 |
* @retval MFD_SKIP : skip this node (no value for now) |
| 501 |
* @retval MFD_ERROR : Any other error |
| 502 |
*/ |
| 503 |
int |
| 504 |
ipAddressPrefixAutonomousFlag_get(ipAddressPrefixTable_rowreq_ctx * |
| 505 |
rowreq_ctx, |
| 506 |
u_long * |
| 507 |
ipAddressPrefixAutonomousFlag_val_ptr) |
| 508 |
{ |
| 509 |
/** we should have a non-NULL pointer */ |
| 510 |
netsnmp_assert(NULL != ipAddressPrefixAutonomousFlag_val_ptr); |
| 511 |
|
| 512 |
|
| 513 |
DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixAutonomousFlag_get", "called\n")); |
| 514 |
|
| 515 |
netsnmp_assert(NULL != rowreq_ctx); |
| 516 |
|
| 517 |
/* |
| 518 |
* TODO:231:o: |-> Extract the current value of the ipAddressPrefixAutonomousFlag data. |
| 519 |
* copy (* ipAddressPrefixAutonomousFlag_val_ptr ) from rowreq_ctx->data |
| 520 |
*/ |
| 521 |
if (INETADDRESSTYPE_IPV4 == rowreq_ctx->tbl_idx.ipAddressPrefixType) |
| 522 |
(*ipAddressPrefixAutonomousFlag_val_ptr) = 2; /* per MIB */ |
| 523 |
else |
| 524 |
(*ipAddressPrefixAutonomousFlag_val_ptr) = |
| 525 |
rowreq_ctx->data.ipAddressPrefixAutonomousFlag; |
| 526 |
|
| 527 |
return MFD_SUCCESS; |
| 528 |
} /* ipAddressPrefixAutonomousFlag_get */ |
| 529 |
|
| 530 |
/*--------------------------------------------------------------------- |
| 531 |
* IP-MIB::ipAddressPrefixEntry.ipAddressPrefixAdvPreferredLifetime |
| 532 |
* ipAddressPrefixAdvPreferredLifetime is subid 8 of ipAddressPrefixEntry. |
| 533 |
* Its status is Current, and its access level is ReadOnly. |
| 534 |
* OID: .1.3.6.1.2.1.4.32.1.8 |
| 535 |
* Description: |
| 536 |
The remaining length of time in seconds that this prefix |
| 537 |
will continue to be preferred, i.e. time until deprecation. |
| 538 |
|
| 539 |
|
| 540 |
|
| 541 |
|
| 542 |
A value of 4,294,967,295 represents infinity. |
| 543 |
|
| 544 |
|
| 545 |
The address generated from a deprecated prefix should no |
| 546 |
longer be used as a source address in new communications, |
| 547 |
but packets received on such an interface are processed as |
| 548 |
expected. |
| 549 |
|
| 550 |
|
| 551 |
The default for IPv4 prefixes is 4,294,967,295 (infinity). |
| 552 |
* |
| 553 |
* Attributes: |
| 554 |
* accessible 1 isscalar 0 enums 0 hasdefval 0 |
| 555 |
* readable 1 iscolumn 1 ranges 0 hashint 0 |
| 556 |
* settable 0 |
| 557 |
* |
| 558 |
* |
| 559 |
* Its syntax is UNSIGNED32 (based on perltype UNSIGNED32) |
| 560 |
* The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long) |
| 561 |
*/ |
| 562 |
/** |
| 563 |
* Extract the current value of the ipAddressPrefixAdvPreferredLifetime data. |
| 564 |
* |
| 565 |
* Set a value using the data context for the row. |
| 566 |
* |
| 567 |
* @param rowreq_ctx |
| 568 |
* Pointer to the row request context. |
| 569 |
* @param ipAddressPrefixAdvPreferredLifetime_val_ptr |
| 570 |
* Pointer to storage for a u_long variable |
| 571 |
* |
| 572 |
* @retval MFD_SUCCESS : success |
| 573 |
* @retval MFD_SKIP : skip this node (no value for now) |
| 574 |
* @retval MFD_ERROR : Any other error |
| 575 |
*/ |
| 576 |
int |
| 577 |
ipAddressPrefixAdvPreferredLifetime_get(ipAddressPrefixTable_rowreq_ctx * |
| 578 |
rowreq_ctx, |
| 579 |
u_long * |
| 580 |
ipAddressPrefixAdvPreferredLifetime_val_ptr) |
| 581 |
{ |
| 582 |
/** we should have a non-NULL pointer */ |
| 583 |
netsnmp_assert(NULL != ipAddressPrefixAdvPreferredLifetime_val_ptr); |
| 584 |
|
| 585 |
|
| 586 |
DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixAdvPreferredLifetime_get", "called\n")); |
| 587 |
|
| 588 |
netsnmp_assert(NULL != rowreq_ctx); |
| 589 |
|
| 590 |
/* |
| 591 |
* TODO:231:o: |-> Extract the current value of the ipAddressPrefixAdvPreferredLifetime data. |
| 592 |
* copy (* ipAddressPrefixAdvPreferredLifetime_val_ptr ) from rowreq_ctx->data |
| 593 |
*/ |
| 594 |
if (INETADDRESSTYPE_IPV4 == rowreq_ctx->tbl_idx.ipAddressPrefixType) |
| 595 |
(*ipAddressPrefixAdvPreferredLifetime_val_ptr) = 4294967295U; /* per MIB */ |
| 596 |
else |
| 597 |
(*ipAddressPrefixAdvPreferredLifetime_val_ptr) = |
| 598 |
rowreq_ctx->data.ipAddressPrefixAdvPreferredLifetime; |
| 599 |
|
| 600 |
return MFD_SUCCESS; |
| 601 |
} /* ipAddressPrefixAdvPreferredLifetime_get */ |
| 602 |
|
| 603 |
/*--------------------------------------------------------------------- |
| 604 |
* IP-MIB::ipAddressPrefixEntry.ipAddressPrefixAdvValidLifetime |
| 605 |
* ipAddressPrefixAdvValidLifetime is subid 9 of ipAddressPrefixEntry. |
| 606 |
* Its status is Current, and its access level is ReadOnly. |
| 607 |
* OID: .1.3.6.1.2.1.4.32.1.9 |
| 608 |
* Description: |
| 609 |
The remaining length of time, in seconds, that this prefix |
| 610 |
will continue to be valid, i.e. time until invalidation. A |
| 611 |
value of 4,294,967,295 represents infinity. |
| 612 |
|
| 613 |
|
| 614 |
The address generated from an invalidated prefix should not |
| 615 |
appear as the destination or source address of a packet. |
| 616 |
|
| 617 |
|
| 618 |
The default for IPv4 prefixes is 4,294,967,295 (infinity). |
| 619 |
* |
| 620 |
* Attributes: |
| 621 |
* accessible 1 isscalar 0 enums 0 hasdefval 0 |
| 622 |
* readable 1 iscolumn 1 ranges 0 hashint 0 |
| 623 |
* settable 0 |
| 624 |
* |
| 625 |
* |
| 626 |
* Its syntax is UNSIGNED32 (based on perltype UNSIGNED32) |
| 627 |
* The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long) |
| 628 |
*/ |
| 629 |
/** |
| 630 |
* Extract the current value of the ipAddressPrefixAdvValidLifetime data. |
| 631 |
* |
| 632 |
* Set a value using the data context for the row. |
| 633 |
* |
| 634 |
* @param rowreq_ctx |
| 635 |
* Pointer to the row request context. |
| 636 |
* @param ipAddressPrefixAdvValidLifetime_val_ptr |
| 637 |
* Pointer to storage for a u_long variable |
| 638 |
* |
| 639 |
* @retval MFD_SUCCESS : success |
| 640 |
* @retval MFD_SKIP : skip this node (no value for now) |
| 641 |
* @retval MFD_ERROR : Any other error |
| 642 |
*/ |
| 643 |
int |
| 644 |
ipAddressPrefixAdvValidLifetime_get(ipAddressPrefixTable_rowreq_ctx * |
| 645 |
rowreq_ctx, |
| 646 |
u_long * |
| 647 |
ipAddressPrefixAdvValidLifetime_val_ptr) |
| 648 |
{ |
| 649 |
/** we should have a non-NULL pointer */ |
| 650 |
netsnmp_assert(NULL != ipAddressPrefixAdvValidLifetime_val_ptr); |
| 651 |
|
| 652 |
|
| 653 |
DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixAdvValidLifetime_get", "called\n")); |
| 654 |
|
| 655 |
netsnmp_assert(NULL != rowreq_ctx); |
| 656 |
|
| 657 |
/* |
| 658 |
* TODO:231:o: |-> Extract the current value of the ipAddressPrefixAdvValidLifetime data. |
| 659 |
* copy (* ipAddressPrefixAdvValidLifetime_val_ptr ) from rowreq_ctx->data |
| 660 |
*/ |
| 661 |
if (INETADDRESSTYPE_IPV4 == rowreq_ctx->tbl_idx.ipAddressPrefixType) |
| 662 |
(*ipAddressPrefixAdvValidLifetime_val_ptr) = 4294967295U; /* per MIB */ |
| 663 |
else |
| 664 |
(*ipAddressPrefixAdvValidLifetime_val_ptr) = |
| 665 |
rowreq_ctx->data.ipAddressPrefixAdvValidLifetime; |
| 666 |
|
| 667 |
return MFD_SUCCESS; |
| 668 |
} /* ipAddressPrefixAdvValidLifetime_get */ |
| 669 |
|
| 670 |
|
| 671 |
|
| 672 |
/** @} */ |
| 673 |
/** @} */ |
| 674 |
/** @{ */ |