Files
m241Neelima/components/ip_net2-6.9/ipmip4/src/ipmip4_mip_mib.c
T
2026-07-30 11:19:44 +05:30

2109 lines
66 KiB
C

/*
******************************************************************************
* INTERPEAK SOURCE FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmip4_mip_mib.c,v $ $Revision: 1.7 $
* $Source: /home/interpeak/CVSRoot/ipmip4/src/ipmip4_mip_mib.c,v $
* $Author: n $
* $State: Exp $ $Locker: $
*
* Copyright Interpeak AB 2000-2003 <www.interpeak.se>. All rights reserved.
* Design and implementation by Markus Carlstedt <markus@interpeak.se>
******************************************************************************
*/
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
*===========================================================================
* MIP-MIB
*===========================================================================
*
* Autogenerated by 'ipmibc' with 'smidump 0.4.5' on 2007-04-13 at 15:29:13
*
* This file includes initialization code and stubs for MIB variables defined
* in MIP-MIB. Without any changes it should compile and run with the
* behaviour that GetRequests succeed with the returned value being
* zero. SetRequests also succeed but without any actual variables
* being updated.
*
* Modifications to this file are necessary in order to enable read and
* write operations on actual variables presented in the MIB interface.
* Each segment in the code where a change is proposed is marked with a
* 'MIB_TODO' comment together with a pseudo code example describing the
* modification.
*
* This file shall normally be compiled together with the product to which
* SNMP support is to be added and then linked with the IPSNMP libraries.
* The MIB is initialized by calling the public initialization function defined
* at the end of this file. Since no header files are generated its function
* prototype should be copied into the the product that initializes the MIB.
*
*/
/*
****************************************************************************
* 2 CONFIGURATION
****************************************************************************
*/
/*
****************************************************************************
* 3 INCLUDE FILES
****************************************************************************
*/
#define IPCOM_USE_CLIB_PROTO
#include <ipcom_type.h>
#include <ipcom_cstyle.h>
#include <ipcom_clib.h>
#include <ipcom_syslog.h>
#include <ipcom_err.h>
#ifdef IPSNMP
#include <ipsnmp_config.h>
#include <ipsnmp.h>
#include "ipmip4_mib.h"
/*
****************************************************************************
* 4 DEFINES
****************************************************************************
*/
#ifdef IPCOM_SYSLOG_FACILITY
#undef IPCOM_SYSLOG_FACILITY
#endif
#define IPCOM_SYSLOG_FACILITY IPCOM_LOG_IPSNMP
#ifdef IPCOM_SYSLOG_PRIORITY
#undef IPCOM_SYSLOG_PRIORITY
#endif
#define IPCOM_SYSLOG_PRIORITY IPCOM_LOG_DEBUG
/*
****************************************************************************
* 5 TYPES
****************************************************************************
*/
/*
****************************************************************************
* 6 EXTERNAL PROTOTYPES
****************************************************************************
*/
/*
****************************************************************************
* 7 LOCAL PROTOTYPES
****************************************************************************
*/
/* Initialization function */
IP_PUBLIC Ip_err ipmip4_mip_mib_init(void);
/*
****************************************************************************
* 8 DATA
****************************************************************************
*/
/*
****************************************************************************
* 9 STATIC FUNCTIONS
****************************************************************************
*/
#define IPMIP4_MIB_GET1(var) \
var = ipmip4_attr_mib_##var();
#define IPMIP4_MIB_GET(var, strct) \
{ \
struct Ipmip4_mib_##strct *entry = ipmip4_attr_mib_##strct(); \
if (entry) \
{ \
var = entry->var; \
ipcom_free(entry); \
} \
}
#define IPMIP4_MIB_GET_TABLE_LEN(table, len) \
{ \
struct Ipmip4_mib_##table **hdr = ipmip4_attr_mib_##table(); \
int ii = 0; \
if (hdr) \
{ \
for (ii = 0; hdr[ii] != IP_NULL; ii++) \
; \
ipcom_free(hdr); \
} \
len = ii; \
}
#define IPMIP4_MIB_GET_ENTRY2(table, var, i, dest) \
{ \
struct Ipmip4_mib_##table **hdr = ipmip4_attr_mib_##table(); \
if (hdr) \
{ \
dest = hdr[i]->var; \
ipcom_free(hdr); \
} \
}
#define IPMIP4_MIB_GET_ENTRY(table, var, i) \
IPMIP4_MIB_GET_ENTRY2(table, var, i, var)
#define IPMIP4_MIB_GET_ENTRY_ADDR(table, var, i) \
IPMIP4_MIB_GET_ENTRY2(table, var.s_addr, i, var)
#if 0
/*
*===========================================================================
* ipmip4_mip_mib_handler_mipEntities
*===========================================================================
* Description: MIB handler for mipEntities
* Parameters: See file 'ipsnmp.h'
* Returns: IPSNMP_ERROR_XXX
*
*/
IP_STATIC Ip_s32
ipmip4_mip_mib_handler_mipEntities(Ip_s32 cmd,
char *id,
Ipsnmp_varbind *vb,
Ip_s32 magic,
struct Ipsnmp_node_object *nodeobj)
{
Ip_s32 ret = -1;
char *mipEntities = "";
char *iid;
(void)id;
(void)vb;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
iid = ipsnmp_create_iid_integer(nodeobj->id, 0);
if(iid == IP_NULL)
return IPSNMP_ERROR_GENERROR;
/*
*
* mipEntities := Current_MIB_Variable_mipEntities
*/
IPMIP4_MIB_GET1(mipEntities)
ret = ipsnmp_util_put_bitstring(magic, iid, mipEntities);
ipcom_free(iid);
}
return ret;
}
/*
*===========================================================================
* ipmip4_mip_mib_handler_mipEnable
*===========================================================================
* Description: MIB handler for mipEnable
* Parameters: See file 'ipsnmp.h'
* Returns: IPSNMP_ERROR_XXX
*
*/
IP_STATIC Ip_s32
ipmip4_mip_mib_handler_mipEnable(Ip_s32 cmd,
char *id,
Ipsnmp_varbind *vb,
Ip_s32 magic,
struct Ipsnmp_node_object *nodeobj)
{
Ip_s32 ret = -1;
Ip_s32 mipEnable = 0;
char *iid;
(void)id;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
iid = ipsnmp_create_iid_integer(nodeobj->id, 0);
if(iid == IP_NULL)
return IPSNMP_ERROR_GENERROR;
/*
*
* mipEnable := Current_MIB_Variable_mipEnable
*/
IPMIP4_MIB_GET1(mipEnable)
ret = ipsnmp_util_put_integer(magic, iid, mipEnable);
ipcom_free(iid);
}
if(cmd == IPSNMP_MIB_COMMAND_TEST || cmd == IPSNMP_MIB_COMMAND_SET)
{
ret = ipsnmp_util_get_integer(vb, &mipEnable);
if(ret == IPSNMP_ERROR_NOERROR)
{
/* todo
*
* if New_Value_Of_MIB_Variable_mipEnable_Is_Invalid = true then
* ret := IPSNMP_ERROR_WRONGVALUE
* endif
*/
ret = IPSNMP_ERROR_READONLY;
}
if(ret == IPSNMP_ERROR_NOERROR && cmd == IPSNMP_MIB_COMMAND_SET)
{
/* todo
*
* Current_MIB_Variable_mipEnable := mipEnable
*/
ret = IPSNMP_ERROR_READONLY;
}
}
return ret;
}
#endif
#if 0
/*
*===========================================================================
* ipmip4_mip_mib_handler_mipEncapsulationSupported
*===========================================================================
* Description: MIB handler for mipEncapsulationSupported
* Parameters: See file 'ipsnmp.h'
* Returns: IPSNMP_ERROR_XXX
*
*/
IP_STATIC Ip_s32
ipmip4_mip_mib_handler_mipEncapsulationSupported(Ip_s32 cmd,
char *id,
Ipsnmp_varbind *vb,
Ip_s32 magic,
struct Ipsnmp_node_object *nodeobj)
{
Ip_s32 ret = -1;
char *mipEncapsulationSupported = "";
char *iid;
(void)id;
(void)vb;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
iid = ipsnmp_create_iid_integer(nodeobj->id, 0);
if(iid == IP_NULL)
return IPSNMP_ERROR_GENERROR;
/*
*
* mipEncapsulationSupported := Current_MIB_Variable_mipEncapsulationSupported
*/
{
unsigned char es[2] = {(1<<7)|(1<<6)|(1<<5), 0}; /* !!! done wrong */
mipEncapsulationSupported = es;
}
ret = ipsnmp_util_put_bitstring(magic, iid, mipEncapsulationSupported);
ipcom_free(iid);
}
return ret;
}
#endif
#if 0
/*
*===========================================================================
* ipmip4_mip_mib_handler_mipSecTotalViolations
*===========================================================================
* Description: MIB handler for mipSecTotalViolations
* Parameters: See file 'ipsnmp.h'
* Returns: IPSNMP_ERROR_XXX
*
*/
IP_STATIC Ip_s32
ipmip4_mip_mib_handler_mipSecTotalViolations(Ip_s32 cmd,
char *id,
Ipsnmp_varbind *vb,
Ip_s32 magic,
struct Ipsnmp_node_object *nodeobj)
{
Ip_s32 ret = -1;
Ip_u32 mipSecTotalViolations = 0;
char *iid;
(void)id;
(void)vb;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
iid = ipsnmp_create_iid_integer(nodeobj->id, 0);
if(iid == IP_NULL)
return IPSNMP_ERROR_GENERROR;
/*
*
* mipSecTotalViolations := Current_MIB_Variable_mipSecTotalViolations
*/
IPMIP4_MIB_GET1(mipSecTotalViolations)
ret = ipsnmp_util_put_counter32(magic, iid, mipSecTotalViolations);
ipcom_free(iid);
}
return ret;
}
/*
*===========================================================================
* ipmip4_mip_mib_handler_maAdvertisementsSent
*===========================================================================
* Description: MIB handler for maAdvertisementsSent
* Parameters: See file 'ipsnmp.h'
* Returns: IPSNMP_ERROR_XXX
*
*/
IP_STATIC Ip_s32
ipmip4_mip_mib_handler_maAdvertisementsSent(Ip_s32 cmd,
char *id,
Ipsnmp_varbind *vb,
Ip_s32 magic,
struct Ipsnmp_node_object *nodeobj)
{
Ip_s32 ret = -1;
Ip_u32 maAdvertisementsSent = 0;
char *iid;
(void)id;
(void)vb;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
iid = ipsnmp_create_iid_integer(nodeobj->id, 0);
if(iid == IP_NULL)
return IPSNMP_ERROR_GENERROR;
/*
*
* maAdvertisementsSent := Current_MIB_Variable_maAdvertisementsSent
*/
IPMIP4_MIB_GET(maAdvertisement, maAdvertisementsSent)
ret = ipsnmp_util_put_counter32(magic, iid, maAdvertisementsSent);
ipcom_free(iid);
}
return ret;
}
/*
*===========================================================================
* ipmip4_mip_mib_handler_maAdvsSentForSolicitation
*===========================================================================
* Description: MIB handler for maAdvsSentForSolicitation
* Parameters: See file 'ipsnmp.h'
* Returns: IPSNMP_ERROR_XXX
*
*/
IP_STATIC Ip_s32
ipmip4_mip_mib_handler_maAdvsSentForSolicitation(Ip_s32 cmd,
char *id,
Ipsnmp_varbind *vb,
Ip_s32 magic,
struct Ipsnmp_node_object *nodeobj)
{
Ip_s32 ret = -1;
Ip_u32 maAdvsSentForSolicitation = 0;
char *iid;
(void)id;
(void)vb;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
iid = ipsnmp_create_iid_integer(nodeobj->id, 0);
if(iid == IP_NULL)
return IPSNMP_ERROR_GENERROR;
/*
*
* maAdvsSentForSolicitation := Current_MIB_Variable_maAdvsSentForSolicitation
*/
IPMIP4_MIB_GET(maAdvertisement, maAdvsSentForSolicitation)
ret = ipsnmp_util_put_counter32(magic, iid, maAdvsSentForSolicitation);
ipcom_free(iid);
}
return ret;
}
/*
*===========================================================================
* ipmip4_mip_mib_handler_maSolicitationsReceived
*===========================================================================
* Description: MIB handler for maSolicitationsReceived
* Parameters: See file 'ipsnmp.h'
* Returns: IPSNMP_ERROR_XXX
*
*/
IP_STATIC Ip_s32
ipmip4_mip_mib_handler_maSolicitationsReceived(Ip_s32 cmd,
char *id,
Ipsnmp_varbind *vb,
Ip_s32 magic,
struct Ipsnmp_node_object *nodeobj)
{
Ip_s32 ret = -1;
Ip_u32 maSolicitationsReceived = 0;
char *iid;
(void)id;
(void)vb;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
iid = ipsnmp_create_iid_integer(nodeobj->id, 0);
if(iid == IP_NULL)
return IPSNMP_ERROR_GENERROR;
/*
*
* maSolicitationsReceived := Current_MIB_Variable_maSolicitationsReceived
*/
IPMIP4_MIB_GET(maAdvertisement,maSolicitationsReceived)
ret = ipsnmp_util_put_counter32(magic, iid, maSolicitationsReceived);
ipcom_free(iid);
}
return ret;
}
/*
*===========================================================================
* ipmip4_mip_mib_table_search_maAdvConfigTable
*===========================================================================
* Description: Searches maAdvConfigTable for a matching entry
* Parameters: id, buf, best, cmd
* Returns: Row index of the found entry OR -1 if not found OR -2 for error
*
*/
IP_STATIC Ip_s32
ipmip4_mip_mib_table_search_maAdvConfigTable(char *id,
char *buf,
char *best,
Ip_s32 cmd)
{
Ip_u32 maInterfaceAddress = 0;
Ip_s32 maAdvConfigTable_num_entries = 0;
Ip_s32 i, bestindex = -1;
/*
*
* maAdvConfigTable_num_entries := Number_Of_Entries_In_Current_maAdvConfigTable
*/
IPMIP4_MIB_GET_TABLE_LEN(maAdvConfigEntry,maAdvConfigTable_num_entries)
for(i=0; i<maAdvConfigTable_num_entries; i++)
{
Ip_s32 lex, len = 0;
buf[0] = '\0';
/*
*
* maInterfaceAddress := Current_MIB_Variable_maInterfaceAddress in row no. i
*/
IPMIP4_MIB_GET_ENTRY_ADDR(maAdvConfigEntry, maInterfaceAddress, i)
if(ipcom_inet_ntop(IP_AF_INET, &maInterfaceAddress, &buf[len], IPSNMP_CONFIG_MAX_OBJECT_ID-len) == IP_NULL)
return -2;
len = ipcom_strlen(buf);
if(ipcom_snprintf(&buf[len], IPSNMP_CONFIG_MAX_OBJECT_ID-len, ".") < 0)
return -2;
len = ipcom_strlen(buf);
if(len)
buf[len-1] = '\0';
lex = ipsnmp_util_lexcmp_oid(buf, id);
if(cmd == IPSNMP_MIB_COMMAND_NEXT)
{
if(lex > 0)
{
if(bestindex == -1 || ipsnmp_util_lexcmp_oid(buf, best) < 0)
{
ipcom_strcpy(best, buf);
bestindex = i;
}
}
}
else
{
if(lex == 0)
{
ipcom_strcpy(best, buf);
bestindex = i;
break;
}
}
}
return bestindex;
}
/*
*===========================================================================
* ipmip4_mip_mib_handler_mipSecAssocTable
*===========================================================================
* Description: MIB handler for mipSecAssocTable
* Parameters: See file 'ipsnmp.h'
* Returns: IPSNMP_ERROR_XXX
*
*/
IP_STATIC Ip_s32
ipmip4_mip_mib_handler_mipSecAssocTable(Ip_s32 cmd,
char *id,
Ipsnmp_varbind *vb,
Ip_s32 magic,
struct Ipsnmp_node_object *nodeobj)
{
Ip_s32 lid, bestindex, ret = -1;
char *iid = IP_NULL;
char *buf = ipcom_malloc(IPSNMP_CONFIG_MAX_OBJECT_ID);
char *best = ipcom_malloc(IPSNMP_CONFIG_MAX_OBJECT_ID);
if(buf == IP_NULL || best == IP_NULL)
{
ret = IPSNMP_ERROR_GENERROR;
goto exit;
}
lid = ipsnmp_util_last_subid(nodeobj->id);
bestindex = ipmip4_mip_mib_table_search_mipSecAssocTable(id, buf, best, cmd);
if(bestindex == -2)
{
ret = IPSNMP_ERROR_GENERROR;
goto exit;
}
else if(bestindex == -1)
{
ret = IPSNMP_ERROR_NOSUCHNAME;
goto exit;
}
iid = ipsnmp_create_iid_direct(nodeobj->id, best);
if(iid == IP_NULL)
{
ret = IPSNMP_ERROR_GENERROR;
goto exit;
}
switch(lid)
{
case 3: /* mipSecAlgorithmType */
{
Ip_s32 mipSecAlgorithmType = 0;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
/*
*
* mipSecAlgorithmType := Current_MIB_Variable_mipSecAlgorithmType in row no. bestindex
*/
IPMIP4_MIB_GET_ENTRY(mipSecAssocEntry, mipSecAlgorithmType, bestindex)
ret = ipsnmp_util_put_integer(magic, iid, mipSecAlgorithmType);
}
if(cmd == IPSNMP_MIB_COMMAND_TEST || cmd == IPSNMP_MIB_COMMAND_SET)
{
ret = ipsnmp_util_get_integer(vb, &mipSecAlgorithmType);
if(ret == IPSNMP_ERROR_NOERROR)
{
/* todo
*
* if New_Value_Of_MIB_Variable_mipSecAlgorithmType_Is_Invalid = true then
* ret := IPSNMP_ERROR_WRONGVALUE
* endif
*/
ret = IPSNMP_ERROR_READONLY;
}
if(ret == IPSNMP_ERROR_NOERROR && cmd == IPSNMP_MIB_COMMAND_SET)
{
/* todo
*
* Current_MIB_Variable_mipSecAlgorithmType in row no. bestindex := mipSecAlgorithmType
*/
ret = IPSNMP_ERROR_READONLY;
}
}
break;
}
case 4: /* mipSecAlgorithmMode */
{
Ip_s32 mipSecAlgorithmMode = 0;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
/*
*
* mipSecAlgorithmMode := Current_MIB_Variable_mipSecAlgorithmMode in row no. bestindex
*/
IPMIP4_MIB_GET_ENTRY(mipSecAssocEntry, mipSecAlgorithmMode, bestindex)
ret = ipsnmp_util_put_integer(magic, iid, mipSecAlgorithmMode);
}
if(cmd == IPSNMP_MIB_COMMAND_TEST || cmd == IPSNMP_MIB_COMMAND_SET)
{
ret = ipsnmp_util_get_integer(vb, &mipSecAlgorithmMode);
if(ret == IPSNMP_ERROR_NOERROR)
{
/*
*
* if New_Value_Of_MIB_Variable_mipSecAlgorithmMode_Is_Invalid = true then
* ret := IPSNMP_ERROR_WRONGVALUE
* endif
*/
ret = IPSNMP_ERROR_READONLY;
}
if(ret == IPSNMP_ERROR_NOERROR && cmd == IPSNMP_MIB_COMMAND_SET)
{
/* todo
*
* Current_MIB_Variable_mipSecAlgorithmMode in row no. bestindex := mipSecAlgorithmMode
*/
ret = IPSNMP_ERROR_READONLY;
}
}
break;
}
case 5: /* mipSecKey */
{
Ip_u8 *mipSecKey = (Ip_u8 *)"";
Ip_s32 len = 0;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
/*
*
* mipSecKey := Current_MIB_Variable_mipSecKey in row no. bestindex
* len := Length_Of_Current_MIB_Variable_mipSecKey
*/
IPMIP4_MIB_GET_ENTRY(mipSecAssocEntry, mipSecKey, bestindex);
len = ipcom_strlen(mipSecKey);
ret = ipsnmp_util_put_octetstring(magic, iid, mipSecKey, len);
}
if(cmd == IPSNMP_MIB_COMMAND_TEST || cmd == IPSNMP_MIB_COMMAND_SET)
{
/* todo
*
* len := Maximum_Size_Of_MIB_Variable_mipSecKey
* mipSecKey := Allocate(len)
* if Allocation_Failed = true then
* ret := IPSNMP_ERROR_GENERROR
* goto exit;
* endif
*/
ret = IPSNMP_ERROR_READONLY;
ret = ipsnmp_util_get_octetstring(vb, mipSecKey, &len);
if(ret == IPSNMP_ERROR_NOERROR)
{
/*
*
* if New_Value_Of_MIB_Variable_mipSecKey_Is_Invalid = true then
* ret := IPSNMP_ERROR_WRONGVALUE
* endif
*/
ret = IPSNMP_ERROR_READONLY;
}
if(ret == IPSNMP_ERROR_NOERROR && cmd == IPSNMP_MIB_COMMAND_SET)
{
/*
*
* Copy(Current_MIB_Variable_mipSecKey in row no. bestindex, mipSecKey)
*/
ret = IPSNMP_ERROR_READONLY;
}
/* todo
*
* Free(mipSecKey)
*/
}
break;
}
case 6: /* mipSecReplayMethod */
{
Ip_s32 mipSecReplayMethod = 0;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
/*
*
* mipSecReplayMethod := Current_MIB_Variable_mipSecReplayMethod in row no. bestindex
*/
IPMIP4_MIB_GET_ENTRY(mipSecAssocEntry,mipSecReplayMethod,bestindex)
ret = ipsnmp_util_put_integer(magic, iid, mipSecReplayMethod);
}
if(cmd == IPSNMP_MIB_COMMAND_TEST || cmd == IPSNMP_MIB_COMMAND_SET)
{
ret = ipsnmp_util_get_integer(vb, &mipSecReplayMethod);
if(ret == IPSNMP_ERROR_NOERROR)
{
/* todo
*
* if New_Value_Of_MIB_Variable_mipSecReplayMethod_Is_Invalid = true then
* ret := IPSNMP_ERROR_WRONGVALUE
* endif
*/
ret = IPSNMP_ERROR_READONLY;
}
if(ret == IPSNMP_ERROR_NOERROR && cmd == IPSNMP_MIB_COMMAND_SET)
{
/* todo
*
* Current_MIB_Variable_mipSecReplayMethod in row no. bestindex := mipSecReplayMethod
*/
}
}
break;
}
default:
IP_PANIC();
ret = IPSNMP_ERROR_GENERROR;
break;
}
exit:
if(iid != IP_NULL)
ipcom_free(iid);
if(buf != IP_NULL)
ipcom_free(buf);
if(best != IP_NULL)
ipcom_free(best);
return ret;
}
/*
*===========================================================================
* ipmip4_mip_mib_table_search_mipSecAssocTable
*===========================================================================
* Description: Searches mipSecAssocTable for a matching entry
* Parameters: id, buf, best, cmd
* Returns: Row index of the found entry OR -1 if not found OR -2 for error
*
*/
IP_STATIC Ip_s32
ipmip4_mip_mib_table_search_mipSecAssocTable(char *id,
char *buf,
char *best,
Ip_s32 cmd)
{
Ip_u32 mipSecPeerAddress = 0;
Ip_u32 mipSecSPI = 0;
Ip_s32 mipSecAssocTable_num_entries = 0;
Ip_s32 i, bestindex = -1;
/*
*
* mipSecAssocTable_num_entries := Number_Of_Entries_In_Current_mipSecAssocTable
*/
IPMIP4_MIB_GET_TABLE_LEN(Ipmip4_mib_mipSecAssocEntry, mipSecAssocTable_num_entries)
for(i=0; i<mipSecAssocTable_num_entries; i++)
{
Ip_s32 lex, len = 0;
buf[0] = '\0';
/*
*
* mipSecPeerAddress := Current_MIB_Variable_mipSecPeerAddress in row no. i
*/
IPMIP4_MIB_GET_ENTRY_ADDR(mipSecAssocEntry, mipSecPeerAddress, i)
if(ipcom_inet_ntop(IP_AF_INET, &mipSecPeerAddress, &buf[len], IPSNMP_CONFIG_MAX_OBJECT_ID-len) == IP_NULL)
return -2;
len = ipcom_strlen(buf);
if(ipcom_snprintf(&buf[len], IPSNMP_CONFIG_MAX_OBJECT_ID-len, ".") < 0)
return -2;
len = ipcom_strlen(buf);
/*
*
* mipSecSPI := Current_MIB_Variable_mipSecSPI in row no. i
*/
IPMIP4_MIB_GET_ENTRY(mipSecAssocEntry, mipSecSPI, i)
if(ipcom_snprintf(&buf[len], IPSNMP_CONFIG_MAX_OBJECT_ID-len, "%d.", mipSecSPI) < 0)
return -2;
len = ipcom_strlen(buf);
if(len)
buf[len-1] = '\0';
lex = ipsnmp_util_lexcmp_oid(buf, id);
if(cmd == IPSNMP_MIB_COMMAND_NEXT)
{
if(lex > 0)
{
if(bestindex == -1 || ipsnmp_util_lexcmp_oid(buf, best) < 0)
{
ipcom_strcpy(best, buf);
bestindex = i;
}
}
}
else
{
if(lex == 0)
{
ipcom_strcpy(best, buf);
bestindex = i;
break;
}
}
}
return bestindex;
}
/*
*===========================================================================
* ipmip4_mip_mib_handler_mipSecViolationTable
*===========================================================================
* Description: MIB handler for mipSecViolationTable
* Parameters: See file 'ipsnmp.h'
* Returns: IPSNMP_ERROR_XXX
*
*/
IP_STATIC Ip_s32
ipmip4_mip_mib_handler_mipSecViolationTable(Ip_s32 cmd,
char *id,
Ipsnmp_varbind *vb,
Ip_s32 magic,
struct Ipsnmp_node_object *nodeobj)
{
Ip_s32 lid, bestindex, ret = -1;
char *iid = IP_NULL;
char *buf = ipcom_malloc(IPSNMP_CONFIG_MAX_OBJECT_ID);
char *best = ipcom_malloc(IPSNMP_CONFIG_MAX_OBJECT_ID);
if(buf == IP_NULL || best == IP_NULL)
{
ret = IPSNMP_ERROR_GENERROR;
goto exit;
}
lid = ipsnmp_util_last_subid(nodeobj->id);
bestindex = ipmip4_mip_mib_table_search_mipSecViolationTable(id, buf, best, cmd);
if(bestindex == -2)
{
ret = IPSNMP_ERROR_GENERROR;
goto exit;
}
else if(bestindex == -1)
{
ret = IPSNMP_ERROR_NOSUCHNAME;
goto exit;
}
iid = ipsnmp_create_iid_direct(nodeobj->id, best);
if(iid == IP_NULL)
{
ret = IPSNMP_ERROR_GENERROR;
goto exit;
}
switch(lid)
{
case 1: /* mipSecViolatorAddress */
{
Ip_u32 mipSecViolatorAddress = 0;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
/*
*
* mipSecViolatorAddress := Current_MIB_Variable_mipSecViolatorAddress in row no. bestindex
*/
IPMIP4_MIB_GET_ENTRY_ADDR(mipSecViolationEntry, mipSecViolatorAddress, bestindex)
ret = ipsnmp_util_put_ipaddress(magic, iid, mipSecViolatorAddress);
}
break;
}
case 2: /* mipSecViolationCounter */
{
Ip_u32 mipSecViolationCounter = 0;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
/*
*
* mipSecViolationCounter := Current_MIB_Variable_mipSecViolationCounter in row no. bestindex
*/
IPMIP4_MIB_GET_ENTRY(mipSecViolationEntry, mipSecViolationCounter, bestindex)
ret = ipsnmp_util_put_counter32(magic, iid, mipSecViolationCounter);
}
break;
}
case 3: /* mipSecRecentViolationSPI */
{
Ip_s32 mipSecRecentViolationSPI = 0;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
/*
*
* mipSecRecentViolationSPI := Current_MIB_Variable_mipSecRecentViolationSPI in row no. bestindex
*/
IPMIP4_MIB_GET_ENTRY(mipSecViolationEntry, mipSecRecentViolationSPI, bestindex)
ret = ipsnmp_util_put_integer(magic, iid, mipSecRecentViolationSPI);
}
break;
}
case 4: /* mipSecRecentViolationTime */
{
Ip_u32 mipSecRecentViolationTime = 0;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
/*
*
* mipSecRecentViolationTime := Current_MIB_Variable_mipSecRecentViolationTime in row no. bestindex
*/
IPMIP4_MIB_GET_ENTRY(mipSecViolationEntry, mipSecRecentViolationTime, bestindex)
ret = ipsnmp_util_put_timeticks(magic, iid, mipSecRecentViolationTime);
}
break;
}
case 5: /* mipSecRecentViolationIDLow */
{
Ip_s32 mipSecRecentViolationIDLow = 0;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
/*
*
* mipSecRecentViolationIDLow := Current_MIB_Variable_mipSecRecentViolationIDLow in row no. bestindex
*/
IPMIP4_MIB_GET_ENTRY(mipSecViolationEntry, mipSecRecentViolationIDLow, bestindex)
ret = ipsnmp_util_put_integer(magic, iid, mipSecRecentViolationIDLow);
}
break;
}
case 6: /* mipSecRecentViolationIDHigh */
{
Ip_s32 mipSecRecentViolationIDHigh = 0;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
/*
*
* mipSecRecentViolationIDHigh := Current_MIB_Variable_mipSecRecentViolationIDHigh in row no. bestindex
*/
IPMIP4_MIB_GET_ENTRY(mipSecViolationEntry, mipSecRecentViolationIDHigh, bestindex)
ret = ipsnmp_util_put_integer(magic, iid, mipSecRecentViolationIDHigh);
}
break;
}
case 7: /* mipSecRecentViolationReason */
{
Ip_s32 mipSecRecentViolationReason = 0;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
/*
*
* mipSecRecentViolationReason := Current_MIB_Variable_mipSecRecentViolationReason in row no. bestindex
*/
IPMIP4_MIB_GET_ENTRY(mipSecViolationEntry, mipSecRecentViolationReason, bestindex)
ret = ipsnmp_util_put_integer(magic, iid, mipSecRecentViolationReason);
}
break;
}
default:
IP_PANIC();
ret = IPSNMP_ERROR_GENERROR;
break;
}
exit:
if(iid != IP_NULL)
ipcom_free(iid);
if(buf != IP_NULL)
ipcom_free(buf);
if(best != IP_NULL)
ipcom_free(best);
return ret;
}
/*
*===========================================================================
* ipmip4_mip_mib_handler_maAdvConfigTable
*===========================================================================
* Description: MIB handler for maAdvConfigTable
* Parameters: See file 'ipsnmp.h'
* Returns: IPSNMP_ERROR_XXX
*
*/
IP_STATIC Ip_s32
ipmip4_mip_mib_handler_maAdvConfigTable(Ip_s32 cmd,
char *id,
Ipsnmp_varbind *vb,
Ip_s32 magic,
struct Ipsnmp_node_object *nodeobj)
{
Ip_s32 lid, bestindex, ret = -1;
char *iid = IP_NULL;
char *buf = ipcom_malloc(IPSNMP_CONFIG_MAX_OBJECT_ID);
char *best = ipcom_malloc(IPSNMP_CONFIG_MAX_OBJECT_ID);
if(buf == IP_NULL || best == IP_NULL)
{
ret = IPSNMP_ERROR_GENERROR;
goto exit;
}
lid = ipsnmp_util_last_subid(nodeobj->id);
bestindex = ipmip4_mip_mib_table_search_maAdvConfigTable(id, buf, best, cmd);
if(bestindex == -2)
{
ret = IPSNMP_ERROR_GENERROR;
goto exit;
}
else if(bestindex == -1)
{
ret = IPSNMP_ERROR_NOSUCHNAME;
goto exit;
}
iid = ipsnmp_create_iid_direct(nodeobj->id, best);
if(iid == IP_NULL)
{
ret = IPSNMP_ERROR_GENERROR;
goto exit;
}
switch(lid)
{
case 2: /* maAdvMaxRegLifetime */
{
Ip_s32 maAdvMaxRegLifetime = 0;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
/* MIB_TODO - Implement the following pseudo code here:
*
*
*/
IPMIP4_MIB_GET_ENTRY(maAdvConfigEntry, maAdvMaxRegLifetime, bestindex)
ret = ipsnmp_util_put_integer(magic, iid, maAdvMaxRegLifetime);
}
if(cmd == IPSNMP_MIB_COMMAND_TEST || cmd == IPSNMP_MIB_COMMAND_SET)
{
ret = ipsnmp_util_get_integer(vb, &maAdvMaxRegLifetime);
if(ret == IPSNMP_ERROR_NOERROR)
{
/* todo
*
* if New_Value_Of_MIB_Variable_maAdvMaxRegLifetime_Is_Invalid = true then
* ret := IPSNMP_ERROR_WRONGVALUE
* endif
*/
ret = IPSNMP_ERROR_READONLY;
}
if(ret == IPSNMP_ERROR_NOERROR && cmd == IPSNMP_MIB_COMMAND_SET)
{
/* todo
*
* Current_MIB_Variable_maAdvMaxRegLifetime in row no. bestindex := maAdvMaxRegLifetime
*/
ret = IPSNMP_ERROR_READONLY;
}
}
break;
}
case 3: /* maAdvPrefixLengthInclusion */
{
Ip_s32 maAdvPrefixLengthInclusion = 0;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
/*
*
* maAdvPrefixLengthInclusion := Current_MIB_Variable_maAdvPrefixLengthInclusion in row no. bestindex
*/
IPMIP4_MIB_GET_ENTRY(maAdvConfigEntry,maAdvPrefixLengthInclusion,bestindex)
ret = ipsnmp_util_put_integer(magic, iid, maAdvPrefixLengthInclusion);
}
if(cmd == IPSNMP_MIB_COMMAND_TEST || cmd == IPSNMP_MIB_COMMAND_SET)
{
ret = ipsnmp_util_get_integer(vb, &maAdvPrefixLengthInclusion);
if(ret == IPSNMP_ERROR_NOERROR)
{
/* todo
*
* if New_Value_Of_MIB_Variable_maAdvPrefixLengthInclusion_Is_Invalid = true then
* ret := IPSNMP_ERROR_WRONGVALUE
* endif
*/
ret=IPSNMP_ERROR_READONLY;
}
if(ret == IPSNMP_ERROR_NOERROR && cmd == IPSNMP_MIB_COMMAND_SET)
{
/* todo
*
* Current_MIB_Variable_maAdvPrefixLengthInclusion in row no. bestindex := maAdvPrefixLengthInclusion
*/
ret=IPSNMP_ERROR_READONLY;
}
}
break;
}
case 4: /* maAdvAddress */
{
Ip_u32 maAdvAddress = 0;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
/*
*
* maAdvAddress := Current_MIB_Variable_maAdvAddress in row no. bestindex
*/
IPMIP4_MIB_GET_ENTRY(maAdvConfigEntry,maAdvAddress,bestindex)
ret = ipsnmp_util_put_ipaddress(magic, iid, maAdvAddress);
}
if(cmd == IPSNMP_MIB_COMMAND_TEST || cmd == IPSNMP_MIB_COMMAND_SET)
{
ret = ipsnmp_util_get_ipaddress(vb, &maAdvAddress);
if(ret == IPSNMP_ERROR_NOERROR)
{
/* todo
*
* if New_Value_Of_MIB_Variable_maAdvAddress_Is_Invalid = true then
* ret := IPSNMP_ERROR_WRONGVALUE
* endif
*/
ret=IPSNMP_ERROR_READONLY;
}
if(ret == IPSNMP_ERROR_NOERROR && cmd == IPSNMP_MIB_COMMAND_SET)
{
/* todo
*
* Current_MIB_Variable_maAdvAddress in row no. bestindex := maAdvAddress
*/
ret=IPSNMP_ERROR_READONLY;
}
}
break;
}
case 5: /* maAdvMaxInterval */
{
Ip_s32 maAdvMaxInterval = 0;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
/*
*
* maAdvMaxInterval := Current_MIB_Variable_maAdvMaxInterval in row no. bestindex
*/
IPMIP4_MIB_GET_ENTRY(maAdvConfigEntry,maAdvMaxInterval,bestindex)
ret = ipsnmp_util_put_integer(magic, iid, maAdvMaxInterval);
}
if(cmd == IPSNMP_MIB_COMMAND_TEST || cmd == IPSNMP_MIB_COMMAND_SET)
{
ret = ipsnmp_util_get_integer(vb, &maAdvMaxInterval);
if(ret == IPSNMP_ERROR_NOERROR)
{
/* todo
*
* if New_Value_Of_MIB_Variable_maAdvMaxInterval_Is_Invalid = true then
* ret := IPSNMP_ERROR_WRONGVALUE
* endif
*/
ret=IPSNMP_ERROR_READONLY;
}
if(ret == IPSNMP_ERROR_NOERROR && cmd == IPSNMP_MIB_COMMAND_SET)
{
/* todo
*
* Current_MIB_Variable_maAdvMaxInterval in row no. bestindex := maAdvMaxInterval
*/
ret=IPSNMP_ERROR_READONLY;
}
}
break;
}
case 6: /* maAdvMinInterval */
{
Ip_s32 maAdvMinInterval = 0;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
/*
*
* maAdvMinInterval := Current_MIB_Variable_maAdvMinInterval in row no. bestindex
*/
IPMIP4_MIB_GET_ENTRY(maAdvConfigEntry,maAdvMinInterval,bestindex)
ret = ipsnmp_util_put_integer(magic, iid, maAdvMinInterval);
}
if(cmd == IPSNMP_MIB_COMMAND_TEST || cmd == IPSNMP_MIB_COMMAND_SET)
{
ret = ipsnmp_util_get_integer(vb, &maAdvMinInterval);
if(ret == IPSNMP_ERROR_NOERROR)
{
/* todo
*
* if New_Value_Of_MIB_Variable_maAdvMinInterval_Is_Invalid = true then
* ret := IPSNMP_ERROR_WRONGVALUE
* endif
*/
ret=IPSNMP_ERROR_READONLY;
}
if(ret == IPSNMP_ERROR_NOERROR && cmd == IPSNMP_MIB_COMMAND_SET)
{
/* todo
*
* Current_MIB_Variable_maAdvMinInterval in row no. bestindex := maAdvMinInterval
*/
ret=IPSNMP_ERROR_READONLY;
}
}
break;
}
case 7: /* maAdvMaxAdvLifetime */
{
Ip_s32 maAdvMaxAdvLifetime = 0;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
/*
*
* maAdvMaxAdvLifetime := Current_MIB_Variable_maAdvMaxAdvLifetime in row no. bestindex
*/
IPMIP4_MIB_GET_ENTRY(maAdvConfigEntry,maAdvMaxAdvLifetime,bestindex)
ret = ipsnmp_util_put_integer(magic, iid, maAdvMaxAdvLifetime);
}
if(cmd == IPSNMP_MIB_COMMAND_TEST || cmd == IPSNMP_MIB_COMMAND_SET)
{
ret = ipsnmp_util_get_integer(vb, &maAdvMaxAdvLifetime);
if(ret == IPSNMP_ERROR_NOERROR)
{
/* todo
*
* if New_Value_Of_MIB_Variable_maAdvMaxAdvLifetime_Is_Invalid = true then
* ret := IPSNMP_ERROR_WRONGVALUE
* endif
*/
ret=IPSNMP_ERROR_READONLY;
}
if(ret == IPSNMP_ERROR_NOERROR && cmd == IPSNMP_MIB_COMMAND_SET)
{
/* todo
*
* Current_MIB_Variable_maAdvMaxAdvLifetime in row no. bestindex := maAdvMaxAdvLifetime
*/
ret=IPSNMP_ERROR_READONLY;
}
}
break;
}
case 8: /* maAdvResponseSolicitationOnly */
{
Ip_s32 maAdvResponseSolicitationOnly = 0;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
/*
*
* maAdvResponseSolicitationOnly := Current_MIB_Variable_maAdvResponseSolicitationOnly in row no. bestindex
*/
IPMIP4_MIB_GET_ENTRY(maAdvConfigEntry,maAdvResponseSolicitationOnly,bestindex)
ret = ipsnmp_util_put_integer(magic, iid, maAdvResponseSolicitationOnly);
}
if(cmd == IPSNMP_MIB_COMMAND_TEST || cmd == IPSNMP_MIB_COMMAND_SET)
{
ret = ipsnmp_util_get_integer(vb, &maAdvResponseSolicitationOnly);
if(ret == IPSNMP_ERROR_NOERROR)
{
/* todo
*
* if New_Value_Of_MIB_Variable_maAdvResponseSolicitationOnly_Is_Invalid = true then
* ret := IPSNMP_ERROR_WRONGVALUE
* endif
*/
ret=IPSNMP_ERROR_READONLY;
}
if(ret == IPSNMP_ERROR_NOERROR && cmd == IPSNMP_MIB_COMMAND_SET)
{
/* todo
*
* Current_MIB_Variable_maAdvResponseSolicitationOnly in row no. bestindex := maAdvResponseSolicitationOnly
*/
ret=IPSNMP_ERROR_READONLY;
}
}
break;
}
case 9: /* maAdvStatus */
{
Ip_s32 maAdvStatus = 0;
if(cmd == IPSNMP_MIB_COMMAND_GET || cmd == IPSNMP_MIB_COMMAND_NEXT)
{
/*
*
* maAdvStatus := Current_MIB_Variable_maAdvStatus in row no. bestindex
*/
IPMIP4_MIB_GET_ENTRY(maAdvConfigEntry,maAdvStatus,bestindex)
ret = ipsnmp_util_put_integer(magic, iid, maAdvStatus);
}
if(cmd == IPSNMP_MIB_COMMAND_TEST || cmd == IPSNMP_MIB_COMMAND_SET)
{
ret = ipsnmp_util_get_integer(vb, &maAdvStatus);
if(ret == IPSNMP_ERROR_NOERROR)
{
/* todo
*
* if New_Value_Of_MIB_Variable_maAdvStatus_Is_Invalid = true then
* ret := IPSNMP_ERROR_WRONGVALUE
* endif
*/
ret=IPSNMP_ERROR_READONLY;
}
if(ret == IPSNMP_ERROR_NOERROR && cmd == IPSNMP_MIB_COMMAND_SET)
{
/* todo
*
* Current_MIB_Variable_maAdvStatus in row no. bestindex := maAdvStatus
*/
ret=IPSNMP_ERROR_READONLY;
}
}
break;
}
default:
IP_PANIC();
ret = IPSNMP_ERROR_GENERROR;
break;
}
exit:
if(iid != IP_NULL)
ipcom_free(iid);
if(buf != IP_NULL)
ipcom_free(buf);
if(best != IP_NULL)
ipcom_free(best);
return ret;
}
#endif
/*
****************************************************************************
* 10 GLOBAL FUNCTIONS
****************************************************************************
*/
/*
****************************************************************************
* 11 PUBLIC FUNCTIONS
****************************************************************************
*/
/*
*===========================================================================
* ipmip4_mip_mib_init
*===========================================================================
* Description: Initializes MIP-MIB
* Parameters: None
* Returns: IPCOM_SUCCESS or IPCOM_ERR_FAILED
*
*/
IP_PUBLIC Ip_err
ipmip4_mip_mib_init(void)
{
/* Objects from MIP-MIB */
IP_STATIC IP_CONST struct Ipsnmp_node_object ipmip4_mip_mib_objects[] =
{
{ /* "mipMIB", */
"1.3.6.1.2.1.44",
"mipMIB",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_OTHER,
IP_NULL,
IP_NULL,
IP_NULL
},
{ /* "mipMIBObjects", */
"1.3.6.1.2.1.44.1",
"mipMIBObjects",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_OTHER,
IP_NULL,
IP_NULL,
IP_NULL
},
{ /* "mipSystem", */
"1.3.6.1.2.1.44.1.1",
"mipSystem",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_OTHER,
IP_NULL,
IP_NULL,
IP_NULL
},
{ /* "mipSecurity", */
"1.3.6.1.2.1.44.1.2",
"mipSecurity",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_OTHER,
IP_NULL,
IP_NULL,
IP_NULL
},
{ /* "mipMA", */
"1.3.6.1.2.1.44.1.4",
"mipMA",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_OTHER,
IP_NULL,
IP_NULL,
IP_NULL
},
{ /* "maAdvertisement", */
"1.3.6.1.2.1.44.1.4.2",
"maAdvertisement",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_OTHER,
IP_NULL,
IP_NULL,
IP_NULL
},
{ /* "mipMIBNotificationPrefix", */
"1.3.6.1.2.1.44.2",
"mipMIBNotificationPrefix",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_OTHER,
IP_NULL,
IP_NULL,
IP_NULL
},
{ /* "mipMIBNotifications", */
"1.3.6.1.2.1.44.2.0",
"mipMIBNotifications",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_OTHER,
IP_NULL,
IP_NULL,
IP_NULL
},
{ /* "mipMIBConformance", */
"1.3.6.1.2.1.44.3",
"mipMIBConformance",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_OTHER,
IP_NULL,
IP_NULL,
IP_NULL
},
{ /* "mipGroups", */
"1.3.6.1.2.1.44.3.1",
"mipGroups",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_OTHER,
IP_NULL,
IP_NULL,
IP_NULL
},
{ /* "mipCompliances", */
"1.3.6.1.2.1.44.3.2",
"mipCompliances",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_OTHER,
IP_NULL,
IP_NULL,
IP_NULL
},
#if 0
{ /* "mipEntities", */
"1.3.6.1.2.1.44.1.1.1",
"mipEntities",
IPSNMP_DATA_TYPE_BITS,
IPSNMP_NODE_ACCESS_READONLY,
IPSNMP_NODE_TYPE_SCALAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_mipEntities
},
{ /* "mipEnable", */
"1.3.6.1.2.1.44.1.1.2",
"mipEnable",
IPSNMP_DATA_TYPE_INTEGER,
IPSNMP_NODE_ACCESS_READWRITE,
IPSNMP_NODE_TYPE_SCALAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_mipEnable
},
#endif
#if 0
{ /* "mipEncapsulationSupported", */
"1.3.6.1.2.1.44.1.1.3",
"mipEncapsulationSupported",
IPSNMP_DATA_TYPE_BITS,
IPSNMP_NODE_ACCESS_READONLY,
IPSNMP_NODE_TYPE_SCALAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_mipEncapsulationSupported
},
#endif
{ /* "mipSecAssocTable", */
"1.3.6.1.2.1.44.1.2.1",
"mipSecAssocTable",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_AGGREGATE,
IP_NULL,
IP_NULL,
IP_NULL
},
#if 0
{ /* "mipSecAssocEntry", */
"1.3.6.1.2.1.44.1.2.1.1",
"mipSecAssocEntry",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_AGGREGATE,
IP_NULL,
IP_NULL,
IP_NULL
},
#endif
{ /* "mipSecPeerAddress", */
"1.3.6.1.2.1.44.1.2.1.1.1",
"mipSecPeerAddress",
IPSNMP_DATA_TYPE_IPADDRESS,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
IP_NULL
},
{ /* "mipSecSPI", */
"1.3.6.1.2.1.44.1.2.1.1.2",
"mipSecSPI",
IPSNMP_DATA_TYPE_GAUGE32,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
IP_NULL
},
#if 0
{ /* "mipSecAlgorithmType", */
"1.3.6.1.2.1.44.1.2.1.1.3",
"mipSecAlgorithmType",
IPSNMP_DATA_TYPE_INTEGER,
IPSNMP_NODE_ACCESS_READCREATE,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_mipSecAssocTable
},
{ /* "mipSecAlgorithmMode", */
"1.3.6.1.2.1.44.1.2.1.1.4",
"mipSecAlgorithmMode",
IPSNMP_DATA_TYPE_INTEGER,
IPSNMP_NODE_ACCESS_READCREATE,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_mipSecAssocTable
},
{ /* "mipSecKey", */
"1.3.6.1.2.1.44.1.2.1.1.5",
"mipSecKey",
IPSNMP_DATA_TYPE_OCTETSTRING,
IPSNMP_NODE_ACCESS_READCREATE,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_mipSecAssocTable
},
{ /* "mipSecReplayMethod", */
"1.3.6.1.2.1.44.1.2.1.1.6",
"mipSecReplayMethod",
IPSNMP_DATA_TYPE_INTEGER,
IPSNMP_NODE_ACCESS_READCREATE,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_mipSecAssocTable
},
{ /* "mipSecTotalViolations", */
"1.3.6.1.2.1.44.1.2.2",
"mipSecTotalViolations",
IPSNMP_DATA_TYPE_COUNTER32,
IPSNMP_NODE_ACCESS_READONLY,
IPSNMP_NODE_TYPE_SCALAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_mipSecTotalViolations
},
#endif
{ /* "mipSecViolationTable", */
"1.3.6.1.2.1.44.1.2.3",
"mipSecViolationTable",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_AGGREGATE,
IP_NULL,
IP_NULL,
IP_NULL
},
{ /* "mipSecViolationEntry", */
"1.3.6.1.2.1.44.1.2.3.1",
"mipSecViolationEntry",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_AGGREGATE,
IP_NULL,
IP_NULL,
IP_NULL
},
#if 0
{ /* "mipSecViolatorAddress", */
"1.3.6.1.2.1.44.1.2.3.1.1",
"mipSecViolatorAddress",
IPSNMP_DATA_TYPE_IPADDRESS,
IPSNMP_NODE_ACCESS_NOTIFY,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_mipSecViolationTable
},
{ /* "mipSecViolationCounter", */
"1.3.6.1.2.1.44.1.2.3.1.2",
"mipSecViolationCounter",
IPSNMP_DATA_TYPE_COUNTER32,
IPSNMP_NODE_ACCESS_READONLY,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_mipSecViolationTable
},
{ /* "mipSecRecentViolationSPI", */
"1.3.6.1.2.1.44.1.2.3.1.3",
"mipSecRecentViolationSPI",
IPSNMP_DATA_TYPE_INTEGER,
IPSNMP_NODE_ACCESS_READONLY,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_mipSecViolationTable
},
{ /* "mipSecRecentViolationTime", */
"1.3.6.1.2.1.44.1.2.3.1.4",
"mipSecRecentViolationTime",
IPSNMP_DATA_TYPE_TIMETICKS,
IPSNMP_NODE_ACCESS_READONLY,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_mipSecViolationTable
},
{ /* "mipSecRecentViolationIDLow", */
"1.3.6.1.2.1.44.1.2.3.1.5",
"mipSecRecentViolationIDLow",
IPSNMP_DATA_TYPE_INTEGER,
IPSNMP_NODE_ACCESS_READONLY,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_mipSecViolationTable
},
{ /* "mipSecRecentViolationIDHigh", */
"1.3.6.1.2.1.44.1.2.3.1.6",
"mipSecRecentViolationIDHigh",
IPSNMP_DATA_TYPE_INTEGER,
IPSNMP_NODE_ACCESS_READONLY,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_mipSecViolationTable
},
{ /* "mipSecRecentViolationReason", */
"1.3.6.1.2.1.44.1.2.3.1.7",
"mipSecRecentViolationReason",
IPSNMP_DATA_TYPE_INTEGER,
IPSNMP_NODE_ACCESS_READONLY,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_mipSecViolationTable
},
#endif
{ /* "maAdvConfigTable", */
"1.3.6.1.2.1.44.1.4.2.1",
"maAdvConfigTable",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_AGGREGATE,
IP_NULL,
IP_NULL,
IP_NULL
},
#if 0
{ /* "maAdvConfigEntry", */
"1.3.6.1.2.1.44.1.4.2.1.1",
"maAdvConfigEntry",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_AGGREGATE,
IP_NULL,
IP_NULL,
IP_NULL
},
#endif
{ /* "maInterfaceAddress", */
"1.3.6.1.2.1.44.1.4.2.1.1.1",
"maInterfaceAddress",
IPSNMP_DATA_TYPE_IPADDRESS,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
IP_NULL
},
#if 0
{ /* "maAdvMaxRegLifetime", */
"1.3.6.1.2.1.44.1.4.2.1.1.2",
"maAdvMaxRegLifetime",
IPSNMP_DATA_TYPE_INTEGER,
IPSNMP_NODE_ACCESS_READCREATE,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_maAdvConfigTable
},
{ /* "maAdvPrefixLengthInclusion", */
"1.3.6.1.2.1.44.1.4.2.1.1.3",
"maAdvPrefixLengthInclusion",
IPSNMP_DATA_TYPE_INTEGER,
IPSNMP_NODE_ACCESS_READCREATE,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_maAdvConfigTable
},
{ /* "maAdvAddress", */
"1.3.6.1.2.1.44.1.4.2.1.1.4",
"maAdvAddress",
IPSNMP_DATA_TYPE_IPADDRESS,
IPSNMP_NODE_ACCESS_READCREATE,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_maAdvConfigTable
},
{ /* "maAdvMaxInterval", */
"1.3.6.1.2.1.44.1.4.2.1.1.5",
"maAdvMaxInterval",
IPSNMP_DATA_TYPE_INTEGER,
IPSNMP_NODE_ACCESS_READCREATE,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_maAdvConfigTable
},
{ /* "maAdvMinInterval", */
"1.3.6.1.2.1.44.1.4.2.1.1.6",
"maAdvMinInterval",
IPSNMP_DATA_TYPE_INTEGER,
IPSNMP_NODE_ACCESS_READCREATE,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_maAdvConfigTable
},
{ /* "maAdvMaxAdvLifetime", */
"1.3.6.1.2.1.44.1.4.2.1.1.7",
"maAdvMaxAdvLifetime",
IPSNMP_DATA_TYPE_INTEGER,
IPSNMP_NODE_ACCESS_READCREATE,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_maAdvConfigTable
},
{ /* "maAdvResponseSolicitationOnly", */
"1.3.6.1.2.1.44.1.4.2.1.1.8",
"maAdvResponseSolicitationOnly",
IPSNMP_DATA_TYPE_INTEGER,
IPSNMP_NODE_ACCESS_READCREATE,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_maAdvConfigTable
},
{ /* "maAdvStatus", */
"1.3.6.1.2.1.44.1.4.2.1.1.9",
"maAdvStatus",
IPSNMP_DATA_TYPE_INTEGER,
IPSNMP_NODE_ACCESS_READCREATE,
IPSNMP_NODE_TYPE_COLUMNAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_maAdvConfigTable
},
{ /* "maAdvertisementsSent", */
"1.3.6.1.2.1.44.1.4.2.2",
"maAdvertisementsSent",
IPSNMP_DATA_TYPE_COUNTER32,
IPSNMP_NODE_ACCESS_READONLY,
IPSNMP_NODE_TYPE_SCALAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_maAdvertisementsSent
},
#endif
#if 0
{ /* "maAdvsSentForSolicitation", */
"1.3.6.1.2.1.44.1.4.2.3",
"maAdvsSentForSolicitation",
IPSNMP_DATA_TYPE_COUNTER32,
IPSNMP_NODE_ACCESS_READONLY,
IPSNMP_NODE_TYPE_SCALAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_maAdvsSentForSolicitation
},
{ /* "maSolicitationsReceived", */
"1.3.6.1.2.1.44.1.4.2.4",
"maSolicitationsReceived",
IPSNMP_DATA_TYPE_COUNTER32,
IPSNMP_NODE_ACCESS_READONLY,
IPSNMP_NODE_TYPE_SCALAR,
IP_NULL,
IP_NULL,
ipmip4_mip_mib_handler_maSolicitationsReceived
},
#endif
{ /* "mipAuthFailure", */
"1.3.6.1.2.1.44.2.0.1",
"mipAuthFailure",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_TRAP,
IP_NULL,
IP_NULL,
IP_NULL
},
{ /* "mipSystemGroup", */
"1.3.6.1.2.1.44.3.1.1",
"mipSystemGroup",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_OTHER,
IP_NULL,
IP_NULL,
IP_NULL
},
{ /* "mipSecAssociationGroup", */
"1.3.6.1.2.1.44.3.1.2",
"mipSecAssociationGroup",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_OTHER,
IP_NULL,
IP_NULL,
IP_NULL
},
{ /* "mipSecViolationGroup", */
"1.3.6.1.2.1.44.3.1.3",
"mipSecViolationGroup",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_OTHER,
IP_NULL,
IP_NULL,
IP_NULL
},
{ /* "maAdvertisementGroup", */
"1.3.6.1.2.1.44.3.1.7",
"maAdvertisementGroup",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_OTHER,
IP_NULL,
IP_NULL,
IP_NULL
},
{ /* "mipSecNotificationsGroup", */
"1.3.6.1.2.1.44.3.1.13",
"mipSecNotificationsGroup",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_OTHER,
IP_NULL,
IP_NULL,
IP_NULL
},
{ /* "mipCompliance", */
"1.3.6.1.2.1.44.3.2.1",
"mipCompliance",
IPSNMP_DATA_TYPE_UNSPECIFIED,
IPSNMP_NODE_ACCESS_NOACCESS,
IPSNMP_NODE_TYPE_OTHER,
IP_NULL,
IP_NULL,
IP_NULL
},
{IP_NULL, IP_NULL, 0, 0, 0, IP_NULL, IP_NULL, IP_NULL}
};
static int mib_once = 0;
if (mib_once == 1)
return IPCOM_SUCCESS;
mib_once = 1;
if(ipsnmp_add_node_list(ipmip4_mip_mib_objects) != 0)
return IPCOM_ERR_FAILED;
return IPCOM_SUCCESS;
}
#endif /* #ifdef IPSNMP */
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/