[insert project logo here (125x200px max)] Navigator Mailinglists Please report any errors or ommissions you find to our `Help' mailinglist, or post a message in the Forums. Copyright and Licensing Information Snap is (c) Jonathan T. Moore, 1999-2002 and licensed under the GNU General Public License (GPL). All other parts of Splash are (c) Willem de Bruijn, 2002-2003 and licensed under the BSD Open Source License. All sourcecode is made publicly available. Acknowledgement Splash and the Splash website are hosted by SourceForge.net |
Splash - DocumentationSNMP Plus a Lightweight API for SNAP Handlingsnap_svc/snap_svc.hGo to the documentation of this file.00001 /* snap service library */ 00002 /* (c) Willem de Bruijn, 2002, 2003 */ 00003 /* Licensed under the BSD License */ 00004 /* snapservices library headerfile */ 00005 00006 #ifndef SNAP_SVC_H 00007 #define SNAP_SVC_H 00008 00009 #include <stddef.h> 00010 00011 /* definition of the general function prototype */ 00012 /* I've tried to keep this as flexible as possible, but two constraints exist: */ 00013 /* (1) each function MUST TAKE at least 1 argument. */ 00014 /** if it doesn't use arguments you should create a dummy and set args=0 */ 00015 typedef void* (*snapsvc_func_proto) (void*, ...); 00016 00017 /* prototypes for Dll loading and registering */ 00018 typedef void (*snap_svc_init) (void); 00019 typedef void (*snap_svc_register) (char**, snapsvc_func_proto*, int*, int*); 00020 typedef void* (*snap_svc_getlastresult)(void); 00021 typedef void* (*snap_svc_free_local_returnstruct)(void); 00022 00023 /* definitions of the returntypes and returndata carrier */ 00024 enum {SVC_SNMP_TYPE_NULL, SVC_SNMP_TYPE_INT, SVC_SNMP_TYPE_ADDR, SVC_SNMP_TYPE_STRING, SVC_SNMP_TYPE_LONG}; 00025 00026 /* a structure for each variable */ 00027 struct svc_returnitem{ 00028 unsigned short type; 00029 void* data; 00030 unsigned long length; 00031 unsigned long* oid; 00032 size_t oid_length; 00033 }; 00034 00035 /* this is what we actually pass back */ 00036 struct svc_returnstruct{ 00037 struct svc_returnitem* list; 00038 unsigned short length; 00039 }; 00040 00041 /* library-global variables */ 00042 unsigned int svc_fun_counter; /* keep track of which functions have been registered since the last call to snap_external_svclib_init*/ 00043 struct svc_returnstruct* svc_return; 00044 00045 /* these functions are automatically called by the platform */ 00046 /* NB: dlopen should auto open _init() if available, but this behaviour is broken on Linux */ 00047 void init(); 00048 void fini(); 00049 00050 /* library specific (de)initialization routines */ 00051 void snap_external_svclib_init(); 00052 void snap_external_svclib_done(); 00053 00054 /* definitions of the standard callee functions */ 00055 void snap_external_svclib_getnextfunc(char**, snapsvc_func_proto*, int*, int*); 00056 struct svc_returnstruct* snap_external_svclib_getlastresult(); 00057 00058 /* standard helperfunction */ 00059 struct svc_returnstruct* snap_external_svclib_free_returnstruct(struct svc_returnstruct*); 00060 struct svc_returnstruct* snap_external_svclib_free_local_returnstruct(); 00061 #endif /* SNAP_SVC_H */ 00062 |