Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dynamic context registration query

2 views
Skip to first unread message

Lakshmipathy, Sridhar

unread,
May 25, 2016, 5:58:16 AM5/25/16
to

Hi ,

 

I am currently implementing dynamic context registration via IF-Table.

 

In the init_ifTable , I did the following changes .

 

    _ifTable_initialize_interface(user_context, flags,NULL);

    _ifTable_initialize_interface(user_context, flags,"context1");

    _ifTable_initialize_interface(user_context, flags,"context2");

 

I handled these context in the _mfd_ifTable_get_values

Based on the context received  via snmpwalk , I filter over the oid and send it back ,

 

Actually when I do the same with hardcoded value   , it was working find and I got expected output ,

bash-4.3# snmpwalk -v3 -u testUser -l authPriv -a MD5 -A 'password' -x DES -X 'password' -n " context1" 172.17.0.2 1.3.6.1.2.1.2.2.1.7

IF-MIB::ifAdminStatus.1 = INTEGER: up(1)

IF-MIB::ifAdminStatus.3 = INTEGER: up(1)

IF-MIB::ifAdminStatus.3 = No more variables left in this MIB View (It is past the end of the MIB tree)

bash-4.3# snmpwalk -v3 -u testUser -l authPriv -a MD5 -A 'password' -x DES -X 'password' -n " context2" 172.17.0.2 1.3.6.1.2.1.2.2.1.7

IF-MIB::ifAdminStatus.2 = INTEGER: up(1)

IF-MIB::ifAdminStatus.4 = INTEGER: up(1)

 

 

But I want to do the same in dynamic way , means  the initialization I want to do check new context table and

Check if any updates is there , if any need to initialize interface with new table name  .

 

However ,  the initialization linked with init call , So is there any way to initialize the table intermediate and register with new table .

 

Like below

 

Void _Custom_ifTable_initialize_interface(I fTable_registration user_context,char * MyContext)

{

   

        ifTable_registration *user_context;

         u_long flags =0 ;

        user_context = netsnmp_create_data_list("ifTable", NULL, NULL);

        _ifTable_initialize_interface(user_context,flags, MyContext)

}

 

Regards,

Sridhar .L

0 new messages