Logo
Home page Net-SNMP

Archive Search:

Require all words?

Site Search:
Google
old_api.h File Reference
Main Page   Data Structures   File List   Data Fields   Globals  

old_api.h File Reference

Go to the source code of this file.


Data Structures

struct  old_api_info_s
struct  old_opi_cache_s

Defines

#define OLD_API_NAME   "old_api"

Typedefs

typedef old_api_info_s old_api_info
typedef old_opi_cache_s old_api_cache

Functions

int register_old_api (const char *moduleName, struct variable *var, size_t varsize, size_t numvars, oid *mibloc, size_t mibloclen, int priority, int range_subid, oid range_ubound, struct snmp_session *ss, const char *context, int timeout, int flags)
agent_snmp_sessionget_current_agent_session (void)

Variables

NodeHandler old_api_helper

Define Documentation

#define OLD_API_NAME   "old_api"
 

Definition at line 4 of file old_api.h.


Typedef Documentation

typedef struct old_opi_cache_s old_api_cache
 

typedef struct old_api_info_s old_api_info
 


Function Documentation

struct agent_snmp_session* get_current_agent_session void   
 

Definition at line 22 of file old_api.c.

00022                             {
00023     return current_agent_session;
00024 }

int register_old_api const char *    moduleName,
struct variable   var,
size_t    varsize,
size_t    numvars,
oid *    mibloc,
size_t    mibloclen,
int    priority,
int    range_subid,
oid    range_ubound,
struct snmp_session *    ss,
const char *    context,
int    timeout,
int    flags
 

Definition at line 38 of file old_api.c.

Referenced by register_mib_context().

00050                             {
00051     
00052     old_api_info *old_info = SNMP_MALLOC_TYPEDEF(old_api_info);
00053     int i;
00054     
00055     old_info->var = var;
00056     old_info->varsize = varsize;
00057     old_info->numvars = numvars;
00058     old_info->ss = ss;
00059     old_info->flags = flags;
00060     
00061     /* register all subtree nodes */
00062     for(i = 0; i < numvars; i++) {
00063         struct variable *vp;
00064         handler_registration *reginfo =
00065             SNMP_MALLOC_TYPEDEF(handler_registration);
00066 
00067         memdup((void *) &vp,
00068                (void *) (struct variable *) ((char *) var + varsize*i),
00069                varsize);
00070  
00071         reginfo->handler = get_old_api_handler();
00072         reginfo->handlerName = strdup(moduleName);
00073         reginfo->rootoid_len = (mibloclen + vp->namelen);
00074         reginfo->rootoid =
00075             (oid *) malloc(reginfo->rootoid_len * sizeof(oid));
00076         
00077         memcpy(reginfo->rootoid, mibloc, mibloclen*sizeof(oid));
00078         memcpy(reginfo->rootoid + mibloclen, vp->name, vp->namelen
00079                * sizeof(oid));
00080         reginfo->handler->myvoid = (void *) vp;
00081 
00082         reginfo->priority = priority;
00083         reginfo->range_subid = range_subid;
00084         
00085         reginfo->range_ubound = range_ubound;
00086         reginfo->timeout = timeout;
00087         reginfo->contextName = (context) ? strdup(context) : NULL;
00088         reginfo->modes = HANDLER_CAN_RWRITE;
00089 
00090         /* register ourselves in the mib tree */
00091         register_handler(reginfo);
00092     }
00093     return SNMPERR_SUCCESS;
00094 }

Variable Documentation

NodeHandler old_api_helper
 

Definition at line 34 of file old_api.h.


Generated on Sat Nov 10 14:09:55 2001 for net-snmp by doxygen1.2.11 written by Dimitri van Heesch, © 1997-2001
[an error occurred while processing this directive] [an error occurred while processing this directive]

Valid CSS!


Last modified: Wednesday, 01-Aug-2018 04:41:28 UTC
For questions regarding web content and site functionality, please write to the net-snmp-users mail list.