[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-1.1-wjdb/lib/snap_svc_conversion.hGo to the documentation of this file.00001 /* 00002 snap service handler 00003 type conversion header file 00004 (c) 2003 Willem de Bruijn 00005 some code has been copied from the base SNAP package by Jon Moore 00006 all other code falls under the BSD License 00007 */ 00008 00009 #ifndef SNAP_SVC_CONV_H 00010 #define SNAP_SVC_CONV_H 00011 00012 #include <snap_svc.h> 00013 00014 #include "packet.h" 00015 #include "io.h" 00016 00017 /* a heap tuple */ 00018 struct snap_htup { 00019 unsigned short int n; 00020 struct snap_hval **vals; 00021 }; 00022 00023 /* a heap value */ 00024 struct snap_hval { 00025 unsigned short int typetag; 00026 union { 00027 unsigned int scalar; 00028 buffer_t *s; 00029 struct snap_htup *t; 00030 } v; 00031 }; 00032 00033 /* 00034 conversion functions 00035 */ 00036 00037 /* pop from the stack and create a returnstruct */ 00038 void* snap_svc_convert_stack2returnstruct(packet_t*, value_t*); 00039 00040 /* convert a returnstruct to a stackitem and push it onto the stack */ 00041 int snap_svc_convert_returnstruct2stack(packet_t*, value_t*, struct svc_returnitem*); 00042 00043 /* convert function return values to stackvalues and push 'em onto the stack */ 00044 /* 00045 WARNING : this function is somewhat insecure. It takes 00046 a type (see the enum in snap_svc.h) that is either a 00047 string (void*, char*, etc) or a single value. 00048 */ 00049 int snap_svc_convert_direct2stack(packet_t *, void*, int); 00050 00051 /* create arguments from (popped) stackvalues */ 00052 void** snap_svc_convert_stack2arguments(packet_t*, int); 00053 00054 #endif |