📄 ipaddresstable.c
字号:
DEBUGMSGTL(("verbose:ipAddressTable:ipAddressIfIndex_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the ipAddressIfIndex data. * set (* ipAddressIfIndex_val_ptr ) from rowreq_ctx->data */ (*ipAddressIfIndex_val_ptr) = rowreq_ctx->data->if_index; return MFD_SUCCESS;} /* ipAddressIfIndex_get *//*--------------------------------------------------------------------- * IP-MIB::ipAddressEntry.ipAddressType * ipAddressType is subid 4 of ipAddressEntry. * Its status is Current, and its access level is Create. * OID: .1.3.6.1.2.1.4.34.1.4 * Description:The type of address. broadcast(3) is not a valid value for IPv6 addresses (RFC3513). * * Attributes: * accessible 1 isscalar 0 enums 1 hasdefval 1 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 1 * defval: unicast * * Enum range: 2/8. Values: unicast(1), anycast(2), broadcast(3) * * Its syntax is INTEGER (based on perltype INTEGER) * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long) *//** * Extract the current value of the ipAddressType data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ipAddressType_val_ptr * Pointer to storage for a long variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */intipAddressType_get(ipAddressTable_rowreq_ctx * rowreq_ctx, u_long * ipAddressType_val_ptr){ /** we should have a non-NULL pointer */ netsnmp_assert(NULL != ipAddressType_val_ptr); DEBUGMSGTL(("verbose:ipAddressTable:ipAddressType_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the ipAddressType data. * set (* ipAddressType_val_ptr ) from rowreq_ctx->data */ (*ipAddressType_val_ptr) = rowreq_ctx->data->ia_type; return MFD_SUCCESS;} /* ipAddressType_get *//*--------------------------------------------------------------------- * IP-MIB::ipAddressEntry.ipAddressPrefix * ipAddressPrefix is subid 5 of ipAddressEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.4.34.1.5 * Description:A pointer to the row in the prefix table to which this address belongs. May be { 0 0 } if there is no such row. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 1 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * defval: zeroDotZero * * * Its syntax is RowPointer (based on perltype OBJECTID) * The net-snmp type is ASN_OBJECT_ID. The C type decl is oid (oid) * This data type requires a length. (Max 2147483647) *//** * Extract the current value of the ipAddressPrefix data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ipAddressPrefix_val_ptr_ptr * Pointer to storage for a oid variable * @param ipAddressPrefix_val_ptr_len_ptr * Pointer to a size_t. On entry, it will contain the size (in bytes) * pointed to by ipAddressPrefix. * On exit, this value should contain the data size (in bytes). * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error* * @note If you need more than (*ipAddressPrefix_val_ptr_len_ptr) bytes of memory, * allocate it using malloc() and update ipAddressPrefix_val_ptr_ptr. * <b>DO NOT</b> free the previous pointer. * The MFD helper will release the memory you allocate. * * @remark If you call this function yourself, you are responsible * for checking if the pointer changed, and freeing any * previously allocated memory. (Not necessary if you pass * in a pointer to static memory, obviously.) */intipAddressPrefix_get(ipAddressTable_rowreq_ctx * rowreq_ctx, oid ** ipAddressPrefix_val_ptr_ptr, size_t *ipAddressPrefix_val_ptr_len_ptr){ oid *src; int len; /** we should have a non-NULL pointer and enough storage */ netsnmp_assert((NULL != ipAddressPrefix_val_ptr_ptr) && (NULL != *ipAddressPrefix_val_ptr_ptr)); netsnmp_assert(NULL != ipAddressPrefix_val_ptr_len_ptr); DEBUGMSGTL(("verbose:ipAddressTable:ipAddressPrefix_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the ipAddressPrefix data. * set (* ipAddressPrefix_val_ptr_ptr ) and (* ipAddressPrefix_val_ptr_len_ptr ) from rowreq_ctx->data */ if (NULL == rowreq_ctx->data->ia_prefix_oid) { src = nullOid; len = nullOidLen / sizeof(oid); } else { src = rowreq_ctx->data->ia_prefix_oid; len = rowreq_ctx->data->ia_prefix_oid_len; } if ((*ipAddressPrefix_val_ptr_len_ptr) < len) { (*ipAddressPrefix_val_ptr_ptr) = malloc(len * sizeof((*ipAddressPrefix_val_ptr_ptr)[0])); if (NULL == (*ipAddressPrefix_val_ptr_ptr)) { snmp_log(LOG_ERR, "could not allocate memory\n"); return MFD_ERROR; } } (*ipAddressPrefix_val_ptr_len_ptr) = len; memcpy((*ipAddressPrefix_val_ptr_ptr), src, len * sizeof((*ipAddressPrefix_val_ptr_ptr)[0])); return MFD_SUCCESS;} /* ipAddressPrefix_get *//*--------------------------------------------------------------------- * IP-MIB::ipAddressEntry.ipAddressOrigin * ipAddressOrigin is subid 6 of ipAddressEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.4.34.1.6 * Description:The origin of the address. * * Attributes: * accessible 1 isscalar 0 enums 1 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * Enum range: 4/8. Values: other(1), manual(2), dhcp(4), linklayer(5), random(6) * * Its syntax is IpAddressOriginTC (based on perltype INTEGER) * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long) *//** * Extract the current value of the ipAddressOrigin data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ipAddressOrigin_val_ptr * Pointer to storage for a long variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */intipAddressOrigin_get(ipAddressTable_rowreq_ctx * rowreq_ctx, u_long * ipAddressOrigin_val_ptr){ /** we should have a non-NULL pointer */ netsnmp_assert(NULL != ipAddressOrigin_val_ptr); DEBUGMSGTL(("verbose:ipAddressTable:ipAddressOrigin_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the ipAddressOrigin data. * set (* ipAddressOrigin_val_ptr ) from rowreq_ctx->data */ (*ipAddressOrigin_val_ptr) = rowreq_ctx->data->ia_origin; return MFD_SUCCESS;} /* ipAddressOrigin_get *//*--------------------------------------------------------------------- * IP-MIB::ipAddressEntry.ipAddressStatus * ipAddressStatus is subid 7 of ipAddressEntry. * Its status is Current, and its access level is Create. * OID: .1.3.6.1.2.1.4.34.1.7 * Description:The status of the address, describing if the address can be used for communication. In the absence of other information, an IPv4 address is always preferred(1). * * Attributes: * accessible 1 isscalar 0 enums 1 hasdefval 1 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 1 * defval: preferred * * Enum range: 5/8. Values: preferred(1), invalid(3), inaccessible(4), unknown(5), tentative(6), duplicate(7) * * Its syntax is IpAddressStatusTC (based on perltype INTEGER) * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long) *//** * Extract the current value of the ipAddressStatus data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ipAddressStatus_val_ptr * Pointer to storage for a long variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */intipAddressStatus_get(ipAddressTable_rowreq_ctx * rowreq_ctx, u_long * ipAddressStatus_val_ptr){ /** we should have a non-NULL pointer */ netsnmp_assert(NULL != ipAddressStatus_val_ptr); DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStatus_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the ipAddressStatus data. * set (* ipAddressStatus_val_ptr ) from rowreq_ctx->data */ (*ipAddressStatus_val_ptr) = rowreq_ctx->data->ia_status; return MFD_SUCCESS;} /* ipAddressStatus_get *//*--------------------------------------------------------------------- * IP-MIB::ipAddressEntry.ipAddressCreated * ipAddressCreated is subid 8 of ipAddressEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.4.34.1.8 * Description:The value of sysUpTime at the time this entry was created. If this entry was created prior to the last re- initialization of the local network management subsystem, then this object contains a zero value. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is TimeStamp (based on perltype TICKS) * The net-snmp type is ASN_TIMETICKS. The C type decl is u_long (u_long) *//** * Extract the current value of the ipAddressCreated data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ipAddressCreated_val_ptr * Pointer to storage for a u_long variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */intipAddressCreated_get(ipAddressTable_rowreq_ctx * rowreq_ctx, u_long * ipAddressCreated_val_ptr){ /** we should have a non-NULL pointer */ netsnmp_assert(NULL != ipAddressCreated_val_ptr); DEBUGMSGTL(("verbose:ipAddressTable:ipAddressCreated_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the ipAddressCreated data. * set (* ipAddressCreated_val_ptr ) from rowreq_ctx->data */ (*ipAddressCreated_val_ptr) = rowreq_ctx->ipAddressCreated; return MFD_SUCCESS;} /* ipAddressCreated_get *//*--------------------------------------------------------------------- * IP-MIB::ipAddressEntry.ipAddressLastChanged * ipAddressLastChanged is subid 9 of ipAddressEntry. * Its status is Current, and its access level is ReadOnly. * OID: .1.3.6.1.2.1.4.34.1.9 * Description:The value of sysUpTime at the time this entry was last updated. If this entry was updated prior to the last re- initialization of the local network management subsystem, then this object contains a zero value. * * Attributes: * accessible 1 isscalar 0 enums 0 hasdefval 0 * readable 1 iscolumn 1 ranges 0 hashint 0 * settable 0 * * * Its syntax is TimeStamp (based on perltype TICKS) * The net-snmp type is ASN_TIMETICKS. The C type decl is u_long (u_long) *//** * Extract the current value of the ipAddressLastChanged data. * * Set a value using the data context for the row. * * @param rowreq_ctx * Pointer to the row request context. * @param ipAddressLastChanged_val_ptr * Pointer to storage for a u_long variable * * @retval MFD_SUCCESS : success * @retval MFD_SKIP : skip this node (no value for now) * @retval MFD_ERROR : Any other error */intipAddressLastChanged_get(ipAddressTable_rowreq_ctx * rowreq_ctx, u_long * ipAddressLastChanged_val_ptr){ /** we should have a non-NULL pointer */ netsnmp_assert(NULL != ipAddressLastChanged_val_ptr); DEBUGMSGTL(("verbose:ipAddressTable:ipAddressLastChanged_get", "called\n")); netsnmp_assert(NULL != rowreq_ctx); /* * TODO:231:o: |-> Extract the current value of the ipAddressLastChanged data. * set (* ipAddressLastChanged_val_ptr ) from rowreq_ctx->data */ (*ipAddressLastChanged_val_ptr) = rowreq_ctx->ipAddressLastChanged; return MFD_SUCCESS;} /* ipAddressLastChanged_get *//*--------------------------------------------------------------------- * IP-MIB::ipAddressEntry.ipAddressRowStatus * ipAddressRowStatus is subid 10 of ipAddressEntry. * Its status is Current, and its access level is Create. * OID: .1.3.6.1.2.1.4.34.1.10 * Description:The status of this conceptual row. The RowStatus TC requires that this DESCRIPTION clause states under which circumstances other objects in this row
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -