Re: mib2c.table_data.conf, cache timeout period does'nt seems to change.

Francois Bouchard <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <CAAZiaZc7eyW-F9Z1my1AQU1wZ7q4L_aGuVu-6GE2F8xJYTiXXg@mail.gmail.com>
Dave,

> you should be able to modify this timeout by editing the header
> file and recompiling the module.
Yes this is what's been done, thexxxTable_free(...) isn't called in less
than 60 seconds, even when lowering XXX_TIMEOUT in the header file.




> Perhaps you could post the code that you're working with
> so that we can test this
Yes, here is the code for the initialize function (generated using mib2c -c
mib2c.table_data.conf mpbcRMHAlarmTable  (when asked : option 1 (cache))  )
:






void init_xxxTable(void)
{
    const oid xxxTable_oid[] = {1,3,6,1,4,1,4464,2,1,1,1};
    const size_t xxxTable_oid_len   = OID_LENGTH(xxxTable_oid);
    netsnmp_handler_registration    *reg;
    netsnmp_tdata                   *table_data;
    netsnmp_table_registration_info *table_info;
    netsnmp_cache                   *cache;


    reg = netsnmp_create_handler_registration(
              "xxxTable",     xxxTable_handler,
              xxxTable_oid, xxxTable_oid_len,
              HANDLER_CAN_RONLY
              );

    table_data = netsnmp_tdata_create_table( "xxxTable", 0 );
    if (NULL == table_data) {
        snmp_log(LOG_ERR,"error creating tdata table for xxxTable\n");
        return;
    }
    cache = netsnmp_cache_create(XXX_TIMEOUT,
                                  xxxTable_load, xxxTable_free,
                                  xxxTable_oid,  xxxTable_oid_len);
    if (NULL == cache) {
        snmp_log(LOG_ERR,"error creating cache for xxxTable\n");
    }
    else
        cache->magic = (void *)table_data;
    table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info );
    if (NULL == table_info) {
        snmp_log(LOG_ERR,"error creating table info for xxxTable\n");
        return;
    }
    netsnmp_table_helper_add_indexes(table_info,
                           ASN_INTEGER,
                           0);

    table_info->min_column =  COLUMN_XXXNEID;
    table_info->max_column = COLUMN_XXXSTARTTIME;

    netsnmp_tdata_register( reg, table_data, table_info );
    if (cache) {
     netsnmp_inject_handler( reg, netsnmp_cache_handler_get(cache));
    }

    /* Initialise the contents of the table here */
    // N/A
}







Francois






2012/2/10 Dave Shield <[email protected]>

> On 10 February 2012 20:06, Francois Bouchard <[email protected]>
> wrote:
> > I was asking for hints about the cache timeout values.  It can't be
> modify
> > when changing the xxx_TIMEOUT define statement ( ie.e stays at 60
> seconds )
>
> Hmmmm....
>  you should be able to modify this timeout by editing the header
> file and recompiling the module.
>
> Perhaps you could post the code that you're working with
> so that we can test this
>
> Dave
>

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.