Changeset 47de0aa
- Timestamp:
- 06/29/06 21:07:50 (15 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
- Children:
- 2553732
- Parents:
- 66caf4b
- Files:
-
- 3 added
- 2 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile.am
r306f91c r47de0aa 1 1 LIBPACKETDUMP_DIR = libpacketdump 2 2 TOOLS_DIR = tools 3 SUBDIRS = lib docs $(LIBPACKETDUMP_DIR) $(TOOLS_DIR) 3 if LIBTRACE_SWIG 4 SWIG_DIR = swig 5 endif 6 SUBDIRS = lib docs $(LIBPACKETDUMP_DIR) $(TOOLS_DIR) $(SWIG_DIR) 4 7 8 ACLOCAL_AMFLAGS = -I m4 5 9 AUTOMAKE_OPTIONS = 1.5 6 10 -
bootstrap.sh
r1c124a8 r47de0aa 2 2 3 3 set -x 4 aclocal-1.9 ||5 aclocal 4 aclocal-1.9 -I m4 || 5 aclocal -I m4 6 6 libtoolize --force --copy 7 7 autoheader -
configure.in
r306f91c r47de0aa 22 22 tools/tracemerge/Makefile tools/tracereport/Makefile 23 23 tools/tracertstats/Makefile tools/tracesplit/Makefile 24 tools/tracestats/Makefile docs/libtrace.doxygen lib/libtrace.h]) 24 tools/tracestats/Makefile 25 docs/libtrace.doxygen 26 lib/libtrace.h 27 swig/Makefile]) 25 28 dnl GNU C library 26 29 dnl AC_GNU_SOURCE … … 46 49 AC_HEADER_TIME 47 50 AC_SYS_LARGEFILE 51 52 AC_PROG_LIBTOOL 53 AM_PATH_PYTHON(2.3) 54 AC_PROG_SWIG(1.3.21) 55 SWIG_PYTHON 48 56 49 57 # Checks for library functions. … … 209 217 AC_CHECK_LIB(z, gzopen) 210 218 219 libtrace_swig=false; 220 if test -n $SWIG; then 221 libtrace_swig=true; 222 fi 223 libtrace_python=false; 224 if test -n "$PYTHON"; then 225 libtrace_python=true; 226 fi 227 211 228 AM_CONDITIONAL([HAVE_DAG], [test "$libtrace_dag" = true]) 212 229 AM_CONDITIONAL([DAG2_4], [test "$libtrace_dag2_4" = true]) … … 214 231 AM_CONDITIONAL([HAVE_NETPACKET_PACKET_H], [test "$libtrace_netpacket_packet_h" = true]) 215 232 AM_CONDITIONAL([LIBGDC], [test "$ac_cv_header_gdc_h" = yes]) 233 AM_CONDITIONAL([LIBTRACE_SWIG], [test "$libtrace_swig" = true]) 234 #AM_CONDITIONAL([HAVE_PYTHON], [test "$libtrace_python" = true]) 216 235 217 236 # Check for miscellaneous programs … … 257 276 reportopt "Building man pages/documentation" $libtrace_doxygen 258 277 278 if test x"$libtrace_swig" = xtrue; then 279 if test x"$libtrace_python"; then 280 AC_MSG_NOTICE([Building swig bindings for: python]) 281 fi 282 else 283 AC_MSG_NOTICE([Building swig bindings for: Nothing]) 284 fi -
lib/trace.c
re5c2bc4 r47de0aa 245 245 struct libtrace_format_t *tmp; 246 246 trace_init(); 247 printf("libtrace %s\n",PACKAGE_VERSION); 247 printf("libtrace %s\n\n",PACKAGE_VERSION); 248 printf("Following this are a list of the format modules supported in this build of libtrace\n\n"); 248 249 for(tmp=formats_list;tmp;tmp=tmp->next) { 249 250 if (tmp->help) -
swig/libtrace.i
r3fe7937 r47de0aa 147 147 %extend libtrace_packet_t { 148 148 libtrace_packet_t() { 149 struct libtrace_packet_t *packet = malloc(sizeof(struct libtrace_packet_t));149 struct libtrace_packet_t *packet = trace_create_packet(); 150 150 return packet; 151 151 } 152 ~libtrace_packet_t() { free(self);} 152 ~libtrace_packet_t() { 153 trace_destroy_packet(self); 154 } 155 libtrace_packet_t *trace_copy_packet() { 156 return trace_copy_packet(self); 157 } 158 void *trace_get_link() { 159 return trace_get_link(self); 160 } 161 void *trace_get_transport(uint8_t *proto, uint32_t *remaining) { 162 return trace_get_transport(self, proto, remaining); 163 } 153 164 struct libtrace_ip *trace_get_ip() { 154 165 return trace_get_ip(self); … … 163 174 return trace_get_icmp(self); 164 175 } 165 void *trace_get_link() { 166 return trace_get_link(self); 176 char *trace_get_destination_mac() { 177 return trace_ether_ntoa(trace_get_destination_mac(self),0); 178 } 179 char *trace_get_source_mac() { 180 return trace_ether_ntoa(trace_get_source_mac(self),0); 181 } 182 char *trace_ether_ntoa(uint8_t *mac) { 183 return trace_ether_ntoa(mac, 0); 184 } 185 uint16_t trace_get_source_port() { 186 return trace_get_source_port(self); 187 } 188 uint16_t trace_get_destination_port() { 189 return trace_get_destination_port(self); 167 190 } 168 191 double trace_get_seconds() { … … 178 201 return trace_get_capture_length(self); 179 202 } 203 size_t trace_set_capture_length(size_t size) { 204 return trace_set_capture_length(self,size); 205 } 180 206 int trace_get_wire_lenth() { 181 207 return trace_get_wire_length(self); 182 208 } 209 int trace_get_framing_length() { 210 return trace_get_framing_length(self); 211 } 183 212 libtrace_linktype_t trace_get_link_type() { 184 213 return trace_get_link_type(self); … … 190 219 return trace_set_direction(self,direction); 191 220 } 192 int trace_ bpf_filter(struct libtrace_filter_t *filter) {193 return trace_ bpf_filter(filter,self);221 int trace_apply_filter(struct libtrace_filter_t *filter) { 222 return trace_apply_filter(filter,self); 194 223 } 195 224 uint8_t trace_get_server_port(uint8_t protocol, uint16_t source, … … 205 234 %extend libtrace_filter_t { 206 235 libtrace_filter_t(char *filterstring) { 207 return trace_ bpf_setfilter(filterstring);236 return trace_create_filter(filterstring); 208 237 }; 209 int trace_bpf_filter(struct libtrace_packet_t *packet) { 210 return trace_bpf_filter(self,packet); 238 ~libtrace_filter_t() { 239 trace_destroy_filter(self); 240 }; 241 int trace_apply_filter(struct libtrace_packet_t *packet) { 242 return trace_apply_filter(self,packet); 211 243 } 212 244 }; … … 221 253 return trace_read_packet(self,packet); 222 254 } 255 int trace_start() { 256 return trace_start(self); 257 } 258 int trace_pause() { 259 return trace_pause(self); 260 } 261 void trace_help() { 262 trace_help(); 263 } 264 int trace_config(trace_option_t option, void *value) { 265 return trace_config(self, option, value); 266 } 267 libtrace_err_t trace_get_err() { 268 return trace_get_err(self); 269 } 270 bool trace_is_err() { 271 return trace_is_err(self); 272 } 223 273 }; 224 274 275 %rename (OutputTrace) libtrace_out_t; 276 struct libtrace_out_t {}; 277 278 %extend libtrace_out_t { 279 libtrace_out_t(char *uri) { return trace_create_output(uri); }; 280 ~libtrace_t() { trace_destroy_output(self); } 281 int trace_start_output() { 282 return trace_start_output(self); 283 } 284 int trace_config_output(trace_option_output_t option, void *value) { 285 return trace_config_output(self, option, value); 286 } 287 libtrace_err_t trace_get_err_output() { 288 return trace_get_err_output(self); 289 } 290 bool trace_is_err_output() { 291 return trace_is_err_output(self); 292 } 293 int trace_write_packet(libtrace_packet_t *packet) { 294 return trace_write_packet(self, packet); 295 } 296 }; 297 -
swig/libtrace_wrap.c
r3fe7937 r47de0aa 1 1 /* ---------------------------------------------------------------------------- 2 2 * This file was automatically generated by SWIG (http://www.swig.org). 3 * Version 1.3.2 23 * Version 1.3.27 4 4 * 5 5 * This file is not intended to be easily readable and contains a number of … … 10 10 11 11 #define SWIGPYTHON 12 13 #include "Python.h" 14 15 /*************************************************************** -*- c -*- 16 * python/precommon.swg 12 /*********************************************************************** 17 13 * 18 * Rename all exported symbols from common.swg, to avoid symbol19 * clashes if multiple interpreters are included14 * This section contains generic SWIG labels for method/variable 15 * declarations/attributes, and other compiler dependent labels. 20 16 * 21 17 ************************************************************************/ 22 18 23 #define SWIG_TypeRegister SWIG_Python_TypeRegister 24 #define SWIG_TypeCheck SWIG_Python_TypeCheck 25 #define SWIG_TypeCast SWIG_Python_TypeCast 26 #define SWIG_TypeDynamicCast SWIG_Python_TypeDynamicCast 27 #define SWIG_TypeName SWIG_Python_TypeName 28 #define SWIG_TypePrettyName SWIG_Python_TypePrettyName 29 #define SWIG_TypeQuery SWIG_Python_TypeQuery 30 #define SWIG_TypeClientData SWIG_Python_TypeClientData 31 #define SWIG_PackData SWIG_Python_PackData 32 #define SWIG_UnpackData SWIG_Python_UnpackData 33 19 /* template workaround for compilers that cannot correctly implement the C++ standard */ 20 #ifndef SWIGTEMPLATEDISAMBIGUATOR 21 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) 22 # define SWIGTEMPLATEDISAMBIGUATOR template 23 # else 24 # define SWIGTEMPLATEDISAMBIGUATOR 25 # endif 26 #endif 27 28 /* inline attribute */ 29 #ifndef SWIGINLINE 30 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) 31 # define SWIGINLINE inline 32 # else 33 # define SWIGINLINE 34 # endif 35 #endif 36 37 /* attribute recognised by some compilers to avoid 'unused' warnings */ 38 #ifndef SWIGUNUSED 39 # if defined(__GNUC__) || defined(__ICC) 40 # define SWIGUNUSED __attribute__ ((unused)) 41 # else 42 # define SWIGUNUSED 43 # endif 44 #endif 45 46 /* internal SWIG method */ 47 #ifndef SWIGINTERN 48 # define SWIGINTERN static SWIGUNUSED 49 #endif 50 51 /* internal inline SWIG method */ 52 #ifndef SWIGINTERNINLINE 53 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE 54 #endif 55 56 /* exporting methods for Windows DLLs */ 57 #ifndef SWIGEXPORT 58 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) 59 # if defined(STATIC_LINKED) 60 # define SWIGEXPORT 61 # else 62 # define SWIGEXPORT __declspec(dllexport) 63 # endif 64 # else 65 # define SWIGEXPORT 66 # endif 67 #endif 68 69 /* calling conventions for Windows */ 70 #ifndef SWIGSTDCALL 71 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) 72 # define SWIGSTDCALL __stdcall 73 # else 74 # define SWIGSTDCALL 75 # endif 76 #endif 77 78 79 80 #include <Python.h> 34 81 35 82 /*********************************************************************** 36 * common.swg83 * swigrun.swg 37 84 * 38 * This file contains generic SWIG runtime support for pointer 39 * type checking as well as a few commonly used macros to control 40 * external linkage. 85 * This file contains generic CAPI SWIG runtime support for pointer 86 * type checking. 41 87 * 42 * Author : David Beazley (beazley@cs.uchicago.edu)43 *44 * Copyright (c) 1999-2000, The University of Chicago45 *46 * This file may be freely redistributed without license or fee provided47 * this copyright message remains intact.48 88 ************************************************************************/ 49 89 90 /* This should only be incremented when either the layout of swig_type_info changes, 91 or for whatever reason, the runtime changes incompatibly */ 92 #define SWIG_RUNTIME_VERSION "2" 93 94 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ 95 #ifdef SWIG_TYPE_TABLE 96 # define SWIG_QUOTE_STRING(x) #x 97 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) 98 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) 99 #else 100 # define SWIG_TYPE_TABLE_NAME 101 #endif 102 103 /* 104 You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for 105 creating a static or dynamic library from the swig runtime code. 106 In 99.9% of the cases, swig just needs to declare them as 'static'. 107 108 But only do this if is strictly necessary, ie, if you have problems 109 with your compiler or so. 110 */ 111 112 #ifndef SWIGRUNTIME 113 # define SWIGRUNTIME SWIGINTERN 114 #endif 115 116 #ifndef SWIGRUNTIMEINLINE 117 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE 118 #endif 119 50 120 #include <string.h> 51 52 #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)53 # if defined(_MSC_VER) || defined(__GNUC__)54 # if defined(STATIC_LINKED)55 # define SWIGEXPORT(a) a56 # define SWIGIMPORT(a) extern a57 # else58 # define SWIGEXPORT(a) __declspec(dllexport) a59 # define SWIGIMPORT(a) extern a60 # endif61 # else62 # if defined(__BORLANDC__)63 # define SWIGEXPORT(a) a _export64 # define SWIGIMPORT(a) a _export65 # else66 # define SWIGEXPORT(a) a67 # define SWIGIMPORT(a) a68 # endif69 # endif70 #else71 # define SWIGEXPORT(a) a72 # define SWIGIMPORT(a) a73 #endif74 75 #ifdef SWIG_GLOBAL76 # define SWIGRUNTIME(a) SWIGEXPORT(a)77 #else78 # define SWIGRUNTIME(a) static a79 #endif80 121 81 122 #ifdef __cplusplus … … 86 127 typedef struct swig_type_info *(*swig_dycast_func)(void **); 87 128 129 /* Structure to store inforomation on one type */ 88 130 typedef struct swig_type_info { 89 const char *name; 90 swig_converter_func converter; 91 const char *str; 92 void *clientdata; 93 swig_dycast_func dcast; 94 struct swig_type_info *next; 95 struct swig_type_info *prev; 131 const char *name; /* mangled name of this type */ 132 const char *str; /* human readable name of this type */ 133 swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ 134 struct swig_cast_info *cast; /* linked list of types that can cast into this type */ 135 void *clientdata; /* language specific type data */ 96 136 } swig_type_info; 97 137 98 #ifdef SWIG_NOINCLUDE 99 100 SWIGIMPORT(swig_type_info *) SWIG_TypeRegister(swig_type_info *); 101 SWIGIMPORT(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *); 102 SWIGIMPORT(void *) SWIG_TypeCast(swig_type_info *, void *); 103 SWIGIMPORT(swig_type_info *) SWIG_TypeDynamicCast(swig_type_info *, void **); 104 SWIGIMPORT(const char *) SWIG_TypeName(const swig_type_info *); 105 SWIGIMPORT(const char *) SWIG_TypePrettyName(const swig_type_info *); 106 SWIGIMPORT(swig_type_info *) SWIG_TypeQuery(const char *); 107 SWIGIMPORT(void) SWIG_TypeClientData(swig_type_info *, void *); 108 SWIGIMPORT(char *) SWIG_PackData(char *, void *, int); 109 SWIGIMPORT(char *) SWIG_UnpackData(char *, void *, int); 110 111 #else 112 113 static swig_type_info *swig_type_list = 0; 114 static swig_type_info **swig_type_list_handle = &swig_type_list; 115 116 /* Register a type mapping with the type-checking */ 117 SWIGRUNTIME(swig_type_info *) 118 SWIG_TypeRegister(swig_type_info *ti) { 119 swig_type_info *tc, *head, *ret, *next; 120 /* Check to see if this type has already been registered */ 121 tc = *swig_type_list_handle; 122 while (tc) { 123 if (strcmp(tc->name, ti->name) == 0) { 124 /* Already exists in the table. Just add additional types to the list */ 125 if (tc->clientdata) ti->clientdata = tc->clientdata; 126 head = tc; 127 next = tc->next; 128 goto l1; 129 } 130 tc = tc->prev; 131 } 132 head = ti; 133 next = 0; 134 135 /* Place in list */ 136 ti->prev = *swig_type_list_handle; 137 *swig_type_list_handle = ti; 138 139 /* Build linked lists */ 140 l1: 141 ret = head; 142 tc = ti + 1; 143 /* Patch up the rest of the links */ 144 while (tc->name) { 145 head->next = tc; 146 tc->prev = head; 147 head = tc; 148 tc++; 149 } 150 if (next) next->prev = head; 151 head->next = next; 152 return ret; 153 } 154 155 /* Check the typename */ 156 SWIGRUNTIME(swig_type_info *) 157 SWIG_TypeCheck(char *c, swig_type_info *ty) { 158 swig_type_info *s; 159 if (!ty) return 0; /* Void pointer */ 160 s = ty->next; /* First element always just a name */ 161 do { 162 if (strcmp(s->name,c) == 0) { 163 if (s == ty->next) return s; 164 /* Move s to the top of the linked list */ 165 s->prev->next = s->next; 166 if (s->next) { 167 s->next->prev = s->prev; 168 } 169 /* Insert s as second element in the list */ 170 s->next = ty->next; 171 if (ty->next) ty->next->prev = s; 172 ty->next = s; 173 s->prev = ty; 174 return s; 175 } 176 s = s->next; 177 } while (s && (s != ty->next)); 178 return 0; 179 } 180 181 /* Cast a pointer up an inheritance hierarchy */ 182 SWIGRUNTIME(void *) 183 SWIG_TypeCast(swig_type_info *ty, void *ptr) { 184 if ((!ty) || (!ty->converter)) return ptr; 185 return (*ty->converter)(ptr); 186 } 187 188 /* Dynamic pointer casting. Down an inheritance hierarchy */ 189 SWIGRUNTIME(swig_type_info *) 138 /* Structure to store a type and conversion function used for casting */ 139 typedef struct swig_cast_info { 140 swig_type_info *type; /* pointer to type that is equivalent to this type */ 141 swig_converter_func converter; /* function to cast the void pointers */ 142 struct swig_cast_info *next; /* pointer to next cast in linked list */ 143 struct swig_cast_info *prev; /* pointer to the previous cast */ 144 } swig_cast_info; 145 146 /* Structure used to store module information 147 * Each module generates one structure like this, and the runtime collects 148 * all of these structures and stores them in a circularly linked list.*/ 149 typedef struct swig_module_info { 150 swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ 151 size_t size; /* Number of types in this module */ 152 struct swig_module_info *next; /* Pointer to next element in circularly linked list */ 153 swig_type_info **type_initial; /* Array of initially generated type structures */ 154 swig_cast_info **cast_initial; /* Array of initially generated casting structures */ 155 void *clientdata; /* Language specific module data */ 156 } swig_module_info; 157 158 159 /* 160 Compare two type names skipping the space characters, therefore 161 "char*" == "char *" and "Class<int>" == "Class<int >", etc. 162 163 Return 0 when the two name types are equivalent, as in 164 strncmp, but skipping ' '. 165 */ 166 SWIGRUNTIME int 167 SWIG_TypeNameComp(const char *f1, const char *l1, 168 const char *f2, const char *l2) { 169 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { 170 while ((*f1 == ' ') && (f1 != l1)) ++f1; 171 while ((*f2 == ' ') && (f2 != l2)) ++f2; 172 if (*f1 != *f2) return (int)(*f1 - *f2); 173 } 174 return (l1 - f1) - (l2 - f2); 175 } 176 177 /* 178 Check type equivalence in a name list like <name1>|<name2>|... 179 Return 0 if not equal, 1 if equal 180 */ 181 SWIGRUNTIME int 182 SWIG_TypeEquiv(const char *nb, const char *tb) { 183 int equiv = 0; 184 const char* te = tb + strlen(tb); 185 const char* ne = nb; 186 while (!equiv && *ne) { 187 for (nb = ne; *ne; ++ne) { 188 if (*ne == '|') break; 189 } 190 equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; 191 if (*ne) ++ne; 192 } 193 return equiv; 194 } 195 196 /* 197 Check type equivalence in a name list like <name1>|<name2>|... 198 Return 0 if equal, -1 if nb < tb, 1 if nb > tb 199 */ 200 SWIGRUNTIME int 201 SWIG_TypeCompare(const char *nb, const char *tb) { 202 int equiv = 0; 203 const char* te = tb + strlen(tb); 204 const char* ne = nb; 205 while (!equiv && *ne) { 206 for (nb = ne; *ne; ++ne) { 207 if (*ne == '|') break; 208 } 209 equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; 210 if (*ne) ++ne; 211 } 212 return equiv; 213 } 214 215 216 /* think of this as a c++ template<> or a scheme macro */ 217 #define SWIG_TypeCheck_Template(comparison, ty) \ 218 if (ty) { \ 219 swig_cast_info *iter = ty->cast; \ 220 while (iter) { \ 221 if (comparison) { \ 222 if (iter == ty->cast) return iter; \ 223 /* Move iter to the top of the linked list */ \ 224 iter->prev->next = iter->next; \ 225 if (iter->next) \ 226 iter->next->prev = iter->prev; \ 227 iter->next = ty->cast; \ 228 iter->prev = 0; \ 229 if (ty->cast) ty->cast->prev = iter; \ 230 ty->cast = iter; \ 231 return iter; \ 232 } \ 233 iter = iter->next; \ 234 } \ 235 } \ 236 return 0 237 238 /* 239 Check the typename 240 */ 241 SWIGRUNTIME swig_cast_info * 242 SWIG_TypeCheck(const char *c, swig_type_info *ty) { 243 SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); 244 } 245 246 /* Same as previous function, except strcmp is replaced with a pointer comparison */ 247 SWIGRUNTIME swig_cast_info * 248 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { 249 SWIG_TypeCheck_Template(iter->type == from, into); 250 } 251 252 /* 253 Cast a pointer up an inheritance hierarchy 254 */ 255 SWIGRUNTIMEINLINE void * 256 SWIG_TypeCast(swig_cast_info *ty, void *ptr) { 257 return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr); 258 } 259 260 /* 261 Dynamic pointer casting. Down an inheritance hierarchy 262 */ 263 SWIGRUNTIME swig_type_info * 190 264 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { 191 265 swig_type_info *lastty = ty; … … 198 272 } 199 273 200 /* Return the name associated with this type */ 201 SWIGRUNTIME(const char *) 274 /* 275 Return the name associated with this type 276 */ 277 SWIGRUNTIMEINLINE const char * 202 278 SWIG_TypeName(const swig_type_info *ty) { 203 279 return ty->name; 204 280 } 205 281 206 /* Return the pretty name associated with this type, 207 that is an unmangled type name in a form presentable to the user. 282 /* 283 Return the pretty name associated with this type, 284 that is an unmangled type name in a form presentable to the user. 208 285 */ 209 SWIGRUNTIME (const char *)286 SWIGRUNTIME const char * 210 287 SWIG_TypePrettyName(const swig_type_info *type) { 211 288 /* The "str" field contains the equivalent pretty names of the … … 225 302 226 303 /* 227 Compare two type names skipping the space characters, therefore 228 "char*" == "char *" and "Class<int>" == "Class<int >", etc. 229 230 Return 0 when the two name types are equivalent, as in 231 strncmp, but skipping ' '. 304 Set the clientdata field for a type 232 305 */ 233 static int 234 SWIG_TypeNameComp(const char *f1, const char *l1, 235 const char *f2, const char *l2) { 236 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { 237 while ((*f1 == ' ') && (f1 != l1)) ++f1; 238 while ((*f2 == ' ') && (f2 != l2)) ++f2; 239 if (*f1 != *f2) return *f1 - *f2; 240 } 241 return (l1 - f1) - (l2 - f2); 306 SWIGRUNTIME void 307 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { 308 swig_cast_info *cast = ti->cast; 309 /* if (ti->clientdata == clientdata) return; */ 310 ti->clientdata = clientdata; 311 312 while (cast) { 313 if (!cast->converter) { 314 swig_type_info *tc = cast->type; 315 if (!tc->clientdata) { 316 SWIG_TypeClientData(tc, clientdata); 317 } 318 } 319 cast = cast->next; 320 } 242 321 } 243 322 244 323 /* 245 Check type equivalence in a name list like <name1>|<name2>|... 324 Search for a swig_type_info structure only by mangled name 325 Search is a O(log #types) 326 327 We start searching at module start, and finish searching when start == end. 328 Note: if start == end at the beginning of the function, we go all the way around 329 the circular list. 246 330 */ 247 static int 248 SWIG_TypeEquiv(const char *nb, const char *tb) { 249 int equiv = 0; 250 const char* te = tb + strlen(tb); 251 const char* ne = nb; 252 while (!equiv && *ne) { 253 for (nb = ne; *ne; ++ne) { 254 if (*ne == '|') break; 255 } 256 equiv = SWIG_TypeNameComp(nb, ne, tb, te) == 0; 257 if (*ne) ++ne; 258 } 259 return equiv; 260 } 331 SWIGRUNTIME swig_type_info * 332 SWIG_MangledTypeQueryModule(swig_module_info *start, 333 swig_module_info *end, 334 const char *name) { 335 swig_module_info *iter = start; 336 do { 337 if (iter->size) { 338 register size_t l = 0; 339 register size_t r = iter->size - 1; 340 do { 341 /* since l+r >= 0, we can (>> 1) instead (/ 2) */ 342 register size_t i = (l + r) >> 1; 343 const char *iname = iter->types[i]->name; 344 if (iname) { 345 register int compare = strcmp(name, iname); 346 if (compare == 0) { 347 return iter->types[i]; 348 } else if (compare < 0) { 349 if (i) { 350 r = i - 1; 351 } else { 352 break; 353 } 354 } else if (compare > 0) { 355 l = i + 1; 356 } 357 } else { 358 break; /* should never happen */ 359 } 360 } while (l <= r); 361 } 362 iter = iter->next; 363 } while (iter != end); 364 return 0; 365 } 366 367 /* 368 Search for a swig_type_info structure for either a mangled name or a human readable name. 369 It first searches the mangled names of the types, which is a O(log #types) 370 If a type is not found it then searches the human readable names, which is O(#types). 261 371 262 263 /* Search for a swig_type_info structure */ 264 SWIGRUNTIME(swig_type_info *) 265 SWIG_TypeQuery(const char *name) { 266 swig_type_info *ty = *swig_type_list_handle; 267 while (ty) { 268 if (ty->str && (SWIG_TypeEquiv(ty->str,name))) return ty; 269 if (ty->name && (strcmp(name,ty->name) == 0)) return ty; 270 ty = ty->prev; 271 } 372 We start searching at module start, and finish searching when start == end. 373 Note: if start == end at the beginning of the function, we go all the way around 374 the circular list. 375 */ 376 SWIGRUNTIME swig_type_info * 377 SWIG_TypeQueryModule(swig_module_info *start, 378 swig_module_info *end, 379 const char *name) { 380 /* STEP 1: Search the name field using binary search */ 381 swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); 382 if (ret) { 383 return ret; 384 } else { 385 /* STEP 2: If the type hasn't been found, do a complete search 386 of the str field (the human readable name) */ 387 swig_module_info *iter = start; 388 do { 389 register size_t i = 0; 390 for (; i < iter->size; ++i) { 391 if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) 392 return iter->types[i]; 393 } 394 iter = iter->next; 395 } while (iter != end); 396 } 397 398 /* neither found a match */ 272 399 return 0; 273 400 } 274 401 275 /* Set the clientdata field for a type */ 276 SWIGRUNTIME(void) 277 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { 278 swig_type_info *tc, *equiv; 279 if (ti->clientdata == clientdata) return; 280 ti->clientdata = clientdata; 281 equiv = ti->next; 282 while (equiv) { 283 if (!equiv->converter) { 284 tc = *swig_type_list_handle; 285 while (tc) { 286 if ((strcmp(tc->name, equiv->name) == 0)) 287 SWIG_TypeClientData(tc,clientdata); 288 tc = tc->prev; 289 } 290 } 291 equiv = equiv->next; 292 } 293 } 294 295 /* Pack binary data into a string */ 296 SWIGRUNTIME(char *) 297 SWIG_PackData(char *c, void *ptr, int sz) { 298 static char hex[17] = "0123456789abcdef"; 299 unsigned char *u = (unsigned char *) ptr; 300 const unsigned char *eu = u + sz; 301 register unsigned char uu; 402 403 /* 404 Pack binary data into a string 405 */ 406 SWIGRUNTIME char * 407 SWIG_PackData(char *c, void *ptr, size_t sz) { 408 static const char hex[17] = "0123456789abcdef"; 409 register const unsigned char *u = (unsigned char *) ptr; 410 register const unsigned char *eu = u + sz; 302 411 for (; u != eu; ++u) { 303 uu = *u;412 register unsigned char uu = *u; 304 413 *(c++) = hex[(uu & 0xf0) >> 4]; 305 414 *(c++) = hex[uu & 0xf]; … … 308 417 } 309 418 310 /* Unpack binary data from a string */311 SWIGRUNTIME(char *) 312 SWIG_UnpackData(char *c, void *ptr, int sz) { 313 register unsigned char uu = 0; 314 register int d; 315 unsigned char *u = (unsigned char *) ptr;316 const unsigned char *eu =u + sz;419 /* 420 Unpack binary data from a string 421 */ 422 SWIGRUNTIME const char * 423 SWIG_UnpackData(const char *c, void *ptr, size_t sz) { 424 register unsigned char *u = (unsigned char *) ptr; 425 register const unsigned char *eu = u + sz; 317 426 for (; u != eu; ++u) { 318 d = *(c++); 427 register char d = *(c++); 428 register unsigned char uu = 0; 319 429 if ((d >= '0') && (d <= '9')) 320 430 uu = ((d - '0') << 4); 321 431 else if ((d >= 'a') && (d <= 'f')) 322 432 uu = ((d - ('a'-10)) << 4); 433 else 434 return (char *) 0; 323 435 d = *(c++); 324 436 if ((d >= '0') && (d <= '9')) … … 326 438 else if ((d >= 'a') && (d <= 'f')) 327 439 uu |= (d - ('a'-10)); 440 else 441 return (char *) 0; 328 442 *u = uu; 329 443 } … … 331 445 } 332 446 333 #endif 447 /* 448 Pack 'void *' into a string buffer. 449 */ 450 SWIGRUNTIME char * 451 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { 452 char *r = buff; 453 if ((2*sizeof(void *) + 2) > bsz) return 0; 454 *(r++) = '_'; 455 r = SWIG_PackData(r,&ptr,sizeof(void *)); 456 if (strlen(name) + 1 > (bsz - (r - buff))) return 0; 457 strcpy(r,name); 458 return buff; 459 } 460 461 SWIGRUNTIME const char * 462 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { 463 if (*c != '_') { 464 if (strcmp(c,"NULL") == 0) { 465 *ptr = (void *) 0; 466 return name; 467 } else { 468 return 0; 469 } 470 } 471 return SWIG_UnpackData(++c,ptr,sizeof(void *)); 472 } 473 474 SWIGRUNTIME char * 475 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { 476 char *r = buff; 477 size_t lname = (name ? strlen(name) : 0); 478 if ((2*sz + 2 + lname) > bsz) return 0; 479 *(r++) = '_'; 480 r = SWIG_PackData(r,ptr,sz); 481 if (lname) { 482 strncpy(r,name,lname+1); 483 } else { 484 *r = 0; 485 } 486 return buff; 487 } 488 489 SWIGRUNTIME const char * 490 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { 491 if (*c != '_') { 492 if (strcmp(c,"NULL") == 0) { 493 memset(ptr,0,sz); 494 return name; 495 } else { 496 return 0; 497 } 498 } 499 return SWIG_UnpackData(++c,ptr,sz); 500 } 334 501 335 502 #ifdef __cplusplus 336 503 } 337 504 #endif 505 506 /* ----------------------------------------------------------------------------- 507 * SWIG API. Portion that goes into the runtime 508 * ----------------------------------------------------------------------------- */ 509 510 #ifdef __cplusplus 511 extern "C" { 512 #endif 513 514 /* ----------------------------------------------------------------------------- 515 * for internal method declarations 516 * ----------------------------------------------------------------------------- */ 517 518 #ifndef SWIGINTERN 519 # define SWIGINTERN static SWIGUNUSED 520 #endif 521 522 #ifndef SWIGINTERNINLINE 523 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE 524 #endif 525 526 /* 527 Exception handling in wrappers 528 */ 529 #define SWIG_fail goto fail 530 #define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) 531 #define SWIG_append_errmsg(msg) SWIG_Python_AddErrMesg(msg,0) 532 #define SWIG_preppend_errmsg(msg) SWIG_Python_AddErrMesg(msg,1) 533 #define SWIG_type_error(type,obj) SWIG_Python_TypeError(type,obj) 534 #define SWIG_null_ref(type) SWIG_Python_NullRef(type) 535 536 /* 537 Contract support 538 */ 539 #define SWIG_contract_assert(expr, msg) \ 540 if (!(expr)) { PyErr_SetString(PyExc_RuntimeError, (char *) msg ); goto fail; } else 541 542 /* ----------------------------------------------------------------------------- 543 * Constant declarations 544 * ----------------------------------------------------------------------------- */ 545 546 /* Constant Types */ 547 #define SWIG_PY_INT 1 548 #define SWIG_PY_FLOAT 2 549 #define SWIG_PY_STRING 3 550 #define SWIG_PY_POINTER 4 551 #define SWIG_PY_BINARY 5 552 553 /* Constant information structure */ 554 typedef struct swig_const_info { 555 int type; 556 char *name; 557 long lvalue; 558 double dvalue; 559 void *pvalue; 560 swig_type_info **ptype; 561 } swig_const_info; 562 563 564 /* ----------------------------------------------------------------------------- 565 * Alloc. memory flags 566 * ----------------------------------------------------------------------------- */ 567 #define SWIG_OLDOBJ 1 568 #define SWIG_NEWOBJ SWIG_OLDOBJ + 1 569 #define SWIG_PYSTR SWIG_NEWOBJ + 1 570 571 #ifdef __cplusplus 572 } 573 #endif 574 338 575 339 576 /*********************************************************************** … … 347 584 ************************************************************************/ 348 585 586 /* Common SWIG API */ 587 #define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Python_ConvertPtr(obj, pp, type, flags) 588 #define SWIG_NewPointerObj(p, type, flags) SWIG_Python_NewPointerObj(p, type, flags) 589 #define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) 590 591 592 /* Python-specific SWIG API */ 593 #define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) SWIG_Python_ConvertPacked(obj, ptr, sz, ty, flags) 594 #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) 595 596 /* Runtime API */ 597 #define SWIG_GetModule(clientdata) SWIG_Python_GetModule() 598 #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) 599 600 /* ----------------------------------------------------------------------------- 601 * Pointer declarations 602 * ----------------------------------------------------------------------------- */ 603 /* 604 Use SWIG_NO_COBJECT_TYPES to force the use of strings to represent 605 C/C++ pointers in the python side. Very useful for debugging, but 606 not always safe. 607 */ 608 #if !defined(SWIG_NO_COBJECT_TYPES) && !defined(SWIG_COBJECT_TYPES) 609 # define SWIG_COBJECT_TYPES 610 #endif 611 612 /* Flags for pointer conversion */ 613 #define SWIG_POINTER_EXCEPTION 0x1 614 #define SWIG_POINTER_DISOWN 0x2 615 616 617 /* Add PyOS_snprintf for old Pythons */ 618 #if PY_VERSION_HEX < 0x02020000 619 #define PyOS_snprintf snprintf 620 #endif 621 349 622 #ifdef __cplusplus 350 623 extern "C" { 351 624 #endif 352 625 353 #define SWIG_PY_INT 1 354 #define SWIG_PY_FLOAT 2 355 #define SWIG_PY_STRING 3 356 #define SWIG_PY_POINTER 4 357 #define SWIG_PY_BINARY 5 358 359 /* Flags for pointer conversion */ 360 361 #define SWIG_POINTER_EXCEPTION 0x1 362 #define SWIG_POINTER_DISOWN 0x2 363 364 /* Exception handling in wrappers */ 365 #define SWIG_fail goto fail 366 367 /* Constant information structure */ 368 typedef struct swig_const_info { 369 int type; 370 char *name; 371 long lvalue; 372 double dvalue; 373 void *pvalue; 374 swig_type_info **ptype; 375 } swig_const_info; 376 377 /* Common SWIG API */ 378 #define SWIG_ConvertPtr(obj, pp, type, flags) \ 379 SWIG_Python_ConvertPtr(obj, pp, type, flags) 380 #define SWIG_NewPointerObj(p, type, flags) \ 381 SWIG_Python_NewPointerObj(p, type, flags) 382 #define SWIG_MustGetPtr(p, type, argnum, flags) \ 383 SWIG_Python_MustGetPtr(p, type, argnum, flags) 384 385 /* Python-specific SWIG API */ 386 #define SWIG_newvarlink() \ 387 SWIG_Python_newvarlink() 388 #define SWIG_addvarlink(p, name, get_attr, set_attr) \ 389 SWIG_Python_addvarlink(p, name, get_attr, set_attr) 390 #define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) \ 391 SWIG_Python_ConvertPacked(obj, ptr, sz, ty, flags) 392 #define SWIG_NewPackedObj(ptr, sz, type) \ 393 SWIG_Python_NewPackedObj(ptr, sz, type) 394 #define SWIG_InstallConstants(d, constants) \ 395 SWIG_Python_InstallConstants(d, constants) 396 397 typedef double (*py_objasdbl_conv)(PyObject *obj); 398 399 #ifdef SWIG_NOINCLUDE 400 401 SWIGIMPORT(int) SWIG_Python_ConvertPtr(PyObject *, void **, swig_type_info *, int); 402 SWIGIMPORT(PyObject *) SWIG_Python_NewPointerObj(void *, swig_type_info *,int own); 403 SWIGIMPORT(void *) SWIG_Python_MustGetPtr(PyObject *, swig_type_info *, int, int); 404 SWIGIMPORT(PyObject *) SWIG_Python_newvarlink(void); 405 SWIGIMPORT(void) SWIG_Python_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *)); 406 SWIGIMPORT(int) SWIG_Python_ConvertPacked(PyObject *, void *, int sz, swig_type_info *, int); 407 SWIGIMPORT(PyObject *) SWIG_Python_NewPackedObj(void *, int sz, swig_type_info *); 408 SWIGIMPORT(void) SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]); 409 626 /* ----------------------------------------------------------------------------- 627 * Create a new pointer string 628 * ----------------------------------------------------------------------------- */ 629 #ifndef SWIG_BUFFER_SIZE 630 #define SWIG_BUFFER_SIZE 1024 631 #endif 632 633 /* A crude PyString_FromFormat implementation for old Pythons */ 634 #if PY_VERSION_HEX < 0x02020000 635 static PyObject * 636 PyString_FromFormat(const char *fmt, ...) { 637 va_list ap; 638 char buf[SWIG_BUFFER_SIZE * 2]; 639 int res; 640 va_start(ap, fmt); 641 res = vsnprintf(buf, sizeof(buf), fmt, ap); 642 va_end(ap); 643 return (res < 0 || res >= sizeof(buf)) ? 0 : PyString_FromString(buf); 644 } 645 #endif 646 647 #if PY_VERSION_HEX < 0x01060000 648 #define PyObject_Del(op) PyMem_DEL((op)) 649 #endif 650 651 #if defined(SWIG_COBJECT_TYPES) 652 #if !defined(SWIG_COBJECT_PYTHON) 653 /* ----------------------------------------------------------------------------- 654 * Implements a simple Swig Object type, and use it instead of PyCObject 655 * ----------------------------------------------------------------------------- */ 656 657 typedef struct { 658 PyObject_HEAD 659 void *ptr; 660 const char *desc; 661 } PySwigObject; 662 663 /* Declarations for objects of type PySwigObject */ 664 665 SWIGRUNTIME int 666 PySwigObject_print(PySwigObject *v, FILE *fp, int flags) 667 { 668 char result[SWIG_BUFFER_SIZE]; 669 flags = flags; 670 if (SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result))) { 671 fputs("<Swig Object at ", fp); fputs(result, fp); fputs(">", fp); 672 return 0; 673 } else { 674 return 1; 675 } 676 } 677 678 SWIGRUNTIME PyObject * 679 PySwigObject_repr(PySwigObject *v) 680 { 681 char result[SWIG_BUFFER_SIZE]; 682 return SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result)) ? 683 PyString_FromFormat("<Swig Object at %s>", result) : 0; 684 } 685 686 SWIGRUNTIME PyObject * 687 PySwigObject_str(PySwigObject *v) 688 { 689 char result[SWIG_BUFFER_SIZE]; 690 return SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result)) ? 691 PyString_FromString(result) : 0; 692 } 693 694 SWIGRUNTIME PyObject * 695 PySwigObject_long(PySwigObject *v) 696 { 697 return PyLong_FromVoidPtr(v->ptr); 698 } 699 700 SWIGRUNTIME PyObject * 701 PySwigObject_format(const char* fmt, PySwigObject *v) 702 { 703 PyObject *res = NULL; 704 PyObject *args = PyTuple_New(1); 705 if (args && (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0)) { 706 PyObject *ofmt = PyString_FromString(fmt); 707 if (ofmt) { 708 res = PyString_Format(ofmt,args); 709 Py_DECREF(ofmt); 710 } 711 Py_DECREF(args); 712 } 713 return res; 714 } 715 716 SWIGRUNTIME PyObject * 717 PySwigObject_oct(PySwigObject *v) 718 { 719 return PySwigObject_format("%o",v); 720 } 721 722 SWIGRUNTIME PyObject * 723 PySwigObject_hex(PySwigObject *v) 724 { 725 return PySwigObject_format("%x",v); 726 } 727 728 SWIGRUNTIME int 729 PySwigObject_compare(PySwigObject *v, PySwigObject *w) 730 { 731 int c = strcmp(v->desc, w->desc); 732 if (c) { 733 return (c > 0) ? 1 : -1; 734 } else { 735 void *i = v->ptr; 736 void *j = w->ptr; 737 return (i < j) ? -1 : ((i > j) ? 1 : 0); 738 } 739 } 740 741 SWIGRUNTIME void 742 PySwigObject_dealloc(PySwigObject *self) 743 { 744 PyObject_Del(self); 745 } 746 747 SWIGRUNTIME PyTypeObject* 748 PySwigObject_type(void) { 749 static char pyswigobject_type__doc__[] = 750 "Swig object carries a C/C++ instance pointer"; 751 752 static PyNumberMethods PySwigObject_as_number = { 753 (binaryfunc)0, /*nb_add*/ 754 (binaryfunc)0, /*nb_subtract*/ 755 (binaryfunc)0, /*nb_multiply*/ 756 (binaryfunc)0, /*nb_divide*/ 757 (binaryfunc)0, /*nb_remainder*/ 758 (binaryfunc)0, /*nb_divmod*/ 759 (ternaryfunc)0,/*nb_power*/ 760 (unaryfunc)0, /*nb_negative*/ 761 (unaryfunc)0, /*nb_positive*/ 762 (unaryfunc)0, /*nb_absolute*/ 763 (inquiry)0, /*nb_nonzero*/ 764 0, /*nb_invert*/ 765 0, /*nb_lshift*/ 766 0, /*nb_rshift*/ 767 0, /*nb_and*/ 768 0, /*nb_xor*/ 769 0, /*nb_or*/ 770 (coercion)0, /*nb_coerce*/ 771 (unaryfunc)PySwigObject_long, /*nb_int*/ 772 (unaryfunc)PySwigObject_long, /*nb_long*/ 773 (unaryfunc)0, /*nb_float*/ 774 (unaryfunc)PySwigObject_oct, /*nb_oct*/ 775 (unaryfunc)PySwigObject_hex, /*nb_hex*/ 776 #if PY_VERSION_HEX >= 0x02020000 777 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ 778 #elif PY_VERSION_HEX >= 0x02000000 779 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */ 780 #endif 781 }; 782 783 static PyTypeObject pyswigobject_type 784 #if !defined(__cplusplus) 785 ; 786 static int type_init = 0; 787 if (!type_init) { 788 PyTypeObject tmp 789 #endif 790 = { 791 PyObject_HEAD_INIT(&PyType_Type) 792 0, /*ob_size*/ 793 (char *)"PySwigObject", /*tp_name*/ 794 sizeof(PySwigObject), /*tp_basicsize*/ 795 0, /*tp_itemsize*/ 796 /* methods */ 797 (destructor)PySwigObject_dealloc, /*tp_dealloc*/ 798 (printfunc)PySwigObject_print, /*tp_print*/ 799 (getattrfunc)0, /*tp_getattr*/ 800 (setattrfunc)0, /*tp_setattr*/ 801 (cmpfunc)PySwigObject_compare, /*tp_compare*/ 802 (reprfunc)PySwigObject_repr, /*tp_repr*/ 803 &PySwigObject_as_number, /*tp_as_number*/ 804 0, /*tp_as_sequence*/ 805 0, /*tp_as_mapping*/ 806 (hashfunc)0, /*tp_hash*/ 807 (ternaryfunc)0, /*tp_call*/ 808 (reprfunc)PySwigObject_str, /*tp_str*/ 809 /* Space for future expansion */ 810 0,0,0,0, 811 pyswigobject_type__doc__, /* Documentation string */ 812 #if PY_VERSION_HEX >= 0x02000000 813 0, /* tp_traverse */ 814 0, /* tp_clear */ 815 #endif 816 #if PY_VERSION_HEX >= 0x02010000 817 0, /* tp_richcompare */ 818 0, /* tp_weaklistoffset */ 819 #endif 820 #if PY_VERSION_HEX >= 0x02020000 821 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ 822 #endif 823 #if PY_VERSION_HEX >= 0x02030000 824 0, /* tp_del */ 825 #endif 826 #ifdef COUNT_ALLOCS 827 0,0,0,0 /* tp_alloc -> tp_next */ 828 #endif 829 }; 830 #if !defined(__cplusplus) 831 pyswigobject_type = tmp; 832 type_init = 1; 833 } 834 #endif 835 return &pyswigobject_type; 836 } 837 838 SWIGRUNTIME PyObject * 839 PySwigObject_FromVoidPtrAndDesc(void *ptr, const char *desc) 840 { 841 PySwigObject *self = PyObject_NEW(PySwigObject, PySwigObject_type()); 842 if (self) { 843 self->ptr = ptr; 844 self->desc = desc; 845 } 846 return (PyObject *)self; 847 } 848 849 SWIGRUNTIMEINLINE void * 850 PySwigObject_AsVoidPtr(PyObject *self) 851 { 852 return ((PySwigObject *)self)->ptr; 853 } 854 855 SWIGRUNTIMEINLINE const char * 856 PySwigObject_GetDesc(PyObject *self) 857 { 858 return ((PySwigObject *)self)->desc; 859 } 860 861 SWIGRUNTIMEINLINE int 862 PySwigObject_Check(PyObject *op) { 863 return ((op)->ob_type == PySwigObject_type()) 864 || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0); 865 } 866 867 /* ----------------------------------------------------------------------------- 868 * Implements a simple Swig Packed type, and use it instead of string 869 * ----------------------------------------------------------------------------- */ 870 871 typedef struct { 872 PyObject_HEAD 873 void *pack; 874 const char *desc; 875 size_t size; 876 } PySwigPacked; 877 878 SWIGRUNTIME int 879 PySwigPacked_print(PySwigPacked *v, FILE *fp, int flags) 880 { 881 char result[SWIG_BUFFER_SIZE]; 882 flags = flags; 883 fputs("<Swig Packed ", fp); 884 if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { 885 fputs("at ", fp); 886 fputs(result, fp); 887 } 888 fputs(v->desc,fp); 889 fputs(">", fp); 890 return 0; 891 } 892 893 SWIGRUNTIME PyObject * 894 PySwigPacked_repr(PySwigPacked *v) 895 { 896 char result[SWIG_BUFFER_SIZE]; 897 if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { 898 return PyString_FromFormat("<Swig Packed at %s%s>", result, v->desc); 899 } else { 900 return PyString_FromFormat("<Swig Packed %s>", v->desc); 901 } 902 } 903 904 SWIGRUNTIME PyObject * 905 PySwigPacked_str(PySwigPacked *v) 906 { 907 char result[SWIG_BUFFER_SIZE]; 908 if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ 909 return PyString_FromFormat("%s%s", result, v->desc); 910 } else { 911 return PyString_FromString(v->desc); 912 } 913 } 914 915 SWIGRUNTIME int 916 PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w) 917 { 918 int c = strcmp(v->desc, w->desc); 919 if (c) { 920 return (c > 0) ? 1 : -1; 921 } else { 922 size_t i = v->size; 923 size_t j = w->size; 924 int s = (i < j) ? -1 : ((i > j) ? 1 : 0); 925 return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size); 926 } 927 } 928 929 SWIGRUNTIME void 930 PySwigPacked_dealloc(PySwigPacked *self) 931 { 932 free(self->pack); 933 PyObject_Del(self); 934 } 935 936 SWIGRUNTIME PyTypeObject* 937 PySwigPacked_type(void) { 938 static char pyswigpacked_type__doc__[] = 939 "Swig object carries a C/C++ instance pointer"; 940 static PyTypeObject pyswigpacked_type 941 #if !defined(__cplusplus) 942 ; 943 static int type_init = 0; 944 if (!type_init) { 945 PyTypeObject tmp 946 #endif 947 = { 948 PyObject_HEAD_INIT(&PyType_Type) 949 0, /*ob_size*/ 950 (char *)"PySwigPacked", /*tp_name*/ 951 sizeof(PySwigPacked), /*tp_basicsize*/ 952 0, /*tp_itemsize*/ 953 /* methods */ 954 (destructor)PySwigPacked_dealloc, /*tp_dealloc*/ 955 (printfunc)PySwigPacked_print, /*tp_print*/ 956 (getattrfunc)0, /*tp_getattr*/ 957 (setattrfunc)0, /*tp_setattr*/ 958 (cmpfunc)PySwigPacked_compare, /*tp_compare*/ 959 (reprfunc)PySwigPacked_repr, /*tp_repr*/ 960 0, /*tp_as_number*/ 961 0, /*tp_as_sequence*/ 962 0, /*tp_as_mapping*/ 963 (hashfunc)0, /*tp_hash*/ 964 (ternaryfunc)0, /*tp_call*/ 965 (reprfunc)PySwigPacked_str, /*tp_str*/ 966 /* Space for future expansion */ 967 0,0,0,0, 968 pyswigpacked_type__doc__, /* Documentation string */ 969 #if PY_VERSION_HEX >= 0x02000000 970 0, /* tp_traverse */ 971 0, /* tp_clear */ 972 #endif 973 #if PY_VERSION_HEX >= 0x02010000 974 0, /* tp_richcompare */ 975 0, /* tp_weaklistoffset */ 976 #endif 977 #if PY_VERSION_HEX >= 0x02020000 978 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ 979 #endif 980 #if PY_VERSION_HEX >= 0x02030000 981 0, /* tp_del */ 982 #endif 983 #ifdef COUNT_ALLOCS 984 0,0,0,0 /* tp_alloc -> tp_next */ 985 #endif 986 }; 987 #if !defined(__cplusplus) 988 pyswigpacked_type = tmp; 989 type_init = 1; 990 } 991 #endif 992 return &pyswigpacked_type; 993 } 994 995 SWIGRUNTIME PyObject * 996 PySwigPacked_FromDataAndDesc(void *ptr, size_t size, const char *desc) 997 { 998 PySwigPacked *self = PyObject_NEW(PySwigPacked, PySwigPacked_type()); 999 if (self == NULL) { 1000 return NULL; 1001 } else { 1002 void *pack = malloc(size); 1003 if (pack) { 1004 memcpy(pack, ptr, size); 1005 self->pack = pack; 1006 self->desc = desc; 1007 self->size = size; 1008 return (PyObject *) self; 1009 } 1010 return NULL; 1011 } 1012 } 1013 1014 SWIGRUNTIMEINLINE const char * 1015 PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size) 1016 { 1017 PySwigPacked *self = (PySwigPacked *)obj; 1018 if (self->size != size) return 0; 1019 memcpy(ptr, self->pack, size); 1020 return self->desc; 1021 } 1022 1023 SWIGRUNTIMEINLINE const char * 1024 PySwigPacked_GetDesc(PyObject *self) 1025 { 1026 return ((PySwigPacked *)self)->desc; 1027 } 1028 1029 SWIGRUNTIMEINLINE int 1030 PySwigPacked_Check(PyObject *op) { 1031 return ((op)->ob_type == PySwigPacked_type()) 1032 || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0); 1033 } 410 1034 411 1035 #else 412 413 414 1036 /* ----------------------------------------------------------------------------- 415 * global variable support code.1037 * Use the old Python PyCObject instead of PySwigObject 416 1038 * ----------------------------------------------------------------------------- */ 417 1039 418 typedef struct swig_globalvar { 419 char *name; /* Name of global variable */ 420 PyObject *(*get_attr)(void); /* Return the current value */ 421 int (*set_attr)(PyObject *); /* Set the value */ 422 struct swig_globalvar *next; 423 } swig_globalvar; 424 425 typedef struct swig_varlinkobject { 426 PyObject_HEAD 427 swig_globalvar *vars; 428 } swig_varlinkobject; 429 430 static PyObject * 431 swig_varlink_repr(swig_varlinkobject *v) { 432 v = v; 433 return PyString_FromString("<Global variables>"); 434 } 435 436 static int 437 swig_varlink_print(swig_varlinkobject *v, FILE *fp, int flags) { 438 swig_globalvar *var; 439 flags = flags; 440 fprintf(fp,"Global variables { "); 441 for (var = v->vars; var; var=var->next) { 442 fprintf(fp,"%s", var->name); 443 if (var->next) fprintf(fp,", "); 444 } 445 fprintf(fp," }\n"); 446 return 0; 447 } 448 449 static PyObject * 450 swig_varlink_getattr(swig_varlinkobject *v, char *n) { 451 swig_globalvar *var = v->vars; 452 while (var) { 453 if (strcmp(var->name,n) == 0) { 454 return (*var->get_attr)(); 455 } 456 var = var->next; 457 } 458 PyErr_SetString(PyExc_NameError,"Unknown C global variable"); 459 return NULL; 460 } 461 462 static int 463 swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { 464 swig_globalvar *var = v->vars; 465 while (var) { 466 if (strcmp(var->name,n) == 0) { 467 return (*var->set_attr)(p); 468 } 469 var = var->next; 470 } 471 PyErr_SetString(PyExc_NameError,"Unknown C global variable"); 472 return 1; 473 } 474 475 statichere PyTypeObject varlinktype = { 476 PyObject_HEAD_INIT(0) 477 0, /* Number of items in variable part (ob_size) */ 478 (char *)"swigvarlink", /* Type name (tp_name) */ 479 sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ 480 0, /* Itemsize (tp_itemsize) */ 481 0, /* Deallocator (tp_dealloc) */ 482 (printfunc) swig_varlink_print, /* Print (tp_print) */ 483 (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ 484 (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */ 485 0, /* tp_compare */ 486 (reprfunc) swig_varlink_repr, /* tp_repr */ 487 0, /* tp_as_number */ 488 0, /* tp_as_sequence */ 489 0, /* tp_as_mapping */ 490 0, /* tp_hash */ 491 0, /* tp_call */ 492 0, /* tp_str */ 493 0, /* tp_getattro */ 494 0, /* tp_setattro */ 495 0, /* tp_as_buffer */ 496 0, /* tp_flags */ 497 0, /* tp_doc */ 498 0, /* tp_traverse */ 499 0, /* tp_clear */ 500 0, /* tp_richcompare */ 501 0, /* tp_weaklistoffset */ 502 #if PY_VERSION_HEX >= 0x02020000 503 0, /* tp_iter */ 504 0, /* tp_iternext */ 505 0, /* tp_methods */ 506 0, /* tp_members */ 507 0, /* tp_getset */ 508 0, /* tp_base */ 509 0, /* tp_dict */ 510 0, /* tp_descr_get */ 511 0, /* tp_descr_set */ 512 0, /* tp_dictoffset */ 513 0, /* tp_init */ 514 0, /* tp_alloc */ 515 0, /* tp_new */ 516 0, /* tp_free */ 517 0, /* tp_is_gc */ 518 0, /* tp_bases */ 519 0, /* tp_mro */ 520 0, /* tp_cache */ 521 0, /* tp_subclasses */ 522 0, /* tp_weaklist */ 523 #endif 524 #if PY_VERSION_HEX >= 0x02030200 525 0, /* tp_del */ 526 #endif 527 #ifdef COUNT_ALLOCS 528 /* these must be last */ 529 0, /* tp_alloc */ 530 0, /* tp_free */ 531 0, /* tp_maxalloc */ 532 0, /* tp_next */ 533 #endif 534 }; 535 536 /* Create a variable linking object for use later */ 537 SWIGRUNTIME(PyObject *) 538 SWIG_Python_newvarlink(void) { 539 swig_varlinkobject *result = 0; 540 result = PyMem_NEW(swig_varlinkobject,1); 541 varlinktype.ob_type = &PyType_Type; /* Patch varlinktype into a PyType */ 542 result->ob_type = &varlinktype; 543 result->vars = 0; 544 result->ob_refcnt = 0; 545 Py_XINCREF((PyObject *) result); 546 return ((PyObject*) result); 547 } 548 549 SWIGRUNTIME(void) 550 SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { 551 swig_varlinkobject *v; 552 swig_globalvar *gv; 553 v= (swig_varlinkobject *) p; 554 gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); 555 gv->name = (char *) malloc(strlen(name)+1); 556 strcpy(gv->name,name); 557 gv->get_attr = get_attr; 558 gv->set_attr = set_attr; 559 gv->next = v->vars; 560 v->vars = gv; 561 } 1040 #define PySwigObject_GetDesc(obj) PyCObject_GetDesc(obj) 1041 #define PySwigObject_Check(obj) PyCObject_Check(obj) 1042 #define PySwigObject_AsVoidPtr(obj) PyCObject_AsVoidPtr(obj) 1043 #define PySwigObject_FromVoidPtrAndDesc(p, d) PyCObject_FromVoidPtrAndDesc(p, d, NULL) 1044 1045 #endif 1046 1047 #endif 1048 1049 /* ----------------------------------------------------------------------------- 1050 * errors manipulation 1051 * ----------------------------------------------------------------------------- */ 1052 1053 SWIGRUNTIME void 1054 SWIG_Python_TypeError(const char *type, PyObject *obj) 1055 { 1056 if (type) { 1057 #if defined(SWIG_COBJECT_TYPES) 1058 if (obj && PySwigObject_Check(obj)) { 1059 const char *otype = (const char *) PySwigObject_GetDesc(obj); 1060 if (otype) { 1061 PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received", 1062 type, otype); 1063 return; 1064 } 1065 } else 1066 #endif 1067 { 1068 const char *otype = (obj ? obj->ob_type->tp_name : 0); 1069 if (otype) { 1070 PyObject *str = PyObject_Str(obj); 1071 const char *cstr = str ? PyString_AsString(str) : 0; 1072 if (cstr) { 1073 PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", 1074 type, otype, cstr); 1075 } else { 1076 PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", 1077 type, otype); 1078 } 1079 Py_XDECREF(str); 1080 return; 1081 } 1082 } 1083 PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); 1084 } else { 1085 PyErr_Format(PyExc_TypeError, "unexpected type is received"); 1086 } 1087 } 1088 1089 SWIGRUNTIMEINLINE void 1090 SWIG_Python_NullRef(const char *type) 1091 { 1092 if (type) { 1093 PyErr_Format(PyExc_TypeError, "null reference of type '%s' was received",type); 1094 } else { 1095 PyErr_Format(PyExc_TypeError, "null reference was received"); 1096 } 1097 } 1098 1099 SWIGRUNTIME int 1100 SWIG_Python_AddErrMesg(const char* mesg, int infront) 1101 { 1102 if (PyErr_Occurred()) { 1103 PyObject *type = 0; 1104 PyObject *value = 0; 1105 PyObject *traceback = 0; 1106 PyErr_Fetch(&type, &value, &traceback); 1107 if (value) { 1108 PyObject *old_str = PyObject_Str(value); 1109 Py_XINCREF(type); 1110 PyErr_Clear(); 1111 if (infront) { 1112 PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str)); 1113 } else { 1114 PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); 1115 } 1116 Py_DECREF(old_str); 1117 } 1118 return 1; 1119 } else { 1120 return 0; 1121 } 1122 } 1123 1124 SWIGRUNTIME int 1125 SWIG_Python_ArgFail(int argnum) 1126 { 1127 if (PyErr_Occurred()) { 1128 /* add information about failing argument */ 1129 char mesg[256]; 1130 PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); 1131 return SWIG_Python_AddErrMesg(mesg, 1); 1132 } else { 1133 return 0; 1134 } 1135 } 1136 1137 1138 /* ----------------------------------------------------------------------------- 1139 * pointers/data manipulation 1140 * ----------------------------------------------------------------------------- */ 562 1141 563 1142 /* Convert a pointer value */ 564 SWIGRUNTIME (int)1143 SWIGRUNTIME int 565 1144 SWIG_Python_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags) { 566 swig_ type_info *tc;567 c har*c = 0;1145 swig_cast_info *tc; 1146 const char *c = 0; 568 1147 static PyObject *SWIG_this = 0; 569 1148 int newref = 0; 570 1149 PyObject *pyobj = 0; 571 1150 void *vptr; 1151 572 1152 if (!obj) return 0; 573 1153 if (obj == Py_None) { … … 575 1155 return 0; 576 1156 } 1157 577 1158 #ifdef SWIG_COBJECT_TYPES 578 if (!(Py CObject_Check(obj))) {1159 if (!(PySwigObject_Check(obj))) { 579 1160 if (!SWIG_this) 580 1161 SWIG_this = PyString_FromString("this"); … … 583 1164 newref = 1; 584 1165 if (!obj) goto type_error; 585 if (!Py CObject_Check(obj)) {1166 if (!PySwigObject_Check(obj)) { 586 1167 Py_DECREF(obj); 587 1168 goto type_error; 588 1169 } 589 1170 } 590 *ptr = PyCObject_AsVoidPtr(obj);591 c = (c har *) PyCObject_GetDesc(obj);592 if (newref) Py_DECREF(obj);593 goto cobject;1171 vptr = PySwigObject_AsVoidPtr(obj); 1172 c = (const char *) PySwigObject_GetDesc(obj); 1173 if (newref) { Py_DECREF(obj); } 1174 goto type_check; 594 1175 #else 595 1176 if (!(PyString_Check(obj))) { … … 605 1186 } 606 1187 } 607 c = PyString_A S_STRING(obj);1188 c = PyString_AsString(obj); 608 1189 /* Pointer values must start with leading underscore */ 609 if (*c != '_') { 610 *ptr = (void *) 0; 611 if (strcmp(c,"NULL") == 0) { 612 if (newref) { Py_DECREF(obj); } 613 return 0; 614 } else { 615 if (newref) { Py_DECREF(obj); } 616 goto type_error; 617 } 618 } 619 c++; 620 c = SWIG_UnpackData(c,ptr,sizeof(void *)); 1190 c = SWIG_UnpackVoidPtr(c, &vptr, ty->name); 621 1191 if (newref) { Py_DECREF(obj); } 622 #endif 623 624 #ifdef SWIG_COBJECT_TYPES 625 cobject: 626 #endif 627 1192 if (!c) goto type_error; 1193 #endif 1194 1195 type_check: 628 1196 if (ty) { 629 1197 tc = SWIG_TypeCheck(c,ty); 630 1198 if (!tc) goto type_error; 631 *ptr = SWIG_TypeCast(tc,(void*) *ptr); 632 } 633 1199 *ptr = SWIG_TypeCast(tc,vptr); 1200 } else { 1201 *ptr = vptr; 1202 } 634 1203 if ((pyobj) && (flags & SWIG_POINTER_DISOWN)) { 635 1204 PyObject_SetAttrString(pyobj,(char*)"thisown",Py_False); 1205 } 1206 return 0; 1207 1208 type_error: 1209 PyErr_Clear(); 1210 if (pyobj && !obj) { 1211 obj = pyobj; 1212 if (PyCFunction_Check(obj)) { 1213 /* here we get the method pointer for callbacks */ 1214 char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); 1215 c = doc ? strstr(doc, "swig_ptr: ") : 0; 1216 if (c) { 1217 c = ty ? SWIG_UnpackVoidPtr(c + 10, &vptr, ty->name) : 0; 1218 if (!c) goto type_error; 1219 goto type_check; 1220 } 1221 } 1222 } 1223 if (flags & SWIG_POINTER_EXCEPTION) { 1224 if (ty) { 1225 SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); 1226 } else { 1227 SWIG_Python_TypeError("C/C++ pointer", obj); 1228 } 1229 } 1230 return -1; 1231 } 1232 1233 /* Convert a pointer value, signal an exception on a type mismatch */ 1234 SWIGRUNTIME void * 1235 SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) { 1236 void *result; 1237 if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { 1238 PyErr_Clear(); 1239 if (flags & SWIG_POINTER_EXCEPTION) { 1240 SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); 1241 SWIG_Python_ArgFail(argnum); 1242 } 1243 } 1244 return result; 1245 } 1246 1247 /* Convert a packed value value */ 1248 SWIGRUNTIME int 1249 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty, int flags) { 1250 swig_cast_info *tc; 1251 const char *c = 0; 1252 1253 #if defined(SWIG_COBJECT_TYPES) && !defined(SWIG_COBJECT_PYTHON) 1254 c = PySwigPacked_UnpackData(obj, ptr, sz); 1255 #else 1256 if ((!obj) || (!PyString_Check(obj))) goto type_error; 1257 c = PyString_AsString(obj); 1258 /* Pointer values must start with leading underscore */ 1259 c = SWIG_UnpackDataName(c, ptr, sz, ty->name); 1260 #endif 1261 if (!c) goto type_error; 1262 if (ty) { 1263 tc = SWIG_TypeCheck(c,ty); 1264 if (!tc) goto type_error; 636 1265 } 637 1266 return 0; … … 640 1269 PyErr_Clear(); 641 1270 if (flags & SWIG_POINTER_EXCEPTION) { 642 if (ty && c) { 643 PyErr_Format(PyExc_TypeError, 644 "Type error. Got %s, expected %s", 645 c, ty->name); 1271 if (ty) { 1272 SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); 646 1273 } else { 647 PyErr_SetString(PyExc_TypeError,"Expected a pointer");1274 SWIG_Python_TypeError("C/C++ packed data", obj); 648 1275 } 649 1276 } 650 1277 return -1; 651 } 652 653 /* Convert a pointer value, signal an exception on a type mismatch */ 654 SWIGRUNTIME(void *) 655 SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) { 656 void *result; 657 SWIG_Python_ConvertPtr(obj, &result, ty, flags | SWIG_POINTER_EXCEPTION); 658 return result; 659 } 660 661 /* Convert a packed value value */ 662 SWIGRUNTIME(int) 663 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, int sz, swig_type_info *ty, int flags) { 664 swig_type_info *tc; 665 char *c = 0; 666 667 if ((!obj) || (!PyString_Check(obj))) goto type_error; 668 c = PyString_AS_STRING(obj); 669 /* Pointer values must start with leading underscore */ 670 if (*c != '_') goto type_error; 671 c++; 672 c = SWIG_UnpackData(c,ptr,sz); 673 if (ty) { 674 tc = SWIG_TypeCheck(c,ty); 675 if (!tc) goto type_error; 676 } 677 return 0; 678 679 type_error: 680 681 if (flags) { 682 if (ty && c) { 683 PyErr_Format(PyExc_TypeError, 684 "Type error. Got %s, expected %s", 685 c, ty->name); 686 } else { 687 PyErr_SetString(PyExc_TypeError,"Expected a pointer"); 688 } 689 } 690 return -1; 691 } 692 693 /* Create a new pointer object */ 694 SWIGRUNTIME(PyObject *) 1278 } 1279 1280 /* Create a new array object */ 1281 SWIGRUNTIME PyObject * 695 1282 SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int own) { 696 PyObject *robj; 1283 PyObject *robj = 0; 1284 if (!type) { 1285 if (!PyErr_Occurred()) { 1286 PyErr_Format(PyExc_TypeError, "Swig: null type passed to NewPointerObj"); 1287 } 1288 return robj; 1289 } 697 1290 if (!ptr) { 698 1291 Py_INCREF(Py_None); … … 700 1293 } 701 1294 #ifdef SWIG_COBJECT_TYPES 702 robj = Py CObject_FromVoidPtrAndDesc((void *) ptr, (char *) type->name, NULL);1295 robj = PySwigObject_FromVoidPtrAndDesc((void *) ptr, (char *)type->name); 703 1296 #else 704 1297 { 705 char result[1024]; 706 char *r = result; 707 *(r++) = '_'; 708 r = SWIG_PackData(r,&ptr,sizeof(void *)); 709 strcpy(r,type->name); 710 robj = PyString_FromString(result); 1298 char result[SWIG_BUFFER_SIZE]; 1299 robj = SWIG_PackVoidPtr(result, ptr, type->name, sizeof(result)) ? 1300 PyString_FromString(result) : 0; 711 1301 } 712 1302 #endif … … 728 1318 } 729 1319 730 SWIGRUNTIME(PyObject *) 731 SWIG_Python_NewPackedObj(void *ptr, int sz, swig_type_info *type) { 732 char result[1024]; 733 char *r = result; 734 if ((2*sz + 1 + strlen(type->name)) > 1000) return 0; 735 *(r++) = '_'; 736 r = SWIG_PackData(r,ptr,sz); 737 strcpy(r,type->name); 738 return PyString_FromString(result); 739 } 740 741 /* Install Constants */ 742 SWIGRUNTIME(void) 743 SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { 744 int i; 745 PyObject *obj; 746 for (i = 0; constants[i].type; i++) { 747 switch(constants[i].type) { 748 case SWIG_PY_INT: 749 obj = PyInt_FromLong(constants[i].lvalue); 750 break; 751 case SWIG_PY_FLOAT: 752 obj = PyFloat_FromDouble(constants[i].dvalue); 753 break; 754 case SWIG_PY_STRING: 755 if (constants[i].pvalue) { 756 obj = PyString_FromString((char *) constants[i].pvalue); 757 } else { 758 Py_INCREF(Py_None); 759 obj = Py_None; 760 } 761 break; 762 case SWIG_PY_POINTER: 763 obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); 764 break; 765 case SWIG_PY_BINARY: 766 obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); 767 break; 768 default: 769 obj = 0; 770 break; 771 } 772 if (obj) { 773 PyDict_SetItemString(d,constants[i].name,obj); 774 Py_DECREF(obj); 775 } 776 } 777 } 778 779 #endif 780 781 /* Contract support */ 782 783 #define SWIG_contract_assert(expr, msg) if (!(expr)) { PyErr_SetString(PyExc_RuntimeError, (char *) msg ); goto fail; } else 1320 SWIGRUNTIME PyObject * 1321 SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { 1322 PyObject *robj = 0; 1323 if (!ptr) { 1324 Py_INCREF(Py_None); 1325 return Py_None; 1326 } 1327 #if defined(SWIG_COBJECT_TYPES) && !defined(SWIG_COBJECT_PYTHON) 1328 robj = PySwigPacked_FromDataAndDesc((void *) ptr, sz, (char *)type->name); 1329 #else 1330 { 1331 char result[SWIG_BUFFER_SIZE]; 1332 robj = SWIG_PackDataName(result, ptr, sz, type->name, sizeof(result)) ? 1333 PyString_FromString(result) : 0; 1334 } 1335 #endif 1336 return robj; 1337 } 1338 1339 /* -----------------------------------------------------------------------------* 1340 * Get type list 1341 * -----------------------------------------------------------------------------*/ 1342 1343 #ifdef SWIG_LINK_RUNTIME 1344 void *SWIG_ReturnGlobalTypeList(void *); 1345 #endif 1346 1347 SWIGRUNTIME swig_module_info * 1348 SWIG_Python_GetModule(void) { 1349 static void *type_pointer = (void *)0; 1350 /* first check if module already created */ 1351 if (!type_pointer) { 1352 #ifdef SWIG_LINK_RUNTIME 1353 type_pointer = SWIG_ReturnGlobalTypeList((void *)0); 1354 #else 1355 type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, 1356 (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); 1357 if (PyErr_Occurred()) { 1358 PyErr_Clear(); 1359 type_pointer = (void *)0; 1360 } 1361 #endif 1362 } 1363 return (swig_module_info *) type_pointer; 1364 } 1365 1366 #if PY_MAJOR_VERSION < 2 1367 /* PyModule_AddObject function was introduced in Python 2.0. The following function 1368 is copied out of Python/modsupport.c in python version 2.3.4 */ 1369 SWIGINTERN int 1370 PyModule_AddObject(PyObject *m, char *name, PyObject *o) 1371 { 1372 PyObject *dict; 1373 if (!PyModule_Check(m)) { 1374 PyErr_SetString(PyExc_TypeError, 1375 "PyModule_AddObject() needs module as first arg"); 1376 return -1; 1377 } 1378 if (!o) { 1379 PyErr_SetString(PyExc_TypeError, 1380 "PyModule_AddObject() needs non-NULL value"); 1381 return -1; 1382 } 1383 1384 dict = PyModule_GetDict(m); 1385 if (dict == NULL) { 1386 /* Internal error -- modules must have a dict! */ 1387 PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__", 1388 PyModule_GetName(m)); 1389 return -1; 1390 } 1391 if (PyDict_SetItemString(dict, name, o)) 1392 return -1; 1393 Py_DECREF(o); 1394 return 0; 1395 } 1396 #endif 1397 1398 SWIGRUNTIME void 1399 SWIG_Python_SetModule(swig_module_info *swig_module) { 1400 static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */ 1401 1402 PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, 1403 swig_empty_runtime_method_table); 1404 PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, NULL); 1405 if (pointer && module) { 1406 PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); 1407 } 1408 } 784 1409 785 1410 #ifdef __cplusplus … … 790 1415 /* -------- TYPES TABLE (BEGIN) -------- */ 791 1416 792 #define SWIGTYPE_p_libtrace_t swig_types[0] 793 #define SWIGTYPE_p_libtrace_udp swig_types[1] 794 #define SWIGTYPE_p_libtrace_ip swig_types[2] 795 #define SWIGTYPE_p_libtrace_icmp_un_echo swig_types[3] 796 #define SWIGTYPE_p_libtrace_icmp_un swig_types[4] 797 #define SWIGTYPE_p_uint64_t swig_types[5] 798 #define SWIGTYPE_p_void swig_types[6] 799 #define SWIGTYPE_p_libtrace_packet_t swig_types[7] 800 #define SWIGTYPE_p_char swig_types[8] 801 #define SWIGTYPE_p_libtrace_icmp_un_frag swig_types[9] 802 #define SWIGTYPE_p_libtrace_filter_t swig_types[10] 803 #define SWIGTYPE_p_timeval swig_types[11] 804 #define SWIGTYPE_p_libtrace_icmp swig_types[12] 805 #define SWIGTYPE_p_int8_t swig_types[13] 806 #define SWIGTYPE_p_in_addr swig_types[14] 807 #define SWIGTYPE_p_libtrace_tcp swig_types[15] 808 #define SWIGTYPE_p_libtrace_linktype_t swig_types[16] 809 static swig_type_info *swig_types[18]; 1417 #define SWIGTYPE_p_char swig_types[0] 1418 #define SWIGTYPE_p_in_addr swig_types[1] 1419 #define SWIGTYPE_p_int8_t swig_types[2] 1420 #define SWIGTYPE_p_libtrace_err_t swig_types[3] 1421 #define SWIGTYPE_p_libtrace_filter_t swig_types[4] 1422 #define SWIGTYPE_p_libtrace_icmp swig_types[5] 1423 #define SWIGTYPE_p_libtrace_icmp_un swig_types[6] 1424 #define SWIGTYPE_p_libtrace_icmp_un_echo swig_types[7] 1425 #define SWIGTYPE_p_libtrace_icmp_un_frag swig_types[8] 1426 #define SWIGTYPE_p_libtrace_ip swig_types[9] 1427 #define SWIGTYPE_p_libtrace_linktype_t swig_types[10] 1428 #define SWIGTYPE_p_libtrace_out_t swig_types[11] 1429 #define SWIGTYPE_p_libtrace_packet_t swig_types[12] 1430 #define SWIGTYPE_p_libtrace_t swig_types[13] 1431 #define SWIGTYPE_p_libtrace_tcp swig_types[14] 1432 #define SWIGTYPE_p_libtrace_udp swig_types[15] 1433 #define SWIGTYPE_p_timeval swig_types[16] 1434 #define SWIGTYPE_p_trace_option_output_t swig_types[17] 1435 #define SWIGTYPE_p_trace_option_t swig_types[18] 1436 #define SWIGTYPE_p_uint64_t swig_types[19] 1437 #define SWIGTYPE_p_unsigned_char swig_types[20] 1438 #define SWIGTYPE_p_unsigned_int swig_types[21] 1439 #define SWIGTYPE_p_unsigned_short swig_types[22] 1440 #define SWIGTYPE_p_void swig_types[23] 1441 #define SWIGTYPE_ptrdiff_t swig_types[24] 1442 #define SWIGTYPE_size_t swig_types[25] 1443 static swig_type_info *swig_types[27]; 1444 static swig_module_info swig_module = {swig_types, 26, 0, 0, 0, 0}; 1445 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) 1446 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) 810 1447 811 1448 /* -------- TYPES TABLE (END) -------- */ … … 819 1456 #define SWIG_name "_libtrace" 820 1457 821 /* Auxiliar swig macros that appear in the header */822 823 #define SWIG_OLDOBJ 1824 #define SWIG_NEWOBJ SWIG_OLDOBJ + 1825 #define SWIG_PYSTR SWIG_NEWOBJ + 1826 827 #ifdef __cplusplus828 #define SWIGSTATICINLINE(a) static inline a829 #define SWIGSTATIC(a) static a830 #define swig_new_array(size,Type) (new Type[(size)])831 #define swig_delete(cptr) delete cptr832 #define swig_delete_array(cptr) delete[] cptr833 #define swig_const_cast(a,Type) const_cast<Type >(a)834 #define swig_static_cast(a,Type) static_cast<Type >(a)835 #define swig_reinterpret_cast(a,Type) reinterpret_cast<Type >(a)836 #define swig_new_copy(ptr,Type) (new Type(*ptr))837 #define swig_numeric_cast(a,Type) static_cast<Type >(a)838 839 #else /* C case */840 841 #define SWIGSTATICINLINE(a) static a842 #define SWIGSTATIC(a) static a843 #define swig_new_array(size,Type) ((Type*) malloc((size)*sizeof(Type)))844 #define swig_delete(cptr) free((char*)cptr)845 #define swig_delete_array(cptr) free((char*)cptr)846 #define swig_const_cast(a,Type) (Type)(a)847 #define swig_static_cast(a,Type) (Type)(a)848 #define swig_reinterpret_cast(a,Type) (Type)(a)849 #define swig_numeric_cast(a,Type) (Type)(a)850 #define swig_new_copy(ptr,Type) ((Type*)memcpy(malloc(sizeof(Type)),ptr,sizeof(Type)))851 852 #endif /* __cplusplus */853 854 855 /*@/usr/share/swig1.3/python/pymacros.swg,63,SWIG_define@*/856 #define SWIG_From_signed_SS_char PyInt_FromLong857 /*@@*/858 /*@/usr/share/swig1.3/python/pymacros.swg,63,SWIG_define@*/859 #define SWIG_From_unsigned_SS_char PyInt_FromLong860 /*@@*/861 /*@/usr/share/swig1.3/python/pymacros.swg,63,SWIG_define@*/862 #define SWIG_From_short PyInt_FromLong863 /*@@*/864 /*@/usr/share/swig1.3/python/pymacros.swg,63,SWIG_define@*/865 #define SWIG_From_unsigned_SS_short PyInt_FromLong866 /*@@*/867 /*@/usr/share/swig1.3/python/pymacros.swg,63,SWIG_define@*/868 #define SWIG_From_int PyInt_FromLong869 /*@@*/870 /*@/usr/share/swig1.3/python/pymacros.swg,63,SWIG_define@*/871 #define SWIG_From_long PyInt_FromLong872 /*@@*/873 /*@/usr/share/swig1.3/python/pymacros.swg,63,SWIG_define@*/874 #define SWIG_From_float PyFloat_FromDouble875 /*@@*/876 /*@/usr/share/swig1.3/python/pymacros.swg,63,SWIG_define@*/877 #define SWIG_From_double PyFloat_FromDouble878 /*@@*/879 880 881 1458 #include <arpa/inet.h> 882 1459 #include "libtrace.h" … … 889 1466 890 1467 891 SWIG STATICINLINE(int)1468 SWIGINTERN int 892 1469 SWIG_CheckLongInRange(long value, long min_value, long max_value, 893 1470 const char *errmsg) … … 912 1489 913 1490 914 SWIG STATICINLINE(int)1491 SWIGINTERN int 915 1492 SWIG_AsVal_long(PyObject * obj, long* val) 916 1493 { 917 if (PyInt_Check(obj)) {918 if (val) *val = PyInt_AS_LONG(obj);919 return 1;920 }921 1494 if (PyLong_Check(obj)) { 922 1495 long v = PyLong_AsLong(obj); … … 929 1502 } 930 1503 } 1504 if (PyInt_Check(obj)) { 1505 if (val) *val = PyInt_AsLong(obj); 1506 return 1; 1507 } 931 1508 if (val) { 932 PyErr_SetString(PyExc_TypeError, "a long is expected");1509 SWIG_type_error("long", obj); 933 1510 } 934 1511 return 0; … … 937 1514 938 1515 #if INT_MAX != LONG_MAX 939 SWIG STATICINLINE(int)1516 SWIGINTERN int 940 1517 SWIG_AsVal_int(PyObject *obj, int *val) 941 1518 { 942 const char* errmsg = val ? "int" : 0;1519 const char* errmsg = val ? "int" : (char*)0; 943 1520 long v; 944 1521 if (SWIG_AsVal_long(obj, &v)) { 945 1522 if (SWIG_CheckLongInRange(v, INT_MIN,INT_MAX, errmsg)) { 946 if (val) *val = swig_numeric_cast(v, int);1523 if (val) *val = (int)(v); 947 1524 return 1; 948 1525 } else { … … 953 1530 } 954 1531 if (val) { 955 PyErr_SetString(PyExc_TypeError, "an int is expected");1532 SWIG_type_error(errmsg, obj); 956 1533 } 957 1534 return 0; 958 1535 } 959 1536 #else 960 SWIG STATICINLINE(int)1537 SWIGINTERNINLINE int 961 1538 SWIG_AsVal_int(PyObject *obj, int *val) 962 1539 { … … 966 1543 967 1544 968 SWIG STATICINLINE(int)1545 SWIGINTERNINLINE int 969 1546 SWIG_As_int(PyObject* obj) 970 1547 { … … 972 1549 if (!SWIG_AsVal_int(obj, &v)) { 973 1550 /* 974 this is needed to make valgrind/purify happier. the other 975 solution is throw an exception, but since this code should work 976 with plain C .... 1551 this is needed to make valgrind/purify happier. 977 1552 */ 978 1553 memset((void*)&v, 0, sizeof(int)); … … 982 1557 983 1558 984 SWIG STATICINLINE(int)1559 SWIGINTERNINLINE int 985 1560 SWIG_Check_int(PyObject* obj) 986 1561 { … … 989 1564 990 1565 991 SWIGSTATICINLINE(int) 1566 /*@/usr/share/swig1.3/python/pymacros.swg,72,SWIG_define@*/ 1567 #define SWIG_From_int PyInt_FromLong 1568 /*@@*/ 1569 1570 1571 SWIGINTERNINLINE int 992 1572 SWIG_CheckUnsignedLongInRange(unsigned long value, 993 1573 unsigned long max_value, … … 997 1577 if (errmsg) { 998 1578 PyErr_Format(PyExc_OverflowError, 999 "value %l d is greater than '%s' minimum %ld",1579 "value %lu is greater than '%s' minimum %lu", 1000 1580 value, errmsg, max_value); 1001 1581 } … … 1006 1586 1007 1587 1008 SWIG STATICINLINE(int)1009 SWIG_AsVal_unsigned_SS_long(PyObject * 1588 SWIGINTERN int 1589 SWIG_AsVal_unsigned_SS_long(PyObject *obj, unsigned long *val) 1010 1590 { 1011 if (PyInt_Check(obj)) {1012 long v = PyInt_AS_LONG(obj);1013 if (v >= 0) {1014 if (val) *val = v;1015 return 1;1016 }1017 }1018 1591 if (PyLong_Check(obj)) { 1019 1592 unsigned long v = PyLong_AsUnsignedLong(obj); … … 1026 1599 } 1027 1600 } 1601 if (PyInt_Check(obj)) { 1602 long v = PyInt_AsLong(obj); 1603 if (v >= 0) { 1604 if (val) *val = v; 1605 return 1; 1606 } 1607 } 1028 1608 if (val) { 1029 PyErr_SetString(PyExc_TypeError, "an unsigned long is expected");1609 SWIG_type_error("unsigned long", obj); 1030 1610 } 1031 1611 return 0; … … 1034 1614 1035 1615 #if UINT_MAX != ULONG_MAX 1036 SWIG STATICINLINE(int)1616 SWIGINTERN int 1037 1617 SWIG_AsVal_unsigned_SS_int(PyObject *obj, unsigned int *val) 1038 1618 { 1039 const char* errmsg = val ? "unsigned int" : 0;1619 const char* errmsg = val ? "unsigned int" : (char*)0; 1040 1620 unsigned long v; 1041 1621 if (SWIG_AsVal_unsigned_SS_long(obj, &v)) { 1042 1622 if (SWIG_CheckUnsignedLongInRange(v, INT_MAX, errmsg)) { 1043 if (val) *val = swig_numeric_cast(v, unsigned int);1623 if (val) *val = (unsigned int)(v); 1044 1624 return 1; 1045 1625 } … … 1048 1628 } 1049 1629 if (val) { 1050 PyErr_SetString(PyExc_TypeError, "an unsigned int is expected");1630 SWIG_type_error(errmsg, obj); 1051 1631 } 1052 1632 return 0; 1053 1633 } 1054 1634 #else 1055 SWIG STATICINLINE(unsigned int)1635 SWIGINTERNINLINE unsigned int 1056 1636 SWIG_AsVal_unsigned_SS_int(PyObject *obj, unsigned int *val) 1057 1637 { … … 1061 1641 1062 1642 1063 SWIG STATICINLINE(unsigned int)1643 SWIGINTERNINLINE unsigned int 1064 1644 SWIG_As_unsigned_SS_int(PyObject* obj) 1065 1645 { … … 1067 1647 if (!SWIG_AsVal_unsigned_SS_int(obj, &v)) { 1068 1648 /* 1069 this is needed to make valgrind/purify happier. the other 1070 solution is throw an exception, but since this code should work 1071 with plain C .... 1649 this is needed to make valgrind/purify happier. 1072 1650 */ 1073 1651 memset((void*)&v, 0, sizeof(unsigned int)); … … 1077 1655 1078 1656 1079 SWIG STATICINLINE(int)1657 SWIGINTERNINLINE int 1080 1658 SWIG_Check_unsigned_SS_int(PyObject* obj) 1081 1659 { … … 1084 1662 1085 1663 1086 SWIGSTATICINLINE(PyObject* ) 1664 /*@/usr/share/swig1.3/python/pymacros.swg,72,SWIG_define@*/ 1665 #define SWIG_From_long PyInt_FromLong 1666 /*@@*/ 1667 1668 1669 SWIGINTERNINLINE PyObject* 1087 1670 SWIG_From_unsigned_SS_long(unsigned long value) 1088 1671 { 1089 1672 return (value > LONG_MAX) ? 1090 1673 PyLong_FromUnsignedLong(value) 1091 : PyInt_FromLong( swig_numeric_cast(value,long));1674 : PyInt_FromLong((long)(value)); 1092 1675 } 1093 1676 1094 1677 1095 1678 #if UINT_MAX < LONG_MAX 1096 /*@/usr/share/swig1.3/python/pymacros.swg, 63,SWIG_define@*/1679 /*@/usr/share/swig1.3/python/pymacros.swg,72,SWIG_define@*/ 1097 1680 #define SWIG_From_unsigned_SS_int SWIG_From_long 1098 1681 /*@@*/ 1099 1682 #else 1100 /*@/usr/share/swig1.3/python/pymacros.swg, 63,SWIG_define@*/1683 /*@/usr/share/swig1.3/python/pymacros.swg,72,SWIG_define@*/ 1101 1684 #define SWIG_From_unsigned_SS_int SWIG_From_unsigned_SS_long 1102 1685 /*@@*/ … … 1104 1687 1105 1688 1106 SWIG STATICINLINE(int)1689 SWIGINTERN int 1107 1690 SWIG_AsVal_unsigned_SS_char(PyObject *obj, unsigned char *val) 1108 1691 { 1109 const char* errmsg = val ? "unsigned char" : 0;1692 const char* errmsg = val ? "unsigned char" : (char*)0; 1110 1693 unsigned long v; 1111 1694 if (SWIG_AsVal_unsigned_SS_long(obj, &v)) { 1112 1695 if (SWIG_CheckUnsignedLongInRange(v, UCHAR_MAX,errmsg)) { 1113 if (val) *val = swig_numeric_cast(v, unsigned char);1696 if (val) *val = (unsigned char)(v); 1114 1697 return 1; 1115 1698 } else { … … 1120 1703 } 1121 1704 if (val) { 1122 PyErr_SetString(PyExc_TypeError, "an unsigned char is expected");1705 SWIG_type_error(errmsg, obj); 1123 1706 } 1124 1707 return 0; … … 1126 1709 1127 1710 1128 SWIG STATICINLINE(unsigned char)1711 SWIGINTERNINLINE unsigned char 1129 1712 SWIG_As_unsigned_SS_char(PyObject* obj) 1130 1713 { … … 1132 1715 if (!SWIG_AsVal_unsigned_SS_char(obj, &v)) { 1133 1716 /* 1134 this is needed to make valgrind/purify happier. the other 1135 solution is throw an exception, but since this code should work 1136 with plain C .... 1717 this is needed to make valgrind/purify happier. 1137 1718 */ 1138 1719 memset((void*)&v, 0, sizeof(unsigned char)); … … 1142 1723 1143 1724 1144 SWIG STATICINLINE(int)1725 SWIGINTERNINLINE int 1145 1726 SWIG_Check_unsigned_SS_char(PyObject* obj) 1146 1727 { … … 1149 1730 1150 1731 1151 SWIGSTATICINLINE(PyObject *) 1732 /*@/usr/share/swig1.3/python/pymacros.swg,72,SWIG_define@*/ 1733 #define SWIG_From_unsigned_SS_char PyInt_FromLong 1734 /*@@*/ 1735 1736 1737 /*@/usr/share/swig1.3/python/pymacros.swg,72,SWIG_define@*/ 1738 #define SWIG_From_unsigned_SS_short PyInt_FromLong 1739 /*@@*/ 1740 1741 1742 SWIGINTERN PyObject * 1152 1743 SWIG_FromCharPtr(const char* cptr) 1153 1744 { … … 1155 1746 size_t size = strlen(cptr); 1156 1747 if (size > INT_MAX) { 1157 return SWIG_NewPointerObj( swig_const_cast(cptr,char*),1748 return SWIG_NewPointerObj((char*)(cptr), 1158 1749 SWIG_TypeQuery("char *"), 0); 1159 1750 } else { … … 1192 1783 1193 1784 1194 SWIG STATICINLINE(int)1785 SWIGINTERN int 1195 1786 SWIG_AsVal_unsigned_SS_short(PyObject *obj, unsigned short *val) 1196 1787 { 1197 const char* errmsg = val ? "unsigned short" : 0;1788 const char* errmsg = val ? "unsigned short" : (char*)0; 1198 1789 unsigned long v; 1199 1790 if (SWIG_AsVal_unsigned_SS_long(obj, &v)) { 1200 1791 if (SWIG_CheckUnsignedLongInRange(v, USHRT_MAX, errmsg)) { 1201 if (val) *val = swig_numeric_cast(v, unsigned short);1792 if (val) *val = (unsigned short)(v); 1202 1793 return 1; 1203 1794 } else { … … 1208 1799 } 1209 1800 if (val) { 1210 PyErr_SetString(PyExc_TypeError, "an unsigned short is expected");1801 SWIG_type_error(errmsg, obj); 1211 1802 } 1212 1803 return 0; … … 1214 1805 1215 1806 1216 SWIG STATICINLINE(unsigned short)1807 SWIGINTERNINLINE unsigned short 1217 1808 SWIG_As_unsigned_SS_short(PyObject* obj) 1218 1809 { … … 1220 1811 if (!SWIG_AsVal_unsigned_SS_short(obj, &v)) { 1221 1812 /* 1222 this is needed to make valgrind/purify happier. the other 1223 solution is throw an exception, but since this code should work 1224 with plain C .... 1813 this is needed to make valgrind/purify happier. 1225 1814 */ 1226 1815 memset((void*)&v, 0, sizeof(unsigned short)); … … 1230 1819 1231 1820 1232 SWIG STATICINLINE(int)1821 SWIGINTERNINLINE int 1233 1822 SWIG_Check_unsigned_SS_short(PyObject* obj) 1234 1823 { … … 1280 1869 1281 1870 1282 st ruct libtrace_packet_t *new_libtrace_packet_t(){1283 struct libtrace_packet_t *packet = malloc(sizeof(struct libtrace_packet_t));1871 static struct libtrace_packet_t *new_libtrace_packet_t(){ 1872 struct libtrace_packet_t *packet = trace_create_packet(); 1284 1873 return packet; 1285 1874 } 1286 void delete_libtrace_packet_t(struct libtrace_packet_t *self){ free(self);} 1287 struct libtrace_ip *libtrace_packet_t_trace_get_ip(struct libtrace_packet_t *self){ 1875 static void delete_libtrace_packet_t(struct libtrace_packet_t *self){ 1876 trace_destroy_packet(self); 1877 } 1878 static libtrace_packet_t *libtrace_packet_t_trace_copy_packet(struct libtrace_packet_t *self){ 1879 return trace_copy_packet(self); 1880 } 1881 static void *libtrace_packet_t_trace_get_link(struct libtrace_packet_t *self){ 1882 return trace_get_link(self); 1883 } 1884 static void *libtrace_packet_t_trace_get_transport(struct libtrace_packet_t *self,uint8_t *proto,uint32_t *remaining){ 1885 return trace_get_transport(self, proto, remaining); 1886 } 1887 static struct libtrace_ip *libtrace_packet_t_trace_get_ip(struct libtrace_packet_t *self){ 1288 1888 return trace_get_ip(self); 1289 1889 } 1290 st ruct libtrace_tcp *libtrace_packet_t_trace_get_tcp(struct libtrace_packet_t *self){1890 static struct libtrace_tcp *libtrace_packet_t_trace_get_tcp(struct libtrace_packet_t *self){ 1291 1891 return trace_get_tcp(self); 1292 1892 } 1293 st ruct libtrace_udp *libtrace_packet_t_trace_get_udp(struct libtrace_packet_t *self){1893 static struct libtrace_udp *libtrace_packet_t_trace_get_udp(struct libtrace_packet_t *self){ 1294 1894 return trace_get_udp(self); 1295 1895 } 1296 st ruct libtrace_icmp *libtrace_packet_t_trace_get_icmp(struct libtrace_packet_t *self){1896 static struct libtrace_icmp *libtrace_packet_t_trace_get_icmp(struct libtrace_packet_t *self){ 1297 1897 return trace_get_icmp(self); 1298 1898 } 1299 void *libtrace_packet_t_trace_get_link(struct libtrace_packet_t *self){1300 return trace_ get_link(self);1899 static char *libtrace_packet_t_trace_get_destination_mac(struct libtrace_packet_t *self){ 1900 return trace_ether_ntoa(trace_get_destination_mac(self),0); 1301 1901 } 1302 double libtrace_packet_t_trace_get_seconds(struct libtrace_packet_t *self){ 1902 static char *libtrace_packet_t_trace_get_source_mac(struct libtrace_packet_t *self){ 1903 return trace_ether_ntoa(trace_get_source_mac(self),0); 1904 } 1905 static char *libtrace_packet_t_trace_ether_ntoa(struct libtrace_packet_t *self,uint8_t *mac){ 1906 return trace_ether_ntoa(mac, 0); 1907 } 1908 static uint16_t libtrace_packet_t_trace_get_source_port(struct libtrace_packet_t *self){ 1909 return trace_get_source_port(self); 1910 } 1911 static uint16_t libtrace_packet_t_trace_get_destination_port(struct libtrace_packet_t *self){ 1912 return trace_get_destination_port(self); 1913 } 1914 static double libtrace_packet_t_trace_get_seconds(struct libtrace_packet_t *self){ 1303 1915 return trace_get_seconds(self); 1304 1916 } 1305 uint64_t libtrace_packet_t_trace_get_erf_timestamp(struct libtrace_packet_t *self){ 1917 1918 /*@/usr/share/swig1.3/python/pymacros.swg,72,SWIG_define@*/ 1919 #define SWIG_From_double PyFloat_FromDouble 1920 /*@@*/ 1921 1922 static uint64_t libtrace_packet_t_trace_get_erf_timestamp(struct libtrace_packet_t *self){ 1306 1923 return trace_get_erf_timestamp(self); 1307 1924 } 1308 st ruct timeval libtrace_packet_t_trace_get_timeval(struct libtrace_packet_t *self){1925 static struct timeval libtrace_packet_t_trace_get_timeval(struct libtrace_packet_t *self){ 1309 1926 return trace_get_timeval(self); 1310 1927 } 1311 int libtrace_packet_t_trace_get_capture_length(struct libtrace_packet_t *self){1928 static int libtrace_packet_t_trace_get_capture_length(struct libtrace_packet_t *self){ 1312 1929 return trace_get_capture_length(self); 1313 1930 } 1314 int libtrace_packet_t_trace_get_wire_lenth(struct libtrace_packet_t *self){ 1931 1932 SWIGINTERNINLINE unsigned long 1933 SWIG_As_unsigned_SS_long(PyObject* obj) 1934 { 1935 unsigned long v; 1936 if (!SWIG_AsVal_unsigned_SS_long(obj, &v)) { 1937 /* 1938 this is needed to make valgrind/purify happier. 1939 */ 1940 memset((void*)&v, 0, sizeof(unsigned long)); 1941 } 1942 return v; 1943 } 1944 1945 1946 SWIGINTERNINLINE int 1947 SWIG_Check_unsigned_SS_long(PyObject* obj) 1948 { 1949 return SWIG_AsVal_unsigned_SS_long(obj, (unsigned long*)0); 1950 } 1951 1952 static size_t libtrace_packet_t_trace_set_capture_length(struct libtrace_packet_t *self,size_t size){ 1953 return trace_set_capture_length(self,size); 1954 } 1955 static int libtrace_packet_t_trace_get_wire_lenth(struct libtrace_packet_t *self){ 1315 1956 return trace_get_wire_length(self); 1316 1957 } 1317 libtrace_linktype_t libtrace_packet_t_trace_get_link_type(struct libtrace_packet_t *self){ 1958 static int libtrace_packet_t_trace_get_framing_length(struct libtrace_packet_t *self){ 1959 return trace_get_framing_length(self); 1960 } 1961 static libtrace_linktype_t libtrace_packet_t_trace_get_link_type(struct libtrace_packet_t *self){ 1318 1962 return trace_get_link_type(self); 1319 1963 } 1320 int8_t libtrace_packet_t_trace_get_direction(struct libtrace_packet_t *self){1964 static int8_t libtrace_packet_t_trace_get_direction(struct libtrace_packet_t *self){ 1321 1965 return trace_get_direction(self); 1322 1966 } 1323 int8_t libtrace_packet_t_trace_set_direction(struct libtrace_packet_t *self,int8_t direction){1967 static int8_t libtrace_packet_t_trace_set_direction(struct libtrace_packet_t *self,int8_t direction){ 1324 1968 return trace_set_direction(self,direction); 1325 1969 } 1326 int libtrace_packet_t_trace_bpf_filter(struct libtrace_packet_t *self,struct libtrace_filter_t *filter){1327 return trace_ bpf_filter(filter,self);1970 static int libtrace_packet_t_trace_apply_filter(struct libtrace_packet_t *self,struct libtrace_filter_t *filter){ 1971 return trace_apply_filter(filter,self); 1328 1972 } 1329 uint8_t libtrace_packet_t_trace_get_server_port(struct libtrace_packet_t *self,uint8_t protocol,uint16_t source,uint16_t dest){1973 static uint8_t libtrace_packet_t_trace_get_server_port(struct libtrace_packet_t *self,uint8_t protocol,uint16_t source,uint16_t dest){ 1330 1974 return trace_get_server_port(protocol,source,dest); 1331 1975 } 1332 1976 1333 1977 /* returns SWIG_OLDOBJ if the input is a raw char*, SWIG_PYSTR if is a PyString */ 1334 SWIG STATIC(int)1978 SWIGINTERN int 1335 1979 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize) 1336 1980 { … … 1343 1987 return SWIG_OLDOBJ; 1344 1988 } else { 1989 PyErr_Clear(); 1345 1990 if (PyString_Check(obj)) { 1346 1991 if (cptr) { … … 1354 1999 } 1355 2000 if (cptr) { 1356 PyErr_SetString(PyExc_TypeError, "a string is expected");2001 SWIG_type_error("char *", obj); 1357 2002 } 1358 2003 return 0; … … 1360 2005 1361 2006 1362 SWIG STATICINLINE(int)2007 SWIGINTERNINLINE int 1363 2008 SWIG_AsCharPtr(PyObject *obj, char **val) 1364 2009 { 1365 char* cptr = 0; 1366 if (SWIG_AsCharPtrAndSize(obj, &cptr, (size_t*)(0))) { 1367 if (val) *val = cptr; 2010 if (SWIG_AsCharPtrAndSize(obj, val, (size_t*)(0))) { 1368 2011 return 1; 1369 2012 } 1370 2013 if (val) { 1371 PyErr_SetString(PyExc_TypeError, "a char* is expected"); 2014 PyErr_Clear(); 2015 SWIG_type_error("char *", obj); 1372 2016 } 1373 2017 return 0; 1374 2018 } 1375 2019 1376 st ruct libtrace_filter_t *new_libtrace_filter_t(char *filterstring){1377 return trace_ bpf_setfilter(filterstring);2020 static struct libtrace_filter_t *new_libtrace_filter_t(char *filterstring){ 2021 return trace_create_filter(filterstring); 1378 2022 } 1379 int libtrace_filter_t_trace_bpf_filter(struct libtrace_filter_t *self,struct libtrace_packet_t *packet){1380 return trace_bpf_filter(self,packet);2023 static void delete_libtrace_filter_t(struct libtrace_filter_t *self){ 2024 trace_destroy_filter(self); 1381 2025 } 1382 struct libtrace_t *new_libtrace_t(char *uri){ return trace_create(uri); } 1383 void delete_libtrace_t(struct libtrace_t *self){ trace_destroy(self); } 1384 int libtrace_t_trace_read_packet(struct libtrace_t *self,struct libtrace_packet_t *packet){ 2026 static int libtrace_filter_t_trace_apply_filter(struct libtrace_filter_t *self,struct libtrace_packet_t *packet){ 2027 return trace_apply_filter(self,packet); 2028 } 2029 static struct libtrace_t *new_libtrace_t(char *uri){ return trace_create(uri); } 2030 static void delete_libtrace_t(struct libtrace_t *self){ trace_destroy(self); } 2031 static int libtrace_t_trace_read_packet(struct libtrace_t *self,struct libtrace_packet_t *packet){ 1385 2032 return trace_read_packet(self,packet); 2033 } 2034 static int libtrace_t_trace_start(struct libtrace_t *self){ 2035 return trace_start(self); 2036 } 2037 static int libtrace_t_trace_pause(struct libtrace_t *self){ 2038 return trace_pause(self); 2039 } 2040 static void libtrace_t_trace_help(struct libtrace_t *self){ 2041 trace_help(); 2042 } 2043 static int libtrace_t_trace_config(struct libtrace_t *self,trace_option_t option,void *value){ 2044 return trace_config(self, option, value); 2045 } 2046 static libtrace_err_t libtrace_t_trace_get_err(struct libtrace_t *self){ 2047 return trace_get_err(self); 2048 } 2049 static bool libtrace_t_trace_is_err(struct libtrace_t *self){ 2050 return trace_is_err(self); 2051 } 2052 2053 SWIGINTERNINLINE PyObject* 2054 SWIG_From_bool(bool value) 2055 { 2056 PyObject *obj = value ? Py_True : Py_False; 2057 Py_INCREF(obj); 2058 return obj; 2059 } 2060 2061 static struct libtrace_out_t *new_libtrace_out_t(char *uri){ return trace_create_output(uri); } 2062 static void delete_libtrace_out_t(struct libtrace_out_t *self){ trace_destroy_output(self); } 2063 static int libtrace_out_t_trace_start_output(struct libtrace_out_t *self){ 2064 return trace_start_output(self); 2065 } 2066 static int libtrace_out_t_trace_config_output(struct libtrace_out_t *self,trace_option_output_t option,void *value){ 2067 return trace_config_output(self, option, value); 2068 } 2069 static libtrace_err_t libtrace_out_t_trace_get_err_output(struct libtrace_out_t *self){ 2070 return trace_get_err_output(self); 2071 } 2072 static bool libtrace_out_t_trace_is_err_output(struct libtrace_out_t *self){ 2073 return trace_is_err_output(self); 2074 } 2075 static int libtrace_out_t_trace_write_packet(struct libtrace_out_t *self,libtrace_packet_t *packet){ 2076 return trace_write_packet(self, packet); 1386 2077 } 1387 2078 #ifdef __cplusplus … … 1389 2080 #endif 1390 2081 static PyObject *_wrap_in_addr_s_addr_set(PyObject *self, PyObject *args) { 1391 PyObject *resultobj ;2082 PyObject *resultobj = NULL; 1392 2083 struct in_addr *arg1 = (struct in_addr *) 0 ; 1393 2084 int arg2 ; … … 1396 2087 1397 2088 if(!PyArg_ParseTuple(args,(char *)"OO:in_addr_s_addr_set",&obj0,&obj1)) goto fail; 1398 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_in_addr, 1399 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 1400 arg2 = (int)SWIG_As_int(obj1); 1401 if (PyErr_Occurred()) SWIG_fail; 2089 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_in_addr, SWIG_POINTER_EXCEPTION | 0); 2090 if (SWIG_arg_fail(1)) SWIG_fail; 2091 { 2092 arg2 = (int)(SWIG_As_int(obj1)); 2093 if (SWIG_arg_fail(2)) SWIG_fail; 2094 } 1402 2095 if (arg1) (arg1)->s_addr = arg2; 1403 2096 … … 1410 2103 1411 2104 static PyObject *_wrap_in_addr_s_addr_get(PyObject *self, PyObject *args) { 1412 PyObject *resultobj ;2105 PyObject *resultobj = NULL; 1413 2106 struct in_addr *arg1 = (struct in_addr *) 0 ; 1414 2107 int result; … … 1416 2109 1417 2110 if(!PyArg_ParseTuple(args,(char *)"O:in_addr_s_addr_get",&obj0)) goto fail; 1418 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_in_addr,1419 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2111 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_in_addr, SWIG_POINTER_EXCEPTION | 0); 2112 if (SWIG_arg_fail(1)) SWIG_fail; 1420 2113 result = (int) ((arg1)->s_addr); 1421 2114 1422 resultobj = SWIG_From_int((int)result); 2115 { 2116 resultobj = SWIG_From_int((int)(result)); 2117 } 1423 2118 return resultobj; 1424 2119 fail: … … 1435 2130 } 1436 2131 static PyObject *_wrap_libtrace_ip_ip_hl_set(PyObject *self, PyObject *args) { 1437 PyObject *resultobj ;2132 PyObject *resultobj = NULL; 1438 2133 struct libtrace_ip *arg1 = (struct libtrace_ip *) 0 ; 1439 2134 unsigned int arg2 ; … … 1442 2137 1443 2138 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_ip_ip_hl_set",&obj0,&obj1)) goto fail; 1444 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_ip, 1445 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 1446 arg2 = (unsigned int)SWIG_As_unsigned_SS_int(obj1); 1447 if (PyErr_Occurred()) SWIG_fail; 2139 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_ip, SWIG_POINTER_EXCEPTION | 0); 2140 if (SWIG_arg_fail(1)) SWIG_fail; 2141 { 2142 arg2 = (unsigned int)(SWIG_As_unsigned_SS_int(obj1)); 2143 if (SWIG_arg_fail(2)) SWIG_fail; 2144 } 1448 2145 if (arg1) (arg1)->ip_hl = arg2; 1449 2146 … … 1456 2153 1457 2154 static PyObject *_wrap_libtrace_ip_ip_hl_get(PyObject *self, PyObject *args) { 1458 PyObject *resultobj ;2155 PyObject *resultobj = NULL; 1459 2156 struct libtrace_ip *arg1 = (struct libtrace_ip *) 0 ; 1460 2157 unsigned int result; … … 1462 2159 1463 2160 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_ip_ip_hl_get",&obj0)) goto fail; 1464 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_ip,1465 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2161 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_ip, SWIG_POINTER_EXCEPTION | 0); 2162 if (SWIG_arg_fail(1)) SWIG_fail; 1466 2163 result = (unsigned int) ((arg1)->ip_hl); 1467 2164 1468 resultobj = SWIG_From_unsigned_SS_int((unsigned int)result); 2165 { 2166 resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); 2167 } 1469 2168 return resultobj; 1470 2169 fail: … … 1474 2173 1475 2174 static PyObject *_wrap_libtrace_ip_ip_v_set(PyObject *self, PyObject *args) { 1476 PyObject *resultobj ;2175 PyObject *resultobj = NULL; 1477 2176 struct libtrace_ip *arg1 = (struct libtrace_ip *) 0 ; 1478 2177 unsigned int arg2 ; … … 1481 2180 1482 2181 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_ip_ip_v_set",&obj0,&obj1)) goto fail; 1483 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_ip, 1484 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 1485 arg2 = (unsigned int)SWIG_As_unsigned_SS_int(obj1); 1486 if (PyErr_Occurred()) SWIG_fail; 2182 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_ip, SWIG_POINTER_EXCEPTION | 0); 2183 if (SWIG_arg_fail(1)) SWIG_fail; 2184 { 2185 arg2 = (unsigned int)(SWIG_As_unsigned_SS_int(obj1)); 2186 if (SWIG_arg_fail(2)) SWIG_fail; 2187 } 1487 2188 if (arg1) (arg1)->ip_v = arg2; 1488 2189 … … 1495 2196 1496 2197 static PyObject *_wrap_libtrace_ip_ip_v_get(PyObject *self, PyObject *args) { 1497 PyObject *resultobj ;2198 PyObject *resultobj = NULL; 1498 2199 struct libtrace_ip *arg1 = (struct libtrace_ip *) 0 ; 1499 2200 unsigned int result; … … 1501 2202 1502 2203 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_ip_ip_v_get",&obj0)) goto fail; 1503 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_ip,1504 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2204 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_ip, SWIG_POINTER_EXCEPTION | 0); 2205 if (SWIG_arg_fail(1)) SWIG_fail; 1505 2206 result = (unsigned int) ((arg1)->ip_v); 1506 2207 1507 resultobj = SWIG_From_unsigned_SS_int((unsigned int)result); 2208 { 2209 resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); 2210 } 1508 2211 return resultobj; 1509 2212 fail: … … 1513 2216 1514 2217 static PyObject *_wrap_libtrace_ip_ip_tos_set(PyObject *self, PyObject *args) { 1515 PyObject *resultobj ;2218 PyObject *resultobj = NULL; 1516 2219 struct libtrace_ip *arg1 = (struct libtrace_ip *) 0 ; 1517 2220 uint8_t arg2 ; … … 1520 2223 1521 2224 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_ip_ip_tos_set",&obj0,&obj1)) goto fail; 1522 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_ip, 1523 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 1524 arg2 = (uint8_t)SWIG_As_unsigned_SS_char(obj1); 1525 if (PyErr_Occurred()) SWIG_fail; 2225 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_ip, SWIG_POINTER_EXCEPTION | 0); 2226 if (SWIG_arg_fail(1)) SWIG_fail; 2227 { 2228 arg2 = (uint8_t)(SWIG_As_unsigned_SS_char(obj1)); 2229 if (SWIG_arg_fail(2)) SWIG_fail; 2230 } 1526 2231 if (arg1) (arg1)->ip_tos = arg2; 1527 2232 … … 1534 2239 1535 2240 static PyObject *_wrap_libtrace_ip_ip_tos_get(PyObject *self, PyObject *args) { 1536 PyObject *resultobj ;2241 PyObject *resultobj = NULL; 1537 2242 struct libtrace_ip *arg1 = (struct libtrace_ip *) 0 ; 1538 2243 uint8_t result; … … 1540 2245 1541 2246 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_ip_ip_tos_get",&obj0)) goto fail; 1542 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_ip,1543 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2247 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_ip, SWIG_POINTER_EXCEPTION | 0); 2248 if (SWIG_arg_fail(1)) SWIG_fail; 1544 2249 result = (uint8_t) ((arg1)->ip_tos); 1545 2250 1546 resultobj = SWIG_From_unsigned_SS_char((unsigned char)result); 2251 { 2252 resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); 2253 } 1547 2254 return resultobj; 1548 2255 fail: … … 1552 2259 1553 2260 static PyObject *_wrap_libtrace_ip_ip_ttl_set(PyObject *self, PyObject *args) { 1554 PyObject *resultobj ;2261 PyObject *resultobj = NULL; 1555 2262 struct libtrace_ip *arg1 = (struct libtrace_ip *) 0 ; 1556 2263 uint8_t arg2 ; … … 1559 2266 1560 2267 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_ip_ip_ttl_set",&obj0,&obj1)) goto fail; 1561 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_ip, 1562 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 1563 arg2 = (uint8_t)SWIG_As_unsigned_SS_char(obj1); 1564 if (PyErr_Occurred()) SWIG_fail; 2268 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_ip, SWIG_POINTER_EXCEPTION | 0); 2269 if (SWIG_arg_fail(1)) SWIG_fail; 2270 { 2271 arg2 = (uint8_t)(SWIG_As_unsigned_SS_char(obj1)); 2272 if (SWIG_arg_fail(2)) SWIG_fail; 2273 } 1565 2274 if (arg1) (arg1)->ip_ttl = arg2; 1566 2275 … … 1573 2282 1574 2283 static PyObject *_wrap_libtrace_ip_ip_ttl_get(PyObject *self, PyObject *args) { 1575 PyObject *resultobj ;2284 PyObject *resultobj = NULL; 1576 2285 struct libtrace_ip *arg1 = (struct libtrace_ip *) 0 ; 1577 2286 uint8_t result; … … 1579 2288 1580 2289 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_ip_ip_ttl_get",&obj0)) goto fail; 1581 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_ip,1582 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2290 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_ip, SWIG_POINTER_EXCEPTION | 0); 2291 if (SWIG_arg_fail(1)) SWIG_fail; 1583 2292 result = (uint8_t) ((arg1)->ip_ttl); 1584 2293 1585 resultobj = SWIG_From_unsigned_SS_char((unsigned char)result); 2294 { 2295 resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); 2296 } 1586 2297 return resultobj; 1587 2298 fail: … … 1591 2302 1592 2303 static PyObject *_wrap_libtrace_ip_ip_p_set(PyObject *self, PyObject *args) { 1593 PyObject *resultobj ;2304 PyObject *resultobj = NULL; 1594 2305 struct libtrace_ip *arg1 = (struct libtrace_ip *) 0 ; 1595 2306 uint8_t arg2 ; … … 1598 2309 1599 2310 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_ip_ip_p_set",&obj0,&obj1)) goto fail; 1600 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_ip, 1601 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 1602 arg2 = (uint8_t)SWIG_As_unsigned_SS_char(obj1); 1603 if (PyErr_Occurred()) SWIG_fail; 2311 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_ip, SWIG_POINTER_EXCEPTION | 0); 2312 if (SWIG_arg_fail(1)) SWIG_fail; 2313 { 2314 arg2 = (uint8_t)(SWIG_As_unsigned_SS_char(obj1)); 2315 if (SWIG_arg_fail(2)) SWIG_fail; 2316 } 1604 2317 if (arg1) (arg1)->ip_p = arg2; 1605 2318 … … 1612 2325 1613 2326 static PyObject *_wrap_libtrace_ip_ip_p_get(PyObject *self, PyObject *args) { 1614 PyObject *resultobj ;2327 PyObject *resultobj = NULL; 1615 2328 struct libtrace_ip *arg1 = (struct libtrace_ip *) 0 ; 1616 2329 uint8_t result; … … 1618 2331 1619 2332 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_ip_ip_p_get",&obj0)) goto fail; 1620 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_ip,1621 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2333 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_ip, SWIG_POINTER_EXCEPTION | 0); 2334 if (SWIG_arg_fail(1)) SWIG_fail; 1622 2335 result = (uint8_t) ((arg1)->ip_p); 1623 2336 1624 resultobj = SWIG_From_unsigned_SS_char((unsigned char)result); 2337 { 2338 resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); 2339 } 1625 2340 return resultobj; 1626 2341 fail: … … 1630 2345 1631 2346 static PyObject *_wrap_libtrace_ip_ip_sum_get(PyObject *self, PyObject *args) { 1632 PyObject *resultobj ;2347 PyObject *resultobj = NULL; 1633 2348 struct libtrace_ip *arg1 = (struct libtrace_ip *) 0 ; 1634 2349 uint16_t result; … … 1636 2351 1637 2352 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_ip_ip_sum_get",&obj0)) goto fail; 1638 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_ip,1639 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2353 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_ip, SWIG_POINTER_EXCEPTION | 0); 2354 if (SWIG_arg_fail(1)) SWIG_fail; 1640 2355 result = (uint16_t)libtrace_ip_ip_sum_get(arg1); 1641 2356 1642 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 2357 { 2358 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 2359 } 1643 2360 return resultobj; 1644 2361 fail: … … 1648 2365 1649 2366 static PyObject *_wrap_libtrace_ip_ip_len_get(PyObject *self, PyObject *args) { 1650 PyObject *resultobj ;2367 PyObject *resultobj = NULL; 1651 2368 struct libtrace_ip *arg1 = (struct libtrace_ip *) 0 ; 1652 2369 uint16_t result; … … 1654 2371 1655 2372 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_ip_ip_len_get",&obj0)) goto fail; 1656 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_ip,1657 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2373 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_ip, SWIG_POINTER_EXCEPTION | 0); 2374 if (SWIG_arg_fail(1)) SWIG_fail; 1658 2375 result = (uint16_t)libtrace_ip_ip_len_get(arg1); 1659 2376 1660 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 2377 { 2378 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 2379 } 1661 2380 return resultobj; 1662 2381 fail: … … 1666 2385 1667 2386 static PyObject *_wrap_libtrace_ip_ip_id_get(PyObject *self, PyObject *args) { 1668 PyObject *resultobj ;2387 PyObject *resultobj = NULL; 1669 2388 struct libtrace_ip *arg1 = (struct libtrace_ip *) 0 ; 1670 2389 uint16_t result; … … 1672 2391 1673 2392 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_ip_ip_id_get",&obj0)) goto fail; 1674 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_ip,1675 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2393 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_ip, SWIG_POINTER_EXCEPTION | 0); 2394 if (SWIG_arg_fail(1)) SWIG_fail; 1676 2395 result = (uint16_t)libtrace_ip_ip_id_get(arg1); 1677 2396 1678 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 2397 { 2398 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 2399 } 1679 2400 return resultobj; 1680 2401 fail: … … 1684 2405 1685 2406 static PyObject *_wrap_libtrace_ip_ip_off_get(PyObject *self, PyObject *args) { 1686 PyObject *resultobj ;2407 PyObject *resultobj = NULL; 1687 2408 struct libtrace_ip *arg1 = (struct libtrace_ip *) 0 ; 1688 2409 uint16_t result; … … 1690 2411 1691 2412 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_ip_ip_off_get",&obj0)) goto fail; 1692 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_ip,1693 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2413 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_ip, SWIG_POINTER_EXCEPTION | 0); 2414 if (SWIG_arg_fail(1)) SWIG_fail; 1694 2415 result = (uint16_t)libtrace_ip_ip_off_get(arg1); 1695 2416 1696 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 2417 { 2418 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 2419 } 1697 2420 return resultobj; 1698 2421 fail: … … 1702 2425 1703 2426 static PyObject *_wrap_libtrace_ip_ip_src_get(PyObject *self, PyObject *args) { 1704 PyObject *resultobj ;2427 PyObject *resultobj = NULL; 1705 2428 struct libtrace_ip *arg1 = (struct libtrace_ip *) 0 ; 1706 2429 char *result; … … 1708 2431 1709 2432 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_ip_ip_src_get",&obj0)) goto fail; 1710 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_ip,1711 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2433 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_ip, SWIG_POINTER_EXCEPTION | 0); 2434 if (SWIG_arg_fail(1)) SWIG_fail; 1712 2435 result = (char *)libtrace_ip_ip_src_get(arg1); 1713 2436 … … 1721 2444 1722 2445 static PyObject *_wrap_libtrace_ip_ip_dst_get(PyObject *self, PyObject *args) { 1723 PyObject *resultobj ;2446 PyObject *resultobj = NULL; 1724 2447 struct libtrace_ip *arg1 = (struct libtrace_ip *) 0 ; 1725 2448 char *result; … … 1727 2450 1728 2451 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_ip_ip_dst_get",&obj0)) goto fail; 1729 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_ip,1730 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2452 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_ip, SWIG_POINTER_EXCEPTION | 0); 2453 if (SWIG_arg_fail(1)) SWIG_fail; 1731 2454 result = (char *)libtrace_ip_ip_dst_get(arg1); 1732 2455 … … 1747 2470 } 1748 2471 static PyObject *_wrap_libtrace_tcp_res1_set(PyObject *self, PyObject *args) { 1749 PyObject *resultobj ;2472 PyObject *resultobj = NULL; 1750 2473 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 1751 2474 uint16_t arg2 ; … … 1754 2477 1755 2478 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_tcp_res1_set",&obj0,&obj1)) goto fail; 1756 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp, 1757 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 1758 arg2 = (uint16_t)SWIG_As_unsigned_SS_short(obj1); 1759 if (PyErr_Occurred()) SWIG_fail; 2479 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2480 if (SWIG_arg_fail(1)) SWIG_fail; 2481 { 2482 arg2 = (uint16_t)(SWIG_As_unsigned_SS_short(obj1)); 2483 if (SWIG_arg_fail(2)) SWIG_fail; 2484 } 1760 2485 if (arg1) (arg1)->res1 = arg2; 1761 2486 … … 1768 2493 1769 2494 static PyObject *_wrap_libtrace_tcp_res1_get(PyObject *self, PyObject *args) { 1770 PyObject *resultobj ;2495 PyObject *resultobj = NULL; 1771 2496 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 1772 2497 uint16_t result; … … 1774 2499 1775 2500 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_tcp_res1_get",&obj0)) goto fail; 1776 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp,1777 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2501 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2502 if (SWIG_arg_fail(1)) SWIG_fail; 1778 2503 result = (uint16_t) ((arg1)->res1); 1779 2504 1780 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 2505 { 2506 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 2507 } 1781 2508 return resultobj; 1782 2509 fail: … … 1786 2513 1787 2514 static PyObject *_wrap_libtrace_tcp_doff_set(PyObject *self, PyObject *args) { 1788 PyObject *resultobj ;2515 PyObject *resultobj = NULL; 1789 2516 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 1790 2517 uint16_t arg2 ; … … 1793 2520 1794 2521 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_tcp_doff_set",&obj0,&obj1)) goto fail; 1795 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp, 1796 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 1797 arg2 = (uint16_t)SWIG_As_unsigned_SS_short(obj1); 1798 if (PyErr_Occurred()) SWIG_fail; 2522 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2523 if (SWIG_arg_fail(1)) SWIG_fail; 2524 { 2525 arg2 = (uint16_t)(SWIG_As_unsigned_SS_short(obj1)); 2526 if (SWIG_arg_fail(2)) SWIG_fail; 2527 } 1799 2528 if (arg1) (arg1)->doff = arg2; 1800 2529 … … 1807 2536 1808 2537 static PyObject *_wrap_libtrace_tcp_doff_get(PyObject *self, PyObject *args) { 1809 PyObject *resultobj ;2538 PyObject *resultobj = NULL; 1810 2539 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 1811 2540 uint16_t result; … … 1813 2542 1814 2543 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_tcp_doff_get",&obj0)) goto fail; 1815 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp,1816 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2544 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2545 if (SWIG_arg_fail(1)) SWIG_fail; 1817 2546 result = (uint16_t) ((arg1)->doff); 1818 2547 1819 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 2548 { 2549 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 2550 } 1820 2551 return resultobj; 1821 2552 fail: … … 1825 2556 1826 2557 static PyObject *_wrap_libtrace_tcp_fin_set(PyObject *self, PyObject *args) { 1827 PyObject *resultobj ;2558 PyObject *resultobj = NULL; 1828 2559 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 1829 2560 uint16_t arg2 ; … … 1832 2563 1833 2564 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_tcp_fin_set",&obj0,&obj1)) goto fail; 1834 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp, 1835 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 1836 arg2 = (uint16_t)SWIG_As_unsigned_SS_short(obj1); 1837 if (PyErr_Occurred()) SWIG_fail; 2565 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2566 if (SWIG_arg_fail(1)) SWIG_fail; 2567 { 2568 arg2 = (uint16_t)(SWIG_As_unsigned_SS_short(obj1)); 2569 if (SWIG_arg_fail(2)) SWIG_fail; 2570 } 1838 2571 if (arg1) (arg1)->fin = arg2; 1839 2572 … … 1846 2579 1847 2580 static PyObject *_wrap_libtrace_tcp_fin_get(PyObject *self, PyObject *args) { 1848 PyObject *resultobj ;2581 PyObject *resultobj = NULL; 1849 2582 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 1850 2583 uint16_t result; … … 1852 2585 1853 2586 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_tcp_fin_get",&obj0)) goto fail; 1854 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp,1855 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2587 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2588 if (SWIG_arg_fail(1)) SWIG_fail; 1856 2589 result = (uint16_t) ((arg1)->fin); 1857 2590 1858 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 2591 { 2592 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 2593 } 1859 2594 return resultobj; 1860 2595 fail: … … 1864 2599 1865 2600 static PyObject *_wrap_libtrace_tcp_syn_set(PyObject *self, PyObject *args) { 1866 PyObject *resultobj ;2601 PyObject *resultobj = NULL; 1867 2602 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 1868 2603 uint16_t arg2 ; … … 1871 2606 1872 2607 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_tcp_syn_set",&obj0,&obj1)) goto fail; 1873 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp, 1874 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 1875 arg2 = (uint16_t)SWIG_As_unsigned_SS_short(obj1); 1876 if (PyErr_Occurred()) SWIG_fail; 2608 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2609 if (SWIG_arg_fail(1)) SWIG_fail; 2610 { 2611 arg2 = (uint16_t)(SWIG_As_unsigned_SS_short(obj1)); 2612 if (SWIG_arg_fail(2)) SWIG_fail; 2613 } 1877 2614 if (arg1) (arg1)->syn = arg2; 1878 2615 … … 1885 2622 1886 2623 static PyObject *_wrap_libtrace_tcp_syn_get(PyObject *self, PyObject *args) { 1887 PyObject *resultobj ;2624 PyObject *resultobj = NULL; 1888 2625 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 1889 2626 uint16_t result; … … 1891 2628 1892 2629 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_tcp_syn_get",&obj0)) goto fail; 1893 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp,1894 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2630 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2631 if (SWIG_arg_fail(1)) SWIG_fail; 1895 2632 result = (uint16_t) ((arg1)->syn); 1896 2633 1897 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 2634 { 2635 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 2636 } 1898 2637 return resultobj; 1899 2638 fail: … … 1903 2642 1904 2643 static PyObject *_wrap_libtrace_tcp_rst_set(PyObject *self, PyObject *args) { 1905 PyObject *resultobj ;2644 PyObject *resultobj = NULL; 1906 2645 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 1907 2646 uint16_t arg2 ; … … 1910 2649 1911 2650 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_tcp_rst_set",&obj0,&obj1)) goto fail; 1912 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp, 1913 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 1914 arg2 = (uint16_t)SWIG_As_unsigned_SS_short(obj1); 1915 if (PyErr_Occurred()) SWIG_fail; 2651 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2652 if (SWIG_arg_fail(1)) SWIG_fail; 2653 { 2654 arg2 = (uint16_t)(SWIG_As_unsigned_SS_short(obj1)); 2655 if (SWIG_arg_fail(2)) SWIG_fail; 2656 } 1916 2657 if (arg1) (arg1)->rst = arg2; 1917 2658 … … 1924 2665 1925 2666 static PyObject *_wrap_libtrace_tcp_rst_get(PyObject *self, PyObject *args) { 1926 PyObject *resultobj ;2667 PyObject *resultobj = NULL; 1927 2668 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 1928 2669 uint16_t result; … … 1930 2671 1931 2672 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_tcp_rst_get",&obj0)) goto fail; 1932 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp,1933 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2673 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2674 if (SWIG_arg_fail(1)) SWIG_fail; 1934 2675 result = (uint16_t) ((arg1)->rst); 1935 2676 1936 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 2677 { 2678 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 2679 } 1937 2680 return resultobj; 1938 2681 fail: … … 1942 2685 1943 2686 static PyObject *_wrap_libtrace_tcp_psh_set(PyObject *self, PyObject *args) { 1944 PyObject *resultobj ;2687 PyObject *resultobj = NULL; 1945 2688 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 1946 2689 uint16_t arg2 ; … … 1949 2692 1950 2693 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_tcp_psh_set",&obj0,&obj1)) goto fail; 1951 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp, 1952 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 1953 arg2 = (uint16_t)SWIG_As_unsigned_SS_short(obj1); 1954 if (PyErr_Occurred()) SWIG_fail; 2694 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2695 if (SWIG_arg_fail(1)) SWIG_fail; 2696 { 2697 arg2 = (uint16_t)(SWIG_As_unsigned_SS_short(obj1)); 2698 if (SWIG_arg_fail(2)) SWIG_fail; 2699 } 1955 2700 if (arg1) (arg1)->psh = arg2; 1956 2701 … … 1963 2708 1964 2709 static PyObject *_wrap_libtrace_tcp_psh_get(PyObject *self, PyObject *args) { 1965 PyObject *resultobj ;2710 PyObject *resultobj = NULL; 1966 2711 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 1967 2712 uint16_t result; … … 1969 2714 1970 2715 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_tcp_psh_get",&obj0)) goto fail; 1971 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp,1972 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2716 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2717 if (SWIG_arg_fail(1)) SWIG_fail; 1973 2718 result = (uint16_t) ((arg1)->psh); 1974 2719 1975 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 2720 { 2721 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 2722 } 1976 2723 return resultobj; 1977 2724 fail: … … 1981 2728 1982 2729 static PyObject *_wrap_libtrace_tcp_ack_set(PyObject *self, PyObject *args) { 1983 PyObject *resultobj ;2730 PyObject *resultobj = NULL; 1984 2731 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 1985 2732 uint16_t arg2 ; … … 1988 2735 1989 2736 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_tcp_ack_set",&obj0,&obj1)) goto fail; 1990 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp, 1991 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 1992 arg2 = (uint16_t)SWIG_As_unsigned_SS_short(obj1); 1993 if (PyErr_Occurred()) SWIG_fail; 2737 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2738 if (SWIG_arg_fail(1)) SWIG_fail; 2739 { 2740 arg2 = (uint16_t)(SWIG_As_unsigned_SS_short(obj1)); 2741 if (SWIG_arg_fail(2)) SWIG_fail; 2742 } 1994 2743 if (arg1) (arg1)->ack = arg2; 1995 2744 … … 2002 2751 2003 2752 static PyObject *_wrap_libtrace_tcp_ack_get(PyObject *self, PyObject *args) { 2004 PyObject *resultobj ;2753 PyObject *resultobj = NULL; 2005 2754 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 2006 2755 uint16_t result; … … 2008 2757 2009 2758 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_tcp_ack_get",&obj0)) goto fail; 2010 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp,2011 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2759 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2760 if (SWIG_arg_fail(1)) SWIG_fail; 2012 2761 result = (uint16_t) ((arg1)->ack); 2013 2762 2014 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 2763 { 2764 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 2765 } 2015 2766 return resultobj; 2016 2767 fail: … … 2020 2771 2021 2772 static PyObject *_wrap_libtrace_tcp_urg_set(PyObject *self, PyObject *args) { 2022 PyObject *resultobj ;2773 PyObject *resultobj = NULL; 2023 2774 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 2024 2775 uint16_t arg2 ; … … 2027 2778 2028 2779 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_tcp_urg_set",&obj0,&obj1)) goto fail; 2029 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp, 2030 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 2031 arg2 = (uint16_t)SWIG_As_unsigned_SS_short(obj1); 2032 if (PyErr_Occurred()) SWIG_fail; 2780 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2781 if (SWIG_arg_fail(1)) SWIG_fail; 2782 { 2783 arg2 = (uint16_t)(SWIG_As_unsigned_SS_short(obj1)); 2784 if (SWIG_arg_fail(2)) SWIG_fail; 2785 } 2033 2786 if (arg1) (arg1)->urg = arg2; 2034 2787 … … 2041 2794 2042 2795 static PyObject *_wrap_libtrace_tcp_urg_get(PyObject *self, PyObject *args) { 2043 PyObject *resultobj ;2796 PyObject *resultobj = NULL; 2044 2797 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 2045 2798 uint16_t result; … … 2047 2800 2048 2801 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_tcp_urg_get",&obj0)) goto fail; 2049 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp,2050 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2802 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2803 if (SWIG_arg_fail(1)) SWIG_fail; 2051 2804 result = (uint16_t) ((arg1)->urg); 2052 2805 2053 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 2806 { 2807 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 2808 } 2054 2809 return resultobj; 2055 2810 fail: … … 2059 2814 2060 2815 static PyObject *_wrap_libtrace_tcp_res2_set(PyObject *self, PyObject *args) { 2061 PyObject *resultobj ;2816 PyObject *resultobj = NULL; 2062 2817 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 2063 2818 uint16_t arg2 ; … … 2066 2821 2067 2822 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_tcp_res2_set",&obj0,&obj1)) goto fail; 2068 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp, 2069 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 2070 arg2 = (uint16_t)SWIG_As_unsigned_SS_short(obj1); 2071 if (PyErr_Occurred()) SWIG_fail; 2823 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2824 if (SWIG_arg_fail(1)) SWIG_fail; 2825 { 2826 arg2 = (uint16_t)(SWIG_As_unsigned_SS_short(obj1)); 2827 if (SWIG_arg_fail(2)) SWIG_fail; 2828 } 2072 2829 if (arg1) (arg1)->res2 = arg2; 2073 2830 … … 2080 2837 2081 2838 static PyObject *_wrap_libtrace_tcp_res2_get(PyObject *self, PyObject *args) { 2082 PyObject *resultobj ;2839 PyObject *resultobj = NULL; 2083 2840 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 2084 2841 uint16_t result; … … 2086 2843 2087 2844 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_tcp_res2_get",&obj0)) goto fail; 2088 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp,2089 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2845 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2846 if (SWIG_arg_fail(1)) SWIG_fail; 2090 2847 result = (uint16_t) ((arg1)->res2); 2091 2848 2092 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 2849 { 2850 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 2851 } 2093 2852 return resultobj; 2094 2853 fail: … … 2098 2857 2099 2858 static PyObject *_wrap_libtrace_tcp_source_get(PyObject *self, PyObject *args) { 2100 PyObject *resultobj ;2859 PyObject *resultobj = NULL; 2101 2860 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 2102 2861 uint16_t result; … … 2104 2863 2105 2864 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_tcp_source_get",&obj0)) goto fail; 2106 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp,2107 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2865 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2866 if (SWIG_arg_fail(1)) SWIG_fail; 2108 2867 result = (uint16_t)libtrace_tcp_source_get(arg1); 2109 2868 2110 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 2869 { 2870 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 2871 } 2111 2872 return resultobj; 2112 2873 fail: … … 2116 2877 2117 2878 static PyObject *_wrap_libtrace_tcp_dest_get(PyObject *self, PyObject *args) { 2118 PyObject *resultobj ;2879 PyObject *resultobj = NULL; 2119 2880 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 2120 2881 uint16_t result; … … 2122 2883 2123 2884 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_tcp_dest_get",&obj0)) goto fail; 2124 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp,2125 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2885 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2886 if (SWIG_arg_fail(1)) SWIG_fail; 2126 2887 result = (uint16_t)libtrace_tcp_dest_get(arg1); 2127 2888 2128 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 2889 { 2890 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 2891 } 2129 2892 return resultobj; 2130 2893 fail: … … 2134 2897 2135 2898 static PyObject *_wrap_libtrace_tcp_window_get(PyObject *self, PyObject *args) { 2136 PyObject *resultobj ;2899 PyObject *resultobj = NULL; 2137 2900 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 2138 2901 uint16_t result; … … 2140 2903 2141 2904 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_tcp_window_get",&obj0)) goto fail; 2142 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp,2143 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2905 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2906 if (SWIG_arg_fail(1)) SWIG_fail; 2144 2907 result = (uint16_t)libtrace_tcp_window_get(arg1); 2145 2908 2146 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 2909 { 2910 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 2911 } 2147 2912 return resultobj; 2148 2913 fail: … … 2152 2917 2153 2918 static PyObject *_wrap_libtrace_tcp_check_get(PyObject *self, PyObject *args) { 2154 PyObject *resultobj ;2919 PyObject *resultobj = NULL; 2155 2920 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 2156 2921 uint16_t result; … … 2158 2923 2159 2924 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_tcp_check_get",&obj0)) goto fail; 2160 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp,2161 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2925 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2926 if (SWIG_arg_fail(1)) SWIG_fail; 2162 2927 result = (uint16_t)libtrace_tcp_check_get(arg1); 2163 2928 2164 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 2929 { 2930 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 2931 } 2165 2932 return resultobj; 2166 2933 fail: … … 2170 2937 2171 2938 static PyObject *_wrap_libtrace_tcp_urg_ptr_get(PyObject *self, PyObject *args) { 2172 PyObject *resultobj ;2939 PyObject *resultobj = NULL; 2173 2940 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 2174 2941 uint16_t result; … … 2176 2943 2177 2944 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_tcp_urg_ptr_get",&obj0)) goto fail; 2178 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp,2179 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2945 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2946 if (SWIG_arg_fail(1)) SWIG_fail; 2180 2947 result = (uint16_t)libtrace_tcp_urg_ptr_get(arg1); 2181 2948 2182 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 2949 { 2950 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 2951 } 2183 2952 return resultobj; 2184 2953 fail: … … 2188 2957 2189 2958 static PyObject *_wrap_libtrace_tcp_seq_get(PyObject *self, PyObject *args) { 2190 PyObject *resultobj ;2959 PyObject *resultobj = NULL; 2191 2960 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 2192 2961 uint32_t result; … … 2194 2963 2195 2964 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_tcp_seq_get",&obj0)) goto fail; 2196 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp,2197 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2965 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2966 if (SWIG_arg_fail(1)) SWIG_fail; 2198 2967 result = (uint32_t)libtrace_tcp_seq_get(arg1); 2199 2968 2200 resultobj = SWIG_From_unsigned_SS_int((unsigned int)result); 2969 { 2970 resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); 2971 } 2201 2972 return resultobj; 2202 2973 fail: … … 2206 2977 2207 2978 static PyObject *_wrap_libtrace_tcp_ack_seq_get(PyObject *self, PyObject *args) { 2208 PyObject *resultobj ;2979 PyObject *resultobj = NULL; 2209 2980 struct libtrace_tcp *arg1 = (struct libtrace_tcp *) 0 ; 2210 2981 uint32_t result; … … 2212 2983 2213 2984 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_tcp_ack_seq_get",&obj0)) goto fail; 2214 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_tcp,2215 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;2985 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_tcp, SWIG_POINTER_EXCEPTION | 0); 2986 if (SWIG_arg_fail(1)) SWIG_fail; 2216 2987 result = (uint32_t)libtrace_tcp_ack_seq_get(arg1); 2217 2988 2218 resultobj = SWIG_From_unsigned_SS_int((unsigned int)result); 2989 { 2990 resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); 2991 } 2219 2992 return resultobj; 2220 2993 fail: … … 2231 3004 } 2232 3005 static PyObject *_wrap_libtrace_udp_source_get(PyObject *self, PyObject *args) { 2233 PyObject *resultobj ;3006 PyObject *resultobj = NULL; 2234 3007 struct libtrace_udp *arg1 = (struct libtrace_udp *) 0 ; 2235 3008 uint16_t result; … … 2237 3010 2238 3011 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_udp_source_get",&obj0)) goto fail; 2239 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_udp,2240 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3012 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_udp, SWIG_POINTER_EXCEPTION | 0); 3013 if (SWIG_arg_fail(1)) SWIG_fail; 2241 3014 result = (uint16_t)libtrace_udp_source_get(arg1); 2242 3015 2243 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 3016 { 3017 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 3018 } 2244 3019 return resultobj; 2245 3020 fail: … … 2249 3024 2250 3025 static PyObject *_wrap_libtrace_udp_dest_get(PyObject *self, PyObject *args) { 2251 PyObject *resultobj ;3026 PyObject *resultobj = NULL; 2252 3027 struct libtrace_udp *arg1 = (struct libtrace_udp *) 0 ; 2253 3028 uint16_t result; … … 2255 3030 2256 3031 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_udp_dest_get",&obj0)) goto fail; 2257 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_udp,2258 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3032 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_udp, SWIG_POINTER_EXCEPTION | 0); 3033 if (SWIG_arg_fail(1)) SWIG_fail; 2259 3034 result = (uint16_t)libtrace_udp_dest_get(arg1); 2260 3035 2261 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 3036 { 3037 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 3038 } 2262 3039 return resultobj; 2263 3040 fail: … … 2267 3044 2268 3045 static PyObject *_wrap_libtrace_udp_len_get(PyObject *self, PyObject *args) { 2269 PyObject *resultobj ;3046 PyObject *resultobj = NULL; 2270 3047 struct libtrace_udp *arg1 = (struct libtrace_udp *) 0 ; 2271 3048 uint16_t result; … … 2273 3050 2274 3051 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_udp_len_get",&obj0)) goto fail; 2275 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_udp,2276 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3052 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_udp, SWIG_POINTER_EXCEPTION | 0); 3053 if (SWIG_arg_fail(1)) SWIG_fail; 2277 3054 result = (uint16_t)libtrace_udp_len_get(arg1); 2278 3055 2279 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 3056 { 3057 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 3058 } 2280 3059 return resultobj; 2281 3060 fail: … … 2285 3064 2286 3065 static PyObject *_wrap_libtrace_udp_check_get(PyObject *self, PyObject *args) { 2287 PyObject *resultobj ;3066 PyObject *resultobj = NULL; 2288 3067 struct libtrace_udp *arg1 = (struct libtrace_udp *) 0 ; 2289 3068 uint16_t result; … … 2291 3070 2292 3071 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_udp_check_get",&obj0)) goto fail; 2293 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_udp,2294 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3072 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_udp, SWIG_POINTER_EXCEPTION | 0); 3073 if (SWIG_arg_fail(1)) SWIG_fail; 2295 3074 result = (uint16_t)libtrace_udp_check_get(arg1); 2296 3075 2297 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 3076 { 3077 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 3078 } 2298 3079 return resultobj; 2299 3080 fail: … … 2310 3091 } 2311 3092 static PyObject *_wrap_libtrace_icmp_type_set(PyObject *self, PyObject *args) { 2312 PyObject *resultobj ;3093 PyObject *resultobj = NULL; 2313 3094 struct libtrace_icmp *arg1 = (struct libtrace_icmp *) 0 ; 2314 3095 uint8_t arg2 ; … … 2317 3098 2318 3099 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_icmp_type_set",&obj0,&obj1)) goto fail; 2319 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_icmp, 2320 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 2321 arg2 = (uint8_t)SWIG_As_unsigned_SS_char(obj1); 2322 if (PyErr_Occurred()) SWIG_fail; 3100 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_icmp, SWIG_POINTER_EXCEPTION | 0); 3101 if (SWIG_arg_fail(1)) SWIG_fail; 3102 { 3103 arg2 = (uint8_t)(SWIG_As_unsigned_SS_char(obj1)); 3104 if (SWIG_arg_fail(2)) SWIG_fail; 3105 } 2323 3106 if (arg1) (arg1)->type = arg2; 2324 3107 … … 2331 3114 2332 3115 static PyObject *_wrap_libtrace_icmp_type_get(PyObject *self, PyObject *args) { 2333 PyObject *resultobj ;3116 PyObject *resultobj = NULL; 2334 3117 struct libtrace_icmp *arg1 = (struct libtrace_icmp *) 0 ; 2335 3118 uint8_t result; … … 2337 3120 2338 3121 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_icmp_type_get",&obj0)) goto fail; 2339 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_icmp,2340 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3122 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_icmp, SWIG_POINTER_EXCEPTION | 0); 3123 if (SWIG_arg_fail(1)) SWIG_fail; 2341 3124 result = (uint8_t) ((arg1)->type); 2342 3125 2343 resultobj = SWIG_From_unsigned_SS_char((unsigned char)result); 3126 { 3127 resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); 3128 } 2344 3129 return resultobj; 2345 3130 fail: … … 2349 3134 2350 3135 static PyObject *_wrap_libtrace_icmp_code_set(PyObject *self, PyObject *args) { 2351 PyObject *resultobj ;3136 PyObject *resultobj = NULL; 2352 3137 struct libtrace_icmp *arg1 = (struct libtrace_icmp *) 0 ; 2353 3138 uint8_t arg2 ; … … 2356 3141 2357 3142 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_icmp_code_set",&obj0,&obj1)) goto fail; 2358 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_icmp, 2359 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 2360 arg2 = (uint8_t)SWIG_As_unsigned_SS_char(obj1); 2361 if (PyErr_Occurred()) SWIG_fail; 3143 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_icmp, SWIG_POINTER_EXCEPTION | 0); 3144 if (SWIG_arg_fail(1)) SWIG_fail; 3145 { 3146 arg2 = (uint8_t)(SWIG_As_unsigned_SS_char(obj1)); 3147 if (SWIG_arg_fail(2)) SWIG_fail; 3148 } 2362 3149 if (arg1) (arg1)->code = arg2; 2363 3150 … … 2370 3157 2371 3158 static PyObject *_wrap_libtrace_icmp_code_get(PyObject *self, PyObject *args) { 2372 PyObject *resultobj ;3159 PyObject *resultobj = NULL; 2373 3160 struct libtrace_icmp *arg1 = (struct libtrace_icmp *) 0 ; 2374 3161 uint8_t result; … … 2376 3163 2377 3164 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_icmp_code_get",&obj0)) goto fail; 2378 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_icmp,2379 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3165 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_icmp, SWIG_POINTER_EXCEPTION | 0); 3166 if (SWIG_arg_fail(1)) SWIG_fail; 2380 3167 result = (uint8_t) ((arg1)->code); 2381 3168 2382 resultobj = SWIG_From_unsigned_SS_char((unsigned char)result); 3169 { 3170 resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); 3171 } 2383 3172 return resultobj; 2384 3173 fail: … … 2388 3177 2389 3178 static PyObject *_wrap_libtrace_icmp_checksum_set(PyObject *self, PyObject *args) { 2390 PyObject *resultobj ;3179 PyObject *resultobj = NULL; 2391 3180 struct libtrace_icmp *arg1 = (struct libtrace_icmp *) 0 ; 2392 3181 uint16_t arg2 ; … … 2395 3184 2396 3185 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_icmp_checksum_set",&obj0,&obj1)) goto fail; 2397 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_icmp, 2398 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 2399 arg2 = (uint16_t)SWIG_As_unsigned_SS_short(obj1); 2400 if (PyErr_Occurred()) SWIG_fail; 3186 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_icmp, SWIG_POINTER_EXCEPTION | 0); 3187 if (SWIG_arg_fail(1)) SWIG_fail; 3188 { 3189 arg2 = (uint16_t)(SWIG_As_unsigned_SS_short(obj1)); 3190 if (SWIG_arg_fail(2)) SWIG_fail; 3191 } 2401 3192 if (arg1) (arg1)->checksum = arg2; 2402 3193 … … 2409 3200 2410 3201 static PyObject *_wrap_libtrace_icmp_checksum_get(PyObject *self, PyObject *args) { 2411 PyObject *resultobj ;3202 PyObject *resultobj = NULL; 2412 3203 struct libtrace_icmp *arg1 = (struct libtrace_icmp *) 0 ; 2413 3204 uint16_t result; … … 2415 3206 2416 3207 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_icmp_checksum_get",&obj0)) goto fail; 2417 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_icmp,2418 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3208 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_icmp, SWIG_POINTER_EXCEPTION | 0); 3209 if (SWIG_arg_fail(1)) SWIG_fail; 2419 3210 result = (uint16_t) ((arg1)->checksum); 2420 3211 2421 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 3212 { 3213 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 3214 } 2422 3215 return resultobj; 2423 3216 fail: … … 2427 3220 2428 3221 static PyObject *_wrap_libtrace_icmp_un_get(PyObject *self, PyObject *args) { 2429 PyObject *resultobj ;3222 PyObject *resultobj = NULL; 2430 3223 struct libtrace_icmp *arg1 = (struct libtrace_icmp *) 0 ; 2431 3224 libtrace_icmp_un *result; … … 2433 3226 2434 3227 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_icmp_un_get",&obj0)) goto fail; 2435 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_icmp,2436 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3228 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_icmp, SWIG_POINTER_EXCEPTION | 0); 3229 if (SWIG_arg_fail(1)) SWIG_fail; 2437 3230 result = (libtrace_icmp_un *)& ((arg1)->un); 2438 3231 … … 2452 3245 } 2453 3246 static PyObject *_wrap_libtrace_icmp_un_gateway_set(PyObject *self, PyObject *args) { 2454 PyObject *resultobj ;3247 PyObject *resultobj = NULL; 2455 3248 libtrace_icmp_un *arg1 = (libtrace_icmp_un *) 0 ; 2456 3249 uint32_t arg2 ; … … 2459 3252 2460 3253 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_icmp_un_gateway_set",&obj0,&obj1)) goto fail; 2461 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_icmp_un, 2462 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 2463 arg2 = (uint32_t)SWIG_As_unsigned_SS_int(obj1); 2464 if (PyErr_Occurred()) SWIG_fail; 3254 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_icmp_un, SWIG_POINTER_EXCEPTION | 0); 3255 if (SWIG_arg_fail(1)) SWIG_fail; 3256 { 3257 arg2 = (uint32_t)(SWIG_As_unsigned_SS_int(obj1)); 3258 if (SWIG_arg_fail(2)) SWIG_fail; 3259 } 2465 3260 if (arg1) (arg1)->gateway = arg2; 2466 3261 … … 2473 3268 2474 3269 static PyObject *_wrap_libtrace_icmp_un_gateway_get(PyObject *self, PyObject *args) { 2475 PyObject *resultobj ;3270 PyObject *resultobj = NULL; 2476 3271 libtrace_icmp_un *arg1 = (libtrace_icmp_un *) 0 ; 2477 3272 uint32_t result; … … 2479 3274 2480 3275 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_icmp_un_gateway_get",&obj0)) goto fail; 2481 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_icmp_un,2482 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3276 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_icmp_un, SWIG_POINTER_EXCEPTION | 0); 3277 if (SWIG_arg_fail(1)) SWIG_fail; 2483 3278 result = (uint32_t) ((arg1)->gateway); 2484 3279 2485 resultobj = SWIG_From_unsigned_SS_int((unsigned int)result); 3280 { 3281 resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result)); 3282 } 2486 3283 return resultobj; 2487 3284 fail: … … 2491 3288 2492 3289 static PyObject *_wrap_libtrace_icmp_un_frag_get(PyObject *self, PyObject *args) { 2493 PyObject *resultobj ;3290 PyObject *resultobj = NULL; 2494 3291 libtrace_icmp_un *arg1 = (libtrace_icmp_un *) 0 ; 2495 3292 libtrace_icmp_un_frag *result; … … 2497 3294 2498 3295 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_icmp_un_frag_get",&obj0)) goto fail; 2499 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_icmp_un,2500 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3296 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_icmp_un, SWIG_POINTER_EXCEPTION | 0); 3297 if (SWIG_arg_fail(1)) SWIG_fail; 2501 3298 result = (libtrace_icmp_un_frag *)& ((arg1)->frag); 2502 3299 … … 2509 3306 2510 3307 static PyObject *_wrap_libtrace_icmp_un_echo_get(PyObject *self, PyObject *args) { 2511 PyObject *resultobj ;3308 PyObject *resultobj = NULL; 2512 3309 libtrace_icmp_un *arg1 = (libtrace_icmp_un *) 0 ; 2513 3310 libtrace_icmp_un_echo *result; … … 2515 3312 2516 3313 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_icmp_un_echo_get",&obj0)) goto fail; 2517 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_icmp_un,2518 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3314 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_icmp_un, SWIG_POINTER_EXCEPTION | 0); 3315 if (SWIG_arg_fail(1)) SWIG_fail; 2519 3316 result = (libtrace_icmp_un_echo *)& ((arg1)->echo); 2520 3317 … … 2534 3331 } 2535 3332 static PyObject *_wrap_libtrace_icmp_un_frag___unused_set(PyObject *self, PyObject *args) { 2536 PyObject *resultobj ;3333 PyObject *resultobj = NULL; 2537 3334 libtrace_icmp_un_frag *arg1 = (libtrace_icmp_un_frag *) 0 ; 2538 3335 uint16_t arg2 ; … … 2541 3338 2542 3339 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_icmp_un_frag___unused_set",&obj0,&obj1)) goto fail; 2543 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_icmp_un_frag, 2544 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 2545 arg2 = (uint16_t)SWIG_As_unsigned_SS_short(obj1); 2546 if (PyErr_Occurred()) SWIG_fail; 3340 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_icmp_un_frag, SWIG_POINTER_EXCEPTION | 0); 3341 if (SWIG_arg_fail(1)) SWIG_fail; 3342 { 3343 arg2 = (uint16_t)(SWIG_As_unsigned_SS_short(obj1)); 3344 if (SWIG_arg_fail(2)) SWIG_fail; 3345 } 2547 3346 if (arg1) (arg1)->__unused = arg2; 2548 3347 … … 2555 3354 2556 3355 static PyObject *_wrap_libtrace_icmp_un_frag___unused_get(PyObject *self, PyObject *args) { 2557 PyObject *resultobj ;3356 PyObject *resultobj = NULL; 2558 3357 libtrace_icmp_un_frag *arg1 = (libtrace_icmp_un_frag *) 0 ; 2559 3358 uint16_t result; … … 2561 3360 2562 3361 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_icmp_un_frag___unused_get",&obj0)) goto fail; 2563 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_icmp_un_frag,2564 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3362 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_icmp_un_frag, SWIG_POINTER_EXCEPTION | 0); 3363 if (SWIG_arg_fail(1)) SWIG_fail; 2565 3364 result = (uint16_t) ((arg1)->__unused); 2566 3365 2567 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 3366 { 3367 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 3368 } 2568 3369 return resultobj; 2569 3370 fail: … … 2573 3374 2574 3375 static PyObject *_wrap_libtrace_icmp_un_frag_mtu_set(PyObject *self, PyObject *args) { 2575 PyObject *resultobj ;3376 PyObject *resultobj = NULL; 2576 3377 libtrace_icmp_un_frag *arg1 = (libtrace_icmp_un_frag *) 0 ; 2577 3378 uint16_t arg2 ; … … 2580 3381 2581 3382 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_icmp_un_frag_mtu_set",&obj0,&obj1)) goto fail; 2582 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_icmp_un_frag, 2583 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 2584 arg2 = (uint16_t)SWIG_As_unsigned_SS_short(obj1); 2585 if (PyErr_Occurred()) SWIG_fail; 3383 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_icmp_un_frag, SWIG_POINTER_EXCEPTION | 0); 3384 if (SWIG_arg_fail(1)) SWIG_fail; 3385 { 3386 arg2 = (uint16_t)(SWIG_As_unsigned_SS_short(obj1)); 3387 if (SWIG_arg_fail(2)) SWIG_fail; 3388 } 2586 3389 if (arg1) (arg1)->mtu = arg2; 2587 3390 … … 2594 3397 2595 3398 static PyObject *_wrap_libtrace_icmp_un_frag_mtu_get(PyObject *self, PyObject *args) { 2596 PyObject *resultobj ;3399 PyObject *resultobj = NULL; 2597 3400 libtrace_icmp_un_frag *arg1 = (libtrace_icmp_un_frag *) 0 ; 2598 3401 uint16_t result; … … 2600 3403 2601 3404 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_icmp_un_frag_mtu_get",&obj0)) goto fail; 2602 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_icmp_un_frag,2603 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3405 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_icmp_un_frag, SWIG_POINTER_EXCEPTION | 0); 3406 if (SWIG_arg_fail(1)) SWIG_fail; 2604 3407 result = (uint16_t) ((arg1)->mtu); 2605 3408 2606 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 3409 { 3410 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 3411 } 2607 3412 return resultobj; 2608 3413 fail: … … 2619 3424 } 2620 3425 static PyObject *_wrap_libtrace_icmp_un_echo_id_set(PyObject *self, PyObject *args) { 2621 PyObject *resultobj ;3426 PyObject *resultobj = NULL; 2622 3427 libtrace_icmp_un_echo *arg1 = (libtrace_icmp_un_echo *) 0 ; 2623 3428 uint16_t arg2 ; … … 2626 3431 2627 3432 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_icmp_un_echo_id_set",&obj0,&obj1)) goto fail; 2628 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_icmp_un_echo, 2629 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 2630 arg2 = (uint16_t)SWIG_As_unsigned_SS_short(obj1); 2631 if (PyErr_Occurred()) SWIG_fail; 3433 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_icmp_un_echo, SWIG_POINTER_EXCEPTION | 0); 3434 if (SWIG_arg_fail(1)) SWIG_fail; 3435 { 3436 arg2 = (uint16_t)(SWIG_As_unsigned_SS_short(obj1)); 3437 if (SWIG_arg_fail(2)) SWIG_fail; 3438 } 2632 3439 if (arg1) (arg1)->id = arg2; 2633 3440 … … 2640 3447 2641 3448 static PyObject *_wrap_libtrace_icmp_un_echo_id_get(PyObject *self, PyObject *args) { 2642 PyObject *resultobj ;3449 PyObject *resultobj = NULL; 2643 3450 libtrace_icmp_un_echo *arg1 = (libtrace_icmp_un_echo *) 0 ; 2644 3451 uint16_t result; … … 2646 3453 2647 3454 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_icmp_un_echo_id_get",&obj0)) goto fail; 2648 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_icmp_un_echo,2649 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3455 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_icmp_un_echo, SWIG_POINTER_EXCEPTION | 0); 3456 if (SWIG_arg_fail(1)) SWIG_fail; 2650 3457 result = (uint16_t) ((arg1)->id); 2651 3458 2652 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 3459 { 3460 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 3461 } 2653 3462 return resultobj; 2654 3463 fail: … … 2658 3467 2659 3468 static PyObject *_wrap_libtrace_icmp_un_echo_sequence_set(PyObject *self, PyObject *args) { 2660 PyObject *resultobj ;3469 PyObject *resultobj = NULL; 2661 3470 libtrace_icmp_un_echo *arg1 = (libtrace_icmp_un_echo *) 0 ; 2662 3471 uint16_t arg2 ; … … 2665 3474 2666 3475 if(!PyArg_ParseTuple(args,(char *)"OO:libtrace_icmp_un_echo_sequence_set",&obj0,&obj1)) goto fail; 2667 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_icmp_un_echo, 2668 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 2669 arg2 = (uint16_t)SWIG_As_unsigned_SS_short(obj1); 2670 if (PyErr_Occurred()) SWIG_fail; 3476 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_icmp_un_echo, SWIG_POINTER_EXCEPTION | 0); 3477 if (SWIG_arg_fail(1)) SWIG_fail; 3478 { 3479 arg2 = (uint16_t)(SWIG_As_unsigned_SS_short(obj1)); 3480 if (SWIG_arg_fail(2)) SWIG_fail; 3481 } 2671 3482 if (arg1) (arg1)->sequence = arg2; 2672 3483 … … 2679 3490 2680 3491 static PyObject *_wrap_libtrace_icmp_un_echo_sequence_get(PyObject *self, PyObject *args) { 2681 PyObject *resultobj ;3492 PyObject *resultobj = NULL; 2682 3493 libtrace_icmp_un_echo *arg1 = (libtrace_icmp_un_echo *) 0 ; 2683 3494 uint16_t result; … … 2685 3496 2686 3497 if(!PyArg_ParseTuple(args,(char *)"O:libtrace_icmp_un_echo_sequence_get",&obj0)) goto fail; 2687 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_icmp_un_echo,2688 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3498 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_icmp_un_echo, SWIG_POINTER_EXCEPTION | 0); 3499 if (SWIG_arg_fail(1)) SWIG_fail; 2689 3500 result = (uint16_t) ((arg1)->sequence); 2690 3501 2691 resultobj = SWIG_From_unsigned_SS_short((unsigned short)result); 3502 { 3503 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 3504 } 2692 3505 return resultobj; 2693 3506 fail: … … 2704 3517 } 2705 3518 static PyObject *_wrap_new_Packet(PyObject *self, PyObject *args) { 2706 PyObject *resultobj ;3519 PyObject *resultobj = NULL; 2707 3520 struct libtrace_packet_t *result; 2708 3521 … … 2718 3531 2719 3532 static PyObject *_wrap_delete_Packet(PyObject *self, PyObject *args) { 2720 PyObject *resultobj ;3533 PyObject *resultobj = NULL; 2721 3534 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 2722 3535 PyObject * obj0 = 0 ; 2723 3536 2724 3537 if(!PyArg_ParseTuple(args,(char *)"O:delete_Packet",&obj0)) goto fail; 2725 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_packet_t,2726 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3538 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3539 if (SWIG_arg_fail(1)) SWIG_fail; 2727 3540 delete_libtrace_packet_t(arg1); 2728 3541 … … 2734 3547 2735 3548 3549 static PyObject *_wrap_Packet_trace_copy_packet(PyObject *self, PyObject *args) { 3550 PyObject *resultobj = NULL; 3551 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 3552 libtrace_packet_t *result; 3553 PyObject * obj0 = 0 ; 3554 3555 if(!PyArg_ParseTuple(args,(char *)"O:Packet_trace_copy_packet",&obj0)) goto fail; 3556 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3557 if (SWIG_arg_fail(1)) SWIG_fail; 3558 result = (libtrace_packet_t *)libtrace_packet_t_trace_copy_packet(arg1); 3559 3560 resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_libtrace_packet_t, 0); 3561 return resultobj; 3562 fail: 3563 return NULL; 3564 } 3565 3566 3567 static PyObject *_wrap_Packet_trace_get_link(PyObject *self, PyObject *args) { 3568 PyObject *resultobj = NULL; 3569 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 3570 void *result; 3571 PyObject * obj0 = 0 ; 3572 3573 if(!PyArg_ParseTuple(args,(char *)"O:Packet_trace_get_link",&obj0)) goto fail; 3574 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3575 if (SWIG_arg_fail(1)) SWIG_fail; 3576 result = (void *)libtrace_packet_t_trace_get_link(arg1); 3577 3578 resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_void, 0); 3579 return resultobj; 3580 fail: 3581 return NULL; 3582 } 3583 3584 3585 static PyObject *_wrap_Packet_trace_get_transport(PyObject *self, PyObject *args) { 3586 PyObject *resultobj = NULL; 3587 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 3588 uint8_t *arg2 = (uint8_t *) 0 ; 3589 uint32_t *arg3 = (uint32_t *) 0 ; 3590 void *result; 3591 PyObject * obj0 = 0 ; 3592 PyObject * obj1 = 0 ; 3593 PyObject * obj2 = 0 ; 3594 3595 if(!PyArg_ParseTuple(args,(char *)"OOO:Packet_trace_get_transport",&obj0,&obj1,&obj2)) goto fail; 3596 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3597 if (SWIG_arg_fail(1)) SWIG_fail; 3598 SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_unsigned_char, SWIG_POINTER_EXCEPTION | 0); 3599 if (SWIG_arg_fail(2)) SWIG_fail; 3600 SWIG_Python_ConvertPtr(obj2, (void **)&arg3, SWIGTYPE_p_unsigned_int, SWIG_POINTER_EXCEPTION | 0); 3601 if (SWIG_arg_fail(3)) SWIG_fail; 3602 result = (void *)libtrace_packet_t_trace_get_transport(arg1,arg2,arg3); 3603 3604 resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_void, 0); 3605 return resultobj; 3606 fail: 3607 return NULL; 3608 } 3609 3610 2736 3611 static PyObject *_wrap_Packet_trace_get_ip(PyObject *self, PyObject *args) { 2737 PyObject *resultobj ;3612 PyObject *resultobj = NULL; 2738 3613 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 2739 3614 struct libtrace_ip *result; … … 2741 3616 2742 3617 if(!PyArg_ParseTuple(args,(char *)"O:Packet_trace_get_ip",&obj0)) goto fail; 2743 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_packet_t,2744 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3618 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3619 if (SWIG_arg_fail(1)) SWIG_fail; 2745 3620 result = (struct libtrace_ip *)libtrace_packet_t_trace_get_ip(arg1); 2746 3621 … … 2753 3628 2754 3629 static PyObject *_wrap_Packet_trace_get_tcp(PyObject *self, PyObject *args) { 2755 PyObject *resultobj ;3630 PyObject *resultobj = NULL; 2756 3631 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 2757 3632 struct libtrace_tcp *result; … … 2759 3634 2760 3635 if(!PyArg_ParseTuple(args,(char *)"O:Packet_trace_get_tcp",&obj0)) goto fail; 2761 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_packet_t,2762 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3636 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3637 if (SWIG_arg_fail(1)) SWIG_fail; 2763 3638 result = (struct libtrace_tcp *)libtrace_packet_t_trace_get_tcp(arg1); 2764 3639 … … 2771 3646 2772 3647 static PyObject *_wrap_Packet_trace_get_udp(PyObject *self, PyObject *args) { 2773 PyObject *resultobj ;3648 PyObject *resultobj = NULL; 2774 3649 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 2775 3650 struct libtrace_udp *result; … … 2777 3652 2778 3653 if(!PyArg_ParseTuple(args,(char *)"O:Packet_trace_get_udp",&obj0)) goto fail; 2779 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_packet_t,2780 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3654 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3655 if (SWIG_arg_fail(1)) SWIG_fail; 2781 3656 result = (struct libtrace_udp *)libtrace_packet_t_trace_get_udp(arg1); 2782 3657 … … 2789 3664 2790 3665 static PyObject *_wrap_Packet_trace_get_icmp(PyObject *self, PyObject *args) { 2791 PyObject *resultobj ;3666 PyObject *resultobj = NULL; 2792 3667 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 2793 3668 struct libtrace_icmp *result; … … 2795 3670 2796 3671 if(!PyArg_ParseTuple(args,(char *)"O:Packet_trace_get_icmp",&obj0)) goto fail; 2797 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_packet_t,2798 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3672 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3673 if (SWIG_arg_fail(1)) SWIG_fail; 2799 3674 result = (struct libtrace_icmp *)libtrace_packet_t_trace_get_icmp(arg1); 2800 3675 … … 2806 3681 2807 3682 2808 static PyObject *_wrap_Packet_trace_get_ link(PyObject *self, PyObject *args) {2809 PyObject *resultobj ;3683 static PyObject *_wrap_Packet_trace_get_destination_mac(PyObject *self, PyObject *args) { 3684 PyObject *resultobj = NULL; 2810 3685 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 2811 void *result; 2812 PyObject * obj0 = 0 ; 2813 2814 if(!PyArg_ParseTuple(args,(char *)"O:Packet_trace_get_link",&obj0)) goto fail; 2815 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_packet_t, 2816 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 2817 result = (void *)libtrace_packet_t_trace_get_link(arg1); 2818 2819 resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_void, 0); 3686 char *result; 3687 PyObject * obj0 = 0 ; 3688 3689 if(!PyArg_ParseTuple(args,(char *)"O:Packet_trace_get_destination_mac",&obj0)) goto fail; 3690 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3691 if (SWIG_arg_fail(1)) SWIG_fail; 3692 result = (char *)libtrace_packet_t_trace_get_destination_mac(arg1); 3693 3694 resultobj = SWIG_FromCharPtr(result); 3695 return resultobj; 3696 fail: 3697 return NULL; 3698 } 3699 3700 3701 static PyObject *_wrap_Packet_trace_get_source_mac(PyObject *self, PyObject *args) { 3702 PyObject *resultobj = NULL; 3703 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 3704 char *result; 3705 PyObject * obj0 = 0 ; 3706 3707 if(!PyArg_ParseTuple(args,(char *)"O:Packet_trace_get_source_mac",&obj0)) goto fail; 3708 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3709 if (SWIG_arg_fail(1)) SWIG_fail; 3710 result = (char *)libtrace_packet_t_trace_get_source_mac(arg1); 3711 3712 resultobj = SWIG_FromCharPtr(result); 3713 return resultobj; 3714 fail: 3715 return NULL; 3716 } 3717 3718 3719 static PyObject *_wrap_Packet_trace_ether_ntoa(PyObject *self, PyObject *args) { 3720 PyObject *resultobj = NULL; 3721 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 3722 uint8_t *arg2 = (uint8_t *) 0 ; 3723 char *result; 3724 PyObject * obj0 = 0 ; 3725 PyObject * obj1 = 0 ; 3726 3727 if(!PyArg_ParseTuple(args,(char *)"OO:Packet_trace_ether_ntoa",&obj0,&obj1)) goto fail; 3728 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3729 if (SWIG_arg_fail(1)) SWIG_fail; 3730 SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_unsigned_char, SWIG_POINTER_EXCEPTION | 0); 3731 if (SWIG_arg_fail(2)) SWIG_fail; 3732 result = (char *)libtrace_packet_t_trace_ether_ntoa(arg1,arg2); 3733 3734 resultobj = SWIG_FromCharPtr(result); 3735 return resultobj; 3736 fail: 3737 return NULL; 3738 } 3739 3740 3741 static PyObject *_wrap_Packet_trace_get_source_port(PyObject *self, PyObject *args) { 3742 PyObject *resultobj = NULL; 3743 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 3744 uint16_t result; 3745 PyObject * obj0 = 0 ; 3746 3747 if(!PyArg_ParseTuple(args,(char *)"O:Packet_trace_get_source_port",&obj0)) goto fail; 3748 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3749 if (SWIG_arg_fail(1)) SWIG_fail; 3750 result = (uint16_t)libtrace_packet_t_trace_get_source_port(arg1); 3751 3752 { 3753 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 3754 } 3755 return resultobj; 3756 fail: 3757 return NULL; 3758 } 3759 3760 3761 static PyObject *_wrap_Packet_trace_get_destination_port(PyObject *self, PyObject *args) { 3762 PyObject *resultobj = NULL; 3763 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 3764 uint16_t result; 3765 PyObject * obj0 = 0 ; 3766 3767 if(!PyArg_ParseTuple(args,(char *)"O:Packet_trace_get_destination_port",&obj0)) goto fail; 3768 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3769 if (SWIG_arg_fail(1)) SWIG_fail; 3770 result = (uint16_t)libtrace_packet_t_trace_get_destination_port(arg1); 3771 3772 { 3773 resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result)); 3774 } 2820 3775 return resultobj; 2821 3776 fail: … … 2825 3780 2826 3781 static PyObject *_wrap_Packet_trace_get_seconds(PyObject *self, PyObject *args) { 2827 PyObject *resultobj ;3782 PyObject *resultobj = NULL; 2828 3783 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 2829 3784 double result; … … 2831 3786 2832 3787 if(!PyArg_ParseTuple(args,(char *)"O:Packet_trace_get_seconds",&obj0)) goto fail; 2833 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_packet_t,2834 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3788 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3789 if (SWIG_arg_fail(1)) SWIG_fail; 2835 3790 result = (double)libtrace_packet_t_trace_get_seconds(arg1); 2836 3791 2837 resultobj = SWIG_From_double((double)result); 3792 { 3793 resultobj = SWIG_From_double((double)(result)); 3794 } 2838 3795 return resultobj; 2839 3796 fail: … … 2843 3800 2844 3801 static PyObject *_wrap_Packet_trace_get_erf_timestamp(PyObject *self, PyObject *args) { 2845 PyObject *resultobj ;3802 PyObject *resultobj = NULL; 2846 3803 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 2847 3804 uint64_t result; … … 2849 3806 2850 3807 if(!PyArg_ParseTuple(args,(char *)"O:Packet_trace_get_erf_timestamp",&obj0)) goto fail; 2851 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_packet_t,2852 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3808 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3809 if (SWIG_arg_fail(1)) SWIG_fail; 2853 3810 result = libtrace_packet_t_trace_get_erf_timestamp(arg1); 2854 3811 … … 2856 3813 uint64_t * resultptr; 2857 3814 resultptr = (uint64_t *) malloc(sizeof(uint64_t)); 2858 memmove(resultptr, &result, sizeof(uint64_t));3815 if (resultptr) memcpy(resultptr, &result, sizeof(uint64_t)); 2859 3816 resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_uint64_t, 1); 2860 3817 } … … 2866 3823 2867 3824 static PyObject *_wrap_Packet_trace_get_timeval(PyObject *self, PyObject *args) { 2868 PyObject *resultobj ;3825 PyObject *resultobj = NULL; 2869 3826 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 2870 3827 struct timeval result; … … 2872 3829 2873 3830 if(!PyArg_ParseTuple(args,(char *)"O:Packet_trace_get_timeval",&obj0)) goto fail; 2874 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_packet_t,2875 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3831 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3832 if (SWIG_arg_fail(1)) SWIG_fail; 2876 3833 result = libtrace_packet_t_trace_get_timeval(arg1); 2877 3834 … … 2879 3836 struct timeval * resultptr; 2880 3837 resultptr = (struct timeval *) malloc(sizeof(struct timeval)); 2881 memmove(resultptr, &result, sizeof(struct timeval));3838 if (resultptr) memcpy(resultptr, &result, sizeof(struct timeval)); 2882 3839 resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_timeval, 1); 2883 3840 } … … 2889 3846 2890 3847 static PyObject *_wrap_Packet_trace_get_capture_length(PyObject *self, PyObject *args) { 2891 PyObject *resultobj ;3848 PyObject *resultobj = NULL; 2892 3849 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 2893 3850 int result; … … 2895 3852 2896 3853 if(!PyArg_ParseTuple(args,(char *)"O:Packet_trace_get_capture_length",&obj0)) goto fail; 2897 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_packet_t,2898 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3854 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3855 if (SWIG_arg_fail(1)) SWIG_fail; 2899 3856 result = (int)libtrace_packet_t_trace_get_capture_length(arg1); 2900 3857 2901 resultobj = SWIG_From_int((int)result); 3858 { 3859 resultobj = SWIG_From_int((int)(result)); 3860 } 3861 return resultobj; 3862 fail: 3863 return NULL; 3864 } 3865 3866 3867 static PyObject *_wrap_Packet_trace_set_capture_length(PyObject *self, PyObject *args) { 3868 PyObject *resultobj = NULL; 3869 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 3870 size_t arg2 ; 3871 size_t result; 3872 PyObject * obj0 = 0 ; 3873 PyObject * obj1 = 0 ; 3874 3875 if(!PyArg_ParseTuple(args,(char *)"OO:Packet_trace_set_capture_length",&obj0,&obj1)) goto fail; 3876 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3877 if (SWIG_arg_fail(1)) SWIG_fail; 3878 { 3879 arg2 = (size_t)(SWIG_As_unsigned_SS_long(obj1)); 3880 if (SWIG_arg_fail(2)) SWIG_fail; 3881 } 3882 result = libtrace_packet_t_trace_set_capture_length(arg1,arg2); 3883 3884 { 3885 resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); 3886 } 2902 3887 return resultobj; 2903 3888 fail: … … 2907 3892 2908 3893 static PyObject *_wrap_Packet_trace_get_wire_lenth(PyObject *self, PyObject *args) { 2909 PyObject *resultobj ;3894 PyObject *resultobj = NULL; 2910 3895 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 2911 3896 int result; … … 2913 3898 2914 3899 if(!PyArg_ParseTuple(args,(char *)"O:Packet_trace_get_wire_lenth",&obj0)) goto fail; 2915 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_packet_t,2916 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3900 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3901 if (SWIG_arg_fail(1)) SWIG_fail; 2917 3902 result = (int)libtrace_packet_t_trace_get_wire_lenth(arg1); 2918 3903 2919 resultobj = SWIG_From_int((int)result); 3904 { 3905 resultobj = SWIG_From_int((int)(result)); 3906 } 3907 return resultobj; 3908 fail: 3909 return NULL; 3910 } 3911 3912 3913 static PyObject *_wrap_Packet_trace_get_framing_length(PyObject *self, PyObject *args) { 3914 PyObject *resultobj = NULL; 3915 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 3916 int result; 3917 PyObject * obj0 = 0 ; 3918 3919 if(!PyArg_ParseTuple(args,(char *)"O:Packet_trace_get_framing_length",&obj0)) goto fail; 3920 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3921 if (SWIG_arg_fail(1)) SWIG_fail; 3922 result = (int)libtrace_packet_t_trace_get_framing_length(arg1); 3923 3924 { 3925 resultobj = SWIG_From_int((int)(result)); 3926 } 2920 3927 return resultobj; 2921 3928 fail: … … 2925 3932 2926 3933 static PyObject *_wrap_Packet_trace_get_link_type(PyObject *self, PyObject *args) { 2927 PyObject *resultobj ;3934 PyObject *resultobj = NULL; 2928 3935 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 2929 3936 libtrace_linktype_t result; … … 2931 3938 2932 3939 if(!PyArg_ParseTuple(args,(char *)"O:Packet_trace_get_link_type",&obj0)) goto fail; 2933 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_packet_t,2934 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3940 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3941 if (SWIG_arg_fail(1)) SWIG_fail; 2935 3942 result = libtrace_packet_t_trace_get_link_type(arg1); 2936 3943 … … 2938 3945 libtrace_linktype_t * resultptr; 2939 3946 resultptr = (libtrace_linktype_t *) malloc(sizeof(libtrace_linktype_t)); 2940 memmove(resultptr, &result, sizeof(libtrace_linktype_t));3947 if (resultptr) memcpy(resultptr, &result, sizeof(libtrace_linktype_t)); 2941 3948 resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_libtrace_linktype_t, 1); 2942 3949 } … … 2948 3955 2949 3956 static PyObject *_wrap_Packet_trace_get_direction(PyObject *self, PyObject *args) { 2950 PyObject *resultobj ;3957 PyObject *resultobj = NULL; 2951 3958 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 2952 3959 int8_t result; … … 2954 3961 2955 3962 if(!PyArg_ParseTuple(args,(char *)"O:Packet_trace_get_direction",&obj0)) goto fail; 2956 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_packet_t,2957 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3963 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3964 if (SWIG_arg_fail(1)) SWIG_fail; 2958 3965 result = libtrace_packet_t_trace_get_direction(arg1); 2959 3966 … … 2961 3968 int8_t * resultptr; 2962 3969 resultptr = (int8_t *) malloc(sizeof(int8_t)); 2963 memmove(resultptr, &result, sizeof(int8_t));3970 if (resultptr) memcpy(resultptr, &result, sizeof(int8_t)); 2964 3971 resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_int8_t, 1); 2965 3972 } … … 2971 3978 2972 3979 static PyObject *_wrap_Packet_trace_set_direction(PyObject *self, PyObject *args) { 2973 PyObject *resultobj ;3980 PyObject *resultobj = NULL; 2974 3981 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 2975 3982 int8_t arg2 ; 2976 3983 int8_t result; 2977 int8_t *argp2 ;2978 3984 PyObject * obj0 = 0 ; 2979 3985 PyObject * obj1 = 0 ; 2980 3986 2981 3987 if(!PyArg_ParseTuple(args,(char *)"OO:Packet_trace_set_direction",&obj0,&obj1)) goto fail; 2982 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_packet_t, 2983 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 2984 if ((SWIG_ConvertPtr(obj1,(void **)(&argp2),SWIGTYPE_p_int8_t, 2985 SWIG_POINTER_EXCEPTION) == -1)) SWIG_fail; 2986 arg2 = *argp2; 3988 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 3989 if (SWIG_arg_fail(1)) SWIG_fail; 3990 { 3991 int8_t * argp; 3992 SWIG_Python_ConvertPtr(obj1, (void **)&argp, SWIGTYPE_p_int8_t, SWIG_POINTER_EXCEPTION); 3993 if (SWIG_arg_fail(2)) SWIG_fail; 3994 if (argp == NULL) { 3995 SWIG_null_ref("int8_t"); 3996 } 3997 if (SWIG_arg_fail(2)) SWIG_fail; 3998 arg2 = *argp; 3999 } 2987 4000 result = libtrace_packet_t_trace_set_direction(arg1,arg2); 2988 4001 … … 2990 4003 int8_t * resultptr; 2991 4004 resultptr = (int8_t *) malloc(sizeof(int8_t)); 2992 memmove(resultptr, &result, sizeof(int8_t));4005 if (resultptr) memcpy(resultptr, &result, sizeof(int8_t)); 2993 4006 resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_int8_t, 1); 2994 4007 } … … 2999 4012 3000 4013 3001 static PyObject *_wrap_Packet_trace_ bpf_filter(PyObject *self, PyObject *args) {3002 PyObject *resultobj ;4014 static PyObject *_wrap_Packet_trace_apply_filter(PyObject *self, PyObject *args) { 4015 PyObject *resultobj = NULL; 3003 4016 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 3004 4017 struct libtrace_filter_t *arg2 = (struct libtrace_filter_t *) 0 ; … … 3007 4020 PyObject * obj1 = 0 ; 3008 4021 3009 if(!PyArg_ParseTuple(args,(char *)"OO:Packet_trace_bpf_filter",&obj0,&obj1)) goto fail; 3010 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_packet_t, 3011 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 3012 if ((SWIG_ConvertPtr(obj1,(void **)(&arg2),SWIGTYPE_p_libtrace_filter_t, 3013 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 3014 result = (int)libtrace_packet_t_trace_bpf_filter(arg1,arg2); 3015 3016 resultobj = SWIG_From_int((int)result); 4022 if(!PyArg_ParseTuple(args,(char *)"OO:Packet_trace_apply_filter",&obj0,&obj1)) goto fail; 4023 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 4024 if (SWIG_arg_fail(1)) SWIG_fail; 4025 SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_libtrace_filter_t, SWIG_POINTER_EXCEPTION | 0); 4026 if (SWIG_arg_fail(2)) SWIG_fail; 4027 result = (int)libtrace_packet_t_trace_apply_filter(arg1,arg2); 4028 4029 { 4030 resultobj = SWIG_From_int((int)(result)); 4031 } 3017 4032 return resultobj; 3018 4033 fail: … … 3022 4037 3023 4038 static PyObject *_wrap_Packet_trace_get_server_port(PyObject *self, PyObject *args) { 3024 PyObject *resultobj ;4039 PyObject *resultobj = NULL; 3025 4040 struct libtrace_packet_t *arg1 = (struct libtrace_packet_t *) 0 ; 3026 4041 uint8_t arg2 ; … … 3034 4049 3035 4050 if(!PyArg_ParseTuple(args,(char *)"OOOO:Packet_trace_get_server_port",&obj0,&obj1,&obj2,&obj3)) goto fail; 3036 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_packet_t, 3037 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 3038 arg2 = (uint8_t)SWIG_As_unsigned_SS_char(obj1); 3039 if (PyErr_Occurred()) SWIG_fail; 3040 arg3 = (uint16_t)SWIG_As_unsigned_SS_short(obj2); 3041 if (PyErr_Occurred()) SWIG_fail; 3042 arg4 = (uint16_t)SWIG_As_unsigned_SS_short(obj3); 3043 if (PyErr_Occurred()) SWIG_fail; 4051 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 4052 if (SWIG_arg_fail(1)) SWIG_fail; 4053 { 4054 arg2 = (uint8_t)(SWIG_As_unsigned_SS_char(obj1)); 4055 if (SWIG_arg_fail(2)) SWIG_fail; 4056 } 4057 { 4058 arg3 = (uint16_t)(SWIG_As_unsigned_SS_short(obj2)); 4059 if (SWIG_arg_fail(3)) SWIG_fail; 4060 } 4061 { 4062 arg4 = (uint16_t)(SWIG_As_unsigned_SS_short(obj3)); 4063 if (SWIG_arg_fail(4)) SWIG_fail; 4064 } 3044 4065 result = (uint8_t)libtrace_packet_t_trace_get_server_port(arg1,arg2,arg3,arg4); 3045 4066 3046 resultobj = SWIG_From_unsigned_SS_char((unsigned char)result); 4067 { 4068 resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result)); 4069 } 3047 4070 return resultobj; 3048 4071 fail: … … 3059 4082 } 3060 4083 static PyObject *_wrap_new_Filter(PyObject *self, PyObject *args) { 3061 PyObject *resultobj ;3062 char *arg1 ;4084 PyObject *resultobj = NULL; 4085 char *arg1 = (char *) 0 ; 3063 4086 struct libtrace_filter_t *result; 3064 4087 PyObject * obj0 = 0 ; 3065 4088 3066 4089 if(!PyArg_ParseTuple(args,(char *)"O:new_Filter",&obj0)) goto fail; 3067 if (!SWIG_AsCharPtr(obj0, (char**)&arg1)) SWIG_fail; 4090 if (!SWIG_AsCharPtr(obj0, (char**)&arg1)) { 4091 SWIG_arg_fail(1);SWIG_fail; 4092 } 3068 4093 result = (struct libtrace_filter_t *)new_libtrace_filter_t(arg1); 3069 4094 … … 3075 4100 3076 4101 3077 static PyObject *_wrap_Filter_trace_bpf_filter(PyObject *self, PyObject *args) { 3078 PyObject *resultobj; 4102 static PyObject *_wrap_delete_Filter(PyObject *self, PyObject *args) { 4103 PyObject *resultobj = NULL; 4104 struct libtrace_filter_t *arg1 = (struct libtrace_filter_t *) 0 ; 4105 PyObject * obj0 = 0 ; 4106 4107 if(!PyArg_ParseTuple(args,(char *)"O:delete_Filter",&obj0)) goto fail; 4108 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_filter_t, SWIG_POINTER_EXCEPTION | 0); 4109 if (SWIG_arg_fail(1)) SWIG_fail; 4110 delete_libtrace_filter_t(arg1); 4111 4112 Py_INCREF(Py_None); resultobj = Py_None; 4113 return resultobj; 4114 fail: 4115 return NULL; 4116 } 4117 4118 4119 static PyObject *_wrap_Filter_trace_apply_filter(PyObject *self, PyObject *args) { 4120 PyObject *resultobj = NULL; 3079 4121 struct libtrace_filter_t *arg1 = (struct libtrace_filter_t *) 0 ; 3080 4122 struct libtrace_packet_t *arg2 = (struct libtrace_packet_t *) 0 ; … … 3083 4125 PyObject * obj1 = 0 ; 3084 4126 3085 if(!PyArg_ParseTuple(args,(char *)"OO:Filter_trace_bpf_filter",&obj0,&obj1)) goto fail; 3086 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_filter_t, 3087 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 3088 if ((SWIG_ConvertPtr(obj1,(void **)(&arg2),SWIGTYPE_p_libtrace_packet_t, 3089 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; 3090 result = (int)libtrace_filter_t_trace_bpf_filter(arg1,arg2); 3091 3092 resultobj = SWIG_From_int((int)result); 4127 if(!PyArg_ParseTuple(args,(char *)"OO:Filter_trace_apply_filter",&obj0,&obj1)) goto fail; 4128 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_filter_t, SWIG_POINTER_EXCEPTION | 0); 4129 if (SWIG_arg_fail(1)) SWIG_fail; 4130 SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 4131 if (SWIG_arg_fail(2)) SWIG_fail; 4132 result = (int)libtrace_filter_t_trace_apply_filter(arg1,arg2); 4133 4134 { 4135 resultobj = SWIG_From_int((int)(result)); 4136 } 3093 4137 return resultobj; 3094 4138 fail: … … 3105 4149 } 3106 4150 static PyObject *_wrap_new_Trace(PyObject *self, PyObject *args) { 3107 PyObject *resultobj ;3108 char *arg1 ;4151 PyObject *resultobj = NULL; 4152 char *arg1 = (char *) 0 ; 3109 4153 struct libtrace_t *result; 3110 4154 PyObject * obj0 = 0 ; 3111 4155 3112 4156 if(!PyArg_ParseTuple(args,(char *)"O:new_Trace",&obj0)) goto fail; 3113 if (!SWIG_AsCharPtr(obj0, (char**)&arg1)) SWIG_fail; 4157 if (!SWIG_AsCharPtr(obj0, (char**)&arg1)) { 4158 SWIG_arg_fail(1);SWIG_fail; 4159 } 3114 4160 result = (struct libtrace_t *)new_libtrace_t(arg1); 3115 4161 … … 3122 4168 3123 4169 static PyObject *_wrap_delete_Trace(PyObject *self, PyObject *args) { 3124 PyObject *resultobj ;4170 PyObject *resultobj = NULL; 3125 4171 struct libtrace_t *arg1 = (struct libtrace_t *) 0 ; 3126 4172 PyObject * obj0 = 0 ; 3127 4173 3128 4174 if(!PyArg_ParseTuple(args,(char *)"O:delete_Trace",&obj0)) goto fail; 3129 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_t,3130 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;4175 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_t, SWIG_POINTER_EXCEPTION | 0); 4176 if (SWIG_arg_fail(1)) SWIG_fail; 3131 4177 delete_libtrace_t(arg1); 3132 4178 … … 3139 4185 3140 4186 static PyObject *_wrap_Trace_trace_read_packet(PyObject *self, PyObject *args) { 3141 PyObject *resultobj ;4187 PyObject *resultobj = NULL; 3142 4188 struct libtrace_t *arg1 = (struct libtrace_t *) 0 ; 3143 4189 struct libtrace_packet_t *arg2 = (struct libtrace_packet_t *) 0 ; … … 3147 4193 3148 4194 if(!PyArg_ParseTuple(args,(char *)"OO:Trace_trace_read_packet",&obj0,&obj1)) goto fail; 3149 if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_libtrace_t,3150 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;3151 if ((SWIG_ConvertPtr(obj1,(void **)(&arg2),SWIGTYPE_p_libtrace_packet_t,3152 SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;4195 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_t, SWIG_POINTER_EXCEPTION | 0); 4196 if (SWIG_arg_fail(1)) SWIG_fail; 4197 SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 4198 if (SWIG_arg_fail(2)) SWIG_fail; 3153 4199 result = (int)libtrace_t_trace_read_packet(arg1,arg2); 3154 4200 3155 resultobj = SWIG_From_int((int)result); 4201 { 4202 resultobj = SWIG_From_int((int)(result)); 4203 } 4204 return resultobj; 4205 fail: 4206 return NULL; 4207 } 4208 4209 4210 static PyObject *_wrap_Trace_trace_start(PyObject *self, PyObject *args) { 4211 PyObject *resultobj = NULL; 4212 struct libtrace_t *arg1 = (struct libtrace_t *) 0 ; 4213 int result; 4214 PyObject * obj0 = 0 ; 4215 4216 if(!PyArg_ParseTuple(args,(char *)"O:Trace_trace_start",&obj0)) goto fail; 4217 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_t, SWIG_POINTER_EXCEPTION | 0); 4218 if (SWIG_arg_fail(1)) SWIG_fail; 4219 result = (int)libtrace_t_trace_start(arg1); 4220 4221 { 4222 resultobj = SWIG_From_int((int)(result)); 4223 } 4224 return resultobj; 4225 fail: 4226 return NULL; 4227 } 4228 4229 4230 static PyObject *_wrap_Trace_trace_pause(PyObject *self, PyObject *args) { 4231 PyObject *resultobj = NULL; 4232 struct libtrace_t *arg1 = (struct libtrace_t *) 0 ; 4233 int result; 4234 PyObject * obj0 = 0 ; 4235 4236 if(!PyArg_ParseTuple(args,(char *)"O:Trace_trace_pause",&obj0)) goto fail; 4237 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_t, SWIG_POINTER_EXCEPTION | 0); 4238 if (SWIG_arg_fail(1)) SWIG_fail; 4239 result = (int)libtrace_t_trace_pause(arg1); 4240 4241 { 4242 resultobj = SWIG_From_int((int)(result)); 4243 } 4244 return resultobj; 4245 fail: 4246 return NULL; 4247 } 4248 4249 4250 static PyObject *_wrap_Trace_trace_help(PyObject *self, PyObject *args) { 4251 PyObject *resultobj = NULL; 4252 struct libtrace_t *arg1 = (struct libtrace_t *) 0 ; 4253 PyObject * obj0 = 0 ; 4254 4255 if(!PyArg_ParseTuple(args,(char *)"O:Trace_trace_help",&obj0)) goto fail; 4256 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_t, SWIG_POINTER_EXCEPTION | 0); 4257 if (SWIG_arg_fail(1)) SWIG_fail; 4258 libtrace_t_trace_help(arg1); 4259 4260 Py_INCREF(Py_None); resultobj = Py_None; 4261 return resultobj; 4262 fail: 4263 return NULL; 4264 } 4265 4266 4267 static PyObject *_wrap_Trace_trace_config(PyObject *self, PyObject *args) { 4268 PyObject *resultobj = NULL; 4269 struct libtrace_t *arg1 = (struct libtrace_t *) 0 ; 4270 trace_option_t arg2 ; 4271 void *arg3 = (void *) 0 ; 4272 int result; 4273 PyObject * obj0 = 0 ; 4274 PyObject * obj1 = 0 ; 4275 PyObject * obj2 = 0 ; 4276 4277 if(!PyArg_ParseTuple(args,(char *)"OOO:Trace_trace_config",&obj0,&obj1,&obj2)) goto fail; 4278 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_t, SWIG_POINTER_EXCEPTION | 0); 4279 if (SWIG_arg_fail(1)) SWIG_fail; 4280 { 4281 trace_option_t * argp; 4282 SWIG_Python_ConvertPtr(obj1, (void **)&argp, SWIGTYPE_p_trace_option_t, SWIG_POINTER_EXCEPTION); 4283 if (SWIG_arg_fail(2)) SWIG_fail; 4284 if (argp == NULL) { 4285 SWIG_null_ref("trace_option_t"); 4286 } 4287 if (SWIG_arg_fail(2)) SWIG_fail; 4288 arg2 = *argp; 4289 } 4290 { 4291 if ((SWIG_ConvertPtr(obj2,(void **)(&arg3),0,SWIG_POINTER_EXCEPTION|0))== -1) { 4292 SWIG_arg_fail(3);SWIG_fail; 4293 } 4294 } 4295 result = (int)libtrace_t_trace_config(arg1,arg2,arg3); 4296 4297 { 4298 resultobj = SWIG_From_int((int)(result)); 4299 } 4300 return resultobj; 4301 fail: 4302 return NULL; 4303 } 4304 4305 4306 static PyObject *_wrap_Trace_trace_get_err(PyObject *self, PyObject *args) { 4307 PyObject *resultobj = NULL; 4308 struct libtrace_t *arg1 = (struct libtrace_t *) 0 ; 4309 libtrace_err_t result; 4310 PyObject * obj0 = 0 ; 4311 4312 if(!PyArg_ParseTuple(args,(char *)"O:Trace_trace_get_err",&obj0)) goto fail; 4313 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_t, SWIG_POINTER_EXCEPTION | 0); 4314 if (SWIG_arg_fail(1)) SWIG_fail; 4315 result = libtrace_t_trace_get_err(arg1); 4316 4317 { 4318 libtrace_err_t * resultptr; 4319 resultptr = (libtrace_err_t *) malloc(sizeof(libtrace_err_t)); 4320 if (resultptr) memcpy(resultptr, &result, sizeof(libtrace_err_t)); 4321 resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_libtrace_err_t, 1); 4322 } 4323 return resultobj; 4324 fail: 4325 return NULL; 4326 } 4327 4328 4329 static PyObject *_wrap_Trace_trace_is_err(PyObject *self, PyObject *args) { 4330 PyObject *resultobj = NULL; 4331 struct libtrace_t *arg1 = (struct libtrace_t *) 0 ; 4332 bool result; 4333 PyObject * obj0 = 0 ; 4334 4335 if(!PyArg_ParseTuple(args,(char *)"O:Trace_trace_is_err",&obj0)) goto fail; 4336 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_t, SWIG_POINTER_EXCEPTION | 0); 4337 if (SWIG_arg_fail(1)) SWIG_fail; 4338 result = (bool)libtrace_t_trace_is_err(arg1); 4339 4340 { 4341 resultobj = SWIG_From_bool((bool)(result)); 4342 } 3156 4343 return resultobj; 3157 4344 fail: … … 3167 4354 return Py_BuildValue((char *)""); 3168 4355 } 4356 static PyObject *_wrap_new_OutputTrace(PyObject *self, PyObject *args) { 4357 PyObject *resultobj = NULL; 4358 char *arg1 = (char *) 0 ; 4359 struct libtrace_out_t *result; 4360 PyObject * obj0 = 0 ; 4361 4362 if(!PyArg_ParseTuple(args,(char *)"O:new_OutputTrace",&obj0)) goto fail; 4363 if (!SWIG_AsCharPtr(obj0, (char**)&arg1)) { 4364 SWIG_arg_fail(1);SWIG_fail; 4365 } 4366 result = (struct libtrace_out_t *)new_libtrace_out_t(arg1); 4367 4368 resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_libtrace_out_t, 1); 4369 return resultobj; 4370 fail: 4371 return NULL; 4372 } 4373 4374 4375 static PyObject *_wrap_delete_OutputTrace(PyObject *self, PyObject *args) { 4376 PyObject *resultobj = NULL; 4377 struct libtrace_out_t *arg1 = (struct libtrace_out_t *) 0 ; 4378 PyObject * obj0 = 0 ; 4379 4380 if(!PyArg_ParseTuple(args,(char *)"O:delete_OutputTrace",&obj0)) goto fail; 4381 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_out_t, SWIG_POINTER_EXCEPTION | 0); 4382 if (SWIG_arg_fail(1)) SWIG_fail; 4383 delete_libtrace_out_t(arg1); 4384 4385 Py_INCREF(Py_None); resultobj = Py_None; 4386 return resultobj; 4387 fail: 4388 return NULL; 4389 } 4390 4391 4392 static PyObject *_wrap_OutputTrace_trace_start_output(PyObject *self, PyObject *args) { 4393 PyObject *resultobj = NULL; 4394 struct libtrace_out_t *arg1 = (struct libtrace_out_t *) 0 ; 4395 int result; 4396 PyObject * obj0 = 0 ; 4397 4398 if(!PyArg_ParseTuple(args,(char *)"O:OutputTrace_trace_start_output",&obj0)) goto fail; 4399 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_out_t, SWIG_POINTER_EXCEPTION | 0); 4400 if (SWIG_arg_fail(1)) SWIG_fail; 4401 result = (int)libtrace_out_t_trace_start_output(arg1); 4402 4403 { 4404 resultobj = SWIG_From_int((int)(result)); 4405 } 4406 return resultobj; 4407 fail: 4408 return NULL; 4409 } 4410 4411 4412 static PyObject *_wrap_OutputTrace_trace_config_output(PyObject *self, PyObject *args) { 4413 PyObject *resultobj = NULL; 4414 struct libtrace_out_t *arg1 = (struct libtrace_out_t *) 0 ; 4415 trace_option_output_t arg2 ; 4416 void *arg3 = (void *) 0 ; 4417 int result; 4418 PyObject * obj0 = 0 ; 4419 PyObject * obj1 = 0 ; 4420 PyObject * obj2 = 0 ; 4421 4422 if(!PyArg_ParseTuple(args,(char *)"OOO:OutputTrace_trace_config_output",&obj0,&obj1,&obj2)) goto fail; 4423 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_out_t, SWIG_POINTER_EXCEPTION | 0); 4424 if (SWIG_arg_fail(1)) SWIG_fail; 4425 { 4426 trace_option_output_t * argp; 4427 SWIG_Python_ConvertPtr(obj1, (void **)&argp, SWIGTYPE_p_trace_option_output_t, SWIG_POINTER_EXCEPTION); 4428 if (SWIG_arg_fail(2)) SWIG_fail; 4429 if (argp == NULL) { 4430 SWIG_null_ref("trace_option_output_t"); 4431 } 4432 if (SWIG_arg_fail(2)) SWIG_fail; 4433 arg2 = *argp; 4434 } 4435 { 4436 if ((SWIG_ConvertPtr(obj2,(void **)(&arg3),0,SWIG_POINTER_EXCEPTION|0))== -1) { 4437 SWIG_arg_fail(3);SWIG_fail; 4438 } 4439 } 4440 result = (int)libtrace_out_t_trace_config_output(arg1,arg2,arg3); 4441 4442 { 4443 resultobj = SWIG_From_int((int)(result)); 4444 } 4445 return resultobj; 4446 fail: 4447 return NULL; 4448 } 4449 4450 4451 static PyObject *_wrap_OutputTrace_trace_get_err_output(PyObject *self, PyObject *args) { 4452 PyObject *resultobj = NULL; 4453 struct libtrace_out_t *arg1 = (struct libtrace_out_t *) 0 ; 4454 libtrace_err_t result; 4455 PyObject * obj0 = 0 ; 4456 4457 if(!PyArg_ParseTuple(args,(char *)"O:OutputTrace_trace_get_err_output",&obj0)) goto fail; 4458 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_out_t, SWIG_POINTER_EXCEPTION | 0); 4459 if (SWIG_arg_fail(1)) SWIG_fail; 4460 result = libtrace_out_t_trace_get_err_output(arg1); 4461 4462 { 4463 libtrace_err_t * resultptr; 4464 resultptr = (libtrace_err_t *) malloc(sizeof(libtrace_err_t)); 4465 if (resultptr) memcpy(resultptr, &result, sizeof(libtrace_err_t)); 4466 resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_libtrace_err_t, 1); 4467 } 4468 return resultobj; 4469 fail: 4470 return NULL; 4471 } 4472 4473 4474 static PyObject *_wrap_OutputTrace_trace_is_err_output(PyObject *self, PyObject *args) { 4475 PyObject *resultobj = NULL; 4476 struct libtrace_out_t *arg1 = (struct libtrace_out_t *) 0 ; 4477 bool result; 4478 PyObject * obj0 = 0 ; 4479 4480 if(!PyArg_ParseTuple(args,(char *)"O:OutputTrace_trace_is_err_output",&obj0)) goto fail; 4481 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_out_t, SWIG_POINTER_EXCEPTION | 0); 4482 if (SWIG_arg_fail(1)) SWIG_fail; 4483 result = (bool)libtrace_out_t_trace_is_err_output(arg1); 4484 4485 { 4486 resultobj = SWIG_From_bool((bool)(result)); 4487 } 4488 return resultobj; 4489 fail: 4490 return NULL; 4491 } 4492 4493 4494 static PyObject *_wrap_OutputTrace_trace_write_packet(PyObject *self, PyObject *args) { 4495 PyObject *resultobj = NULL; 4496 struct libtrace_out_t *arg1 = (struct libtrace_out_t *) 0 ; 4497 libtrace_packet_t *arg2 = (libtrace_packet_t *) 0 ; 4498 int result; 4499 PyObject * obj0 = 0 ; 4500 PyObject * obj1 = 0 ; 4501 4502 if(!PyArg_ParseTuple(args,(char *)"OO:OutputTrace_trace_write_packet",&obj0,&obj1)) goto fail; 4503 SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_libtrace_out_t, SWIG_POINTER_EXCEPTION | 0); 4504 if (SWIG_arg_fail(1)) SWIG_fail; 4505 SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_libtrace_packet_t, SWIG_POINTER_EXCEPTION | 0); 4506 if (SWIG_arg_fail(2)) SWIG_fail; 4507 result = (int)libtrace_out_t_trace_write_packet(arg1,arg2); 4508 4509 { 4510 resultobj = SWIG_From_int((int)(result)); 4511 } 4512 return resultobj; 4513 fail: 4514 return NULL; 4515 } 4516 4517 4518 static PyObject * OutputTrace_swigregister(PyObject *self, PyObject *args) { 4519 PyObject *obj; 4520 if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; 4521 SWIG_TypeClientData(SWIGTYPE_p_libtrace_out_t, obj); 4522 Py_INCREF(obj); 4523 return Py_BuildValue((char *)""); 4524 } 3169 4525 static PyMethodDef SwigMethods[] = { 3170 { (char *)"in_addr_s_addr_set", _wrap_in_addr_s_addr_set, METH_VARARGS, NULL }, 3171 { (char *)"in_addr_s_addr_get", _wrap_in_addr_s_addr_get, METH_VARARGS, NULL }, 3172 { (char *)"in_addr_swigregister", in_addr_swigregister, METH_VARARGS, NULL }, 3173 { (char *)"libtrace_ip_ip_hl_set", _wrap_libtrace_ip_ip_hl_set, METH_VARARGS, NULL }, 3174 { (char *)"libtrace_ip_ip_hl_get", _wrap_libtrace_ip_ip_hl_get, METH_VARARGS, NULL }, 3175 { (char *)"libtrace_ip_ip_v_set", _wrap_libtrace_ip_ip_v_set, METH_VARARGS, NULL }, 3176 { (char *)"libtrace_ip_ip_v_get", _wrap_libtrace_ip_ip_v_get, METH_VARARGS, NULL }, 3177 { (char *)"libtrace_ip_ip_tos_set", _wrap_libtrace_ip_ip_tos_set, METH_VARARGS, NULL }, 3178 { (char *)"libtrace_ip_ip_tos_get", _wrap_libtrace_ip_ip_tos_get, METH_VARARGS, NULL }, 3179 { (char *)"libtrace_ip_ip_ttl_set", _wrap_libtrace_ip_ip_ttl_set, METH_VARARGS, NULL }, 3180 { (char *)"libtrace_ip_ip_ttl_get", _wrap_libtrace_ip_ip_ttl_get, METH_VARARGS, NULL }, 3181 { (char *)"libtrace_ip_ip_p_set", _wrap_libtrace_ip_ip_p_set, METH_VARARGS, NULL }, 3182 { (char *)"libtrace_ip_ip_p_get", _wrap_libtrace_ip_ip_p_get, METH_VARARGS, NULL }, 3183 { (char *)"libtrace_ip_ip_sum_get", _wrap_libtrace_ip_ip_sum_get, METH_VARARGS, NULL }, 3184 { (char *)"libtrace_ip_ip_len_get", _wrap_libtrace_ip_ip_len_get, METH_VARARGS, NULL }, 3185 { (char *)"libtrace_ip_ip_id_get", _wrap_libtrace_ip_ip_id_get, METH_VARARGS, NULL }, 3186 { (char *)"libtrace_ip_ip_off_get", _wrap_libtrace_ip_ip_off_get, METH_VARARGS, NULL }, 3187 { (char *)"libtrace_ip_ip_src_get", _wrap_libtrace_ip_ip_src_get, METH_VARARGS, NULL }, 3188 { (char *)"libtrace_ip_ip_dst_get", _wrap_libtrace_ip_ip_dst_get, METH_VARARGS, NULL }, 3189 { (char *)"libtrace_ip_swigregister", libtrace_ip_swigregister, METH_VARARGS, NULL }, 3190 { (char *)"libtrace_tcp_res1_set", _wrap_libtrace_tcp_res1_set, METH_VARARGS, NULL }, 3191 { (char *)"libtrace_tcp_res1_get", _wrap_libtrace_tcp_res1_get, METH_VARARGS, NULL }, 3192 { (char *)"libtrace_tcp_doff_set", _wrap_libtrace_tcp_doff_set, METH_VARARGS, NULL }, 3193 { (char *)"libtrace_tcp_doff_get", _wrap_libtrace_tcp_doff_get, METH_VARARGS, NULL }, 3194 { (char *)"libtrace_tcp_fin_set", _wrap_libtrace_tcp_fin_set, METH_VARARGS, NULL }, 3195 { (char *)"libtrace_tcp_fin_get", _wrap_libtrace_tcp_fin_get, METH_VARARGS, NULL }, 3196 { (char *)"libtrace_tcp_syn_set", _wrap_libtrace_tcp_syn_set, METH_VARARGS, NULL }, 3197 { (char *)"libtrace_tcp_syn_get", _wrap_libtrace_tcp_syn_get, METH_VARARGS, NULL }, 3198 { (char *)"libtrace_tcp_rst_set", _wrap_libtrace_tcp_rst_set, METH_VARARGS, NULL }, 3199 { (char *)"libtrace_tcp_rst_get", _wrap_libtrace_tcp_rst_get, METH_VARARGS, NULL }, 3200 { (char *)"libtrace_tcp_psh_set", _wrap_libtrace_tcp_psh_set, METH_VARARGS, NULL }, 3201 { (char *)"libtrace_tcp_psh_get", _wrap_libtrace_tcp_psh_get, METH_VARARGS, NULL }, 3202 { (char *)"libtrace_tcp_ack_set", _wrap_libtrace_tcp_ack_set, METH_VARARGS, NULL }, 3203 { (char *)"libtrace_tcp_ack_get", _wrap_libtrace_tcp_ack_get, METH_VARARGS, NULL }, 3204 { (char *)"libtrace_tcp_urg_set", _wrap_libtrace_tcp_urg_set, METH_VARARGS, NULL }, 3205 { (char *)"libtrace_tcp_urg_get", _wrap_libtrace_tcp_urg_get, METH_VARARGS, NULL }, 3206 { (char *)"libtrace_tcp_res2_set", _wrap_libtrace_tcp_res2_set, METH_VARARGS, NULL }, 3207 { (char *)"libtrace_tcp_res2_get", _wrap_libtrace_tcp_res2_get, METH_VARARGS, NULL }, 3208 { (char *)"libtrace_tcp_source_get", _wrap_libtrace_tcp_source_get, METH_VARARGS, NULL }, 3209 { (char *)"libtrace_tcp_dest_get", _wrap_libtrace_tcp_dest_get, METH_VARARGS, NULL }, 3210 { (char *)"libtrace_tcp_window_get", _wrap_libtrace_tcp_window_get, METH_VARARGS, NULL }, 3211 { (char *)"libtrace_tcp_check_get", _wrap_libtrace_tcp_check_get, METH_VARARGS, NULL }, 3212 { (char *)"libtrace_tcp_urg_ptr_get", _wrap_libtrace_tcp_urg_ptr_get, METH_VARARGS, NULL }, 3213 { (char *)"libtrace_tcp_seq_get", _wrap_libtrace_tcp_seq_get, METH_VARARGS, NULL }, 3214 { (char *)"libtrace_tcp_ack_seq_get", _wrap_libtrace_tcp_ack_seq_get, METH_VARARGS, NULL }, 3215 { (char *)"libtrace_tcp_swigregister", libtrace_tcp_swigregister, METH_VARARGS, NULL }, 3216 { (char *)"libtrace_udp_source_get", _wrap_libtrace_udp_source_get, METH_VARARGS, NULL }, 3217 { (char *)"libtrace_udp_dest_get", _wrap_libtrace_udp_dest_get, METH_VARARGS, NULL }, 3218 { (char *)"libtrace_udp_len_get", _wrap_libtrace_udp_len_get, METH_VARARGS, NULL }, 3219 { (char *)"libtrace_udp_check_get", _wrap_libtrace_udp_check_get, METH_VARARGS, NULL }, 3220 { (char *)"libtrace_udp_swigregister", libtrace_udp_swigregister, METH_VARARGS, NULL }, 3221 { (char *)"libtrace_icmp_type_set", _wrap_libtrace_icmp_type_set, METH_VARARGS, NULL }, 3222 { (char *)"libtrace_icmp_type_get", _wrap_libtrace_icmp_type_get, METH_VARARGS, NULL }, 3223 { (char *)"libtrace_icmp_code_set", _wrap_libtrace_icmp_code_set, METH_VARARGS, NULL }, 3224 { (char *)"libtrace_icmp_code_get", _wrap_libtrace_icmp_code_get, METH_VARARGS, NULL }, 3225 { (char *)"libtrace_icmp_checksum_set", _wrap_libtrace_icmp_checksum_set, METH_VARARGS, NULL }, 3226 { (char *)"libtrace_icmp_checksum_get", _wrap_libtrace_icmp_checksum_get, METH_VARARGS, NULL }, 3227 { (char *)"libtrace_icmp_un_get", _wrap_libtrace_icmp_un_get, METH_VARARGS, NULL }, 3228 { (char *)"libtrace_icmp_swigregister", libtrace_icmp_swigregister, METH_VARARGS, NULL }, 3229 { (char *)"libtrace_icmp_un_gateway_set", _wrap_libtrace_icmp_un_gateway_set, METH_VARARGS, NULL }, 3230 { (char *)"libtrace_icmp_un_gateway_get", _wrap_libtrace_icmp_un_gateway_get, METH_VARARGS, NULL }, 3231 { (char *)"libtrace_icmp_un_frag_get", _wrap_libtrace_icmp_un_frag_get, METH_VARARGS, NULL }, 3232 { (char *)"libtrace_icmp_un_echo_get", _wrap_libtrace_icmp_un_echo_get, METH_VARARGS, NULL }, 3233 { (char *)"libtrace_icmp_un_swigregister", libtrace_icmp_un_swigregister, METH_VARARGS, NULL }, 3234 { (char *)"libtrace_icmp_un_frag___unused_set", _wrap_libtrace_icmp_un_frag___unused_set, METH_VARARGS, NULL }, 3235 { (char *)"libtrace_icmp_un_frag___unused_get", _wrap_libtrace_icmp_un_frag___unused_get, METH_VARARGS, NULL }, 3236 { (char *)"libtrace_icmp_un_frag_mtu_set", _wrap_libtrace_icmp_un_frag_mtu_set, METH_VARARGS, NULL }, 3237 { (char *)"libtrace_icmp_un_frag_mtu_get", _wrap_libtrace_icmp_un_frag_mtu_get, METH_VARARGS, NULL }, 3238 { (char *)"libtrace_icmp_un_frag_swigregister", libtrace_icmp_un_frag_swigregister, METH_VARARGS, NULL }, 3239 { (char *)"libtrace_icmp_un_echo_id_set", _wrap_libtrace_icmp_un_echo_id_set, METH_VARARGS, NULL }, 3240 { (char *)"libtrace_icmp_un_echo_id_get", _wrap_libtrace_icmp_un_echo_id_get, METH_VARARGS, NULL }, 3241 { (char *)"libtrace_icmp_un_echo_sequence_set", _wrap_libtrace_icmp_un_echo_sequence_set, METH_VARARGS, NULL }, 3242 { (char *)"libtrace_icmp_un_echo_sequence_get", _wrap_libtrace_icmp_un_echo_sequence_get, METH_VARARGS, NULL }, 3243 { (char *)"libtrace_icmp_un_echo_swigregister", libtrace_icmp_un_echo_swigregister, METH_VARARGS, NULL }, 3244 { (char *)"new_Packet", _wrap_new_Packet, METH_VARARGS, NULL }, 3245 { (char *)"delete_Packet", _wrap_delete_Packet, METH_VARARGS, NULL }, 3246 { (char *)"Packet_trace_get_ip", _wrap_Packet_trace_get_ip, METH_VARARGS, NULL }, 3247 { (char *)"Packet_trace_get_tcp", _wrap_Packet_trace_get_tcp, METH_VARARGS, NULL }, 3248 { (char *)"Packet_trace_get_udp", _wrap_Packet_trace_get_udp, METH_VARARGS, NULL }, 3249 { (char *)"Packet_trace_get_icmp", _wrap_Packet_trace_get_icmp, METH_VARARGS, NULL }, 3250 { (char *)"Packet_trace_get_link", _wrap_Packet_trace_get_link, METH_VARARGS, NULL }, 3251 { (char *)"Packet_trace_get_seconds", _wrap_Packet_trace_get_seconds, METH_VARARGS, NULL }, 3252 { (char *)"Packet_trace_get_erf_timestamp", _wrap_Packet_trace_get_erf_timestamp, METH_VARARGS, NULL }, 3253 { (char *)"Packet_trace_get_timeval", _wrap_Packet_trace_get_timeval, METH_VARARGS, NULL }, 3254 { (char *)"Packet_trace_get_capture_length", _wrap_Packet_trace_get_capture_length, METH_VARARGS, NULL }, 3255 { (char *)"Packet_trace_get_wire_lenth", _wrap_Packet_trace_get_wire_lenth, METH_VARARGS, NULL }, 3256 { (char *)"Packet_trace_get_link_type", _wrap_Packet_trace_get_link_type, METH_VARARGS, NULL }, 3257 { (char *)"Packet_trace_get_direction", _wrap_Packet_trace_get_direction, METH_VARARGS, NULL }, 3258 { (char *)"Packet_trace_set_direction", _wrap_Packet_trace_set_direction, METH_VARARGS, NULL }, 3259 { (char *)"Packet_trace_bpf_filter", _wrap_Packet_trace_bpf_filter, METH_VARARGS, NULL }, 3260 { (char *)"Packet_trace_get_server_port", _wrap_Packet_trace_get_server_port, METH_VARARGS, NULL }, 3261 { (char *)"Packet_swigregister", Packet_swigregister, METH_VARARGS, NULL }, 3262 { (char *)"new_Filter", _wrap_new_Filter, METH_VARARGS, NULL }, 3263 { (char *)"Filter_trace_bpf_filter", _wrap_Filter_trace_bpf_filter, METH_VARARGS, NULL }, 3264 { (char *)"Filter_swigregister", Filter_swigregister, METH_VARARGS, NULL }, 3265 { (char *)"new_Trace", _wrap_new_Trace, METH_VARARGS, NULL }, 3266 { (char *)"delete_Trace", _wrap_delete_Trace, METH_VARARGS, NULL }, 3267 { (char *)"Trace_trace_read_packet", _wrap_Trace_trace_read_packet, METH_VARARGS, NULL }, 3268 { (char *)"Trace_swigregister", Trace_swigregister, METH_VARARGS, NULL }, 4526 { (char *)"in_addr_s_addr_set", _wrap_in_addr_s_addr_set, METH_VARARGS, NULL}, 4527 { (char *)"in_addr_s_addr_get", _wrap_in_addr_s_addr_get, METH_VARARGS, NULL}, 4528 { (char *)"in_addr_swigregister", in_addr_swigregister, METH_VARARGS, NULL}, 4529 { (char *)"libtrace_ip_ip_hl_set", _wrap_libtrace_ip_ip_hl_set, METH_VARARGS, NULL}, 4530 { (char *)"libtrace_ip_ip_hl_get", _wrap_libtrace_ip_ip_hl_get, METH_VARARGS, NULL}, 4531 { (char *)"libtrace_ip_ip_v_set", _wrap_libtrace_ip_ip_v_set, METH_VARARGS, NULL}, 4532 { (char *)"libtrace_ip_ip_v_get", _wrap_libtrace_ip_ip_v_get, METH_VARARGS, NULL}, 4533 { (char *)"libtrace_ip_ip_tos_set", _wrap_libtrace_ip_ip_tos_set, METH_VARARGS, NULL}, 4534 { (char *)"libtrace_ip_ip_tos_get", _wrap_libtrace_ip_ip_tos_get, METH_VARARGS, NULL}, 4535 { (char *)"libtrace_ip_ip_ttl_set", _wrap_libtrace_ip_ip_ttl_set, METH_VARARGS, NULL}, 4536 { (char *)"libtrace_ip_ip_ttl_get", _wrap_libtrace_ip_ip_ttl_get, METH_VARARGS, NULL}, 4537 { (char *)"libtrace_ip_ip_p_set", _wrap_libtrace_ip_ip_p_set, METH_VARARGS, NULL}, 4538 { (char *)"libtrace_ip_ip_p_get", _wrap_libtrace_ip_ip_p_get, METH_VARARGS, NULL}, 4539 { (char *)"libtrace_ip_ip_sum_get", _wrap_libtrace_ip_ip_sum_get, METH_VARARGS, NULL}, 4540 { (char *)"libtrace_ip_ip_len_get", _wrap_libtrace_ip_ip_len_get, METH_VARARGS, NULL}, 4541 { (char *)"libtrace_ip_ip_id_get", _wrap_libtrace_ip_ip_id_get, METH_VARARGS, NULL}, 4542 { (char *)"libtrace_ip_ip_off_get", _wrap_libtrace_ip_ip_off_get, METH_VARARGS, NULL}, 4543 { (char *)"libtrace_ip_ip_src_get", _wrap_libtrace_ip_ip_src_get, METH_VARARGS, NULL}, 4544 { (char *)"libtrace_ip_ip_dst_get", _wrap_libtrace_ip_ip_dst_get, METH_VARARGS, NULL}, 4545 { (char *)"libtrace_ip_swigregister", libtrace_ip_swigregister, METH_VARARGS, NULL}, 4546 { (char *)"libtrace_tcp_res1_set", _wrap_libtrace_tcp_res1_set, METH_VARARGS, NULL}, 4547 { (char *)"libtrace_tcp_res1_get", _wrap_libtrace_tcp_res1_get, METH_VARARGS, NULL}, 4548 { (char *)"libtrace_tcp_doff_set", _wrap_libtrace_tcp_doff_set, METH_VARARGS, NULL}, 4549 { (char *)"libtrace_tcp_doff_get", _wrap_libtrace_tcp_doff_get, METH_VARARGS, NULL}, 4550 { (char *)"libtrace_tcp_fin_set", _wrap_libtrace_tcp_fin_set, METH_VARARGS, NULL}, 4551 { (char *)"libtrace_tcp_fin_get", _wrap_libtrace_tcp_fin_get, METH_VARARGS, NULL}, 4552 { (char *)"libtrace_tcp_syn_set", _wrap_libtrace_tcp_syn_set, METH_VARARGS, NULL}, 4553 { (char *)"libtrace_tcp_syn_get", _wrap_libtrace_tcp_syn_get, METH_VARARGS, NULL}, 4554 { (char *)"libtrace_tcp_rst_set", _wrap_libtrace_tcp_rst_set, METH_VARARGS, NULL}, 4555 { (char *)"libtrace_tcp_rst_get", _wrap_libtrace_tcp_rst_get, METH_VARARGS, NULL}, 4556 { (char *)"libtrace_tcp_psh_set", _wrap_libtrace_tcp_psh_set, METH_VARARGS, NULL}, 4557 { (char *)"libtrace_tcp_psh_get", _wrap_libtrace_tcp_psh_get, METH_VARARGS, NULL}, 4558 { (char *)"libtrace_tcp_ack_set", _wrap_libtrace_tcp_ack_set, METH_VARARGS, NULL}, 4559 { (char *)"libtrace_tcp_ack_get", _wrap_libtrace_tcp_ack_get, METH_VARARGS, NULL}, 4560 { (char *)"libtrace_tcp_urg_set", _wrap_libtrace_tcp_urg_set, METH_VARARGS, NULL}, 4561 { (char *)"libtrace_tcp_urg_get", _wrap_libtrace_tcp_urg_get, METH_VARARGS, NULL}, 4562 { (char *)"libtrace_tcp_res2_set", _wrap_libtrace_tcp_res2_set, METH_VARARGS, NULL}, 4563 { (char *)"libtrace_tcp_res2_get", _wrap_libtrace_tcp_res2_get, METH_VARARGS, NULL}, 4564 { (char *)"libtrace_tcp_source_get", _wrap_libtrace_tcp_source_get, METH_VARARGS, NULL}, 4565 { (char *)"libtrace_tcp_dest_get", _wrap_libtrace_tcp_dest_get, METH_VARARGS, NULL}, 4566 { (char *)"libtrace_tcp_window_get", _wrap_libtrace_tcp_window_get, METH_VARARGS, NULL}, 4567 { (char *)"libtrace_tcp_check_get", _wrap_libtrace_tcp_check_get, METH_VARARGS, NULL}, 4568 { (char *)"libtrace_tcp_urg_ptr_get", _wrap_libtrace_tcp_urg_ptr_get, METH_VARARGS, NULL}, 4569 { (char *)"libtrace_tcp_seq_get", _wrap_libtrace_tcp_seq_get, METH_VARARGS, NULL}, 4570 { (char *)"libtrace_tcp_ack_seq_get", _wrap_libtrace_tcp_ack_seq_get, METH_VARARGS, NULL}, 4571 { (char *)"libtrace_tcp_swigregister", libtrace_tcp_swigregister, METH_VARARGS, NULL}, 4572 { (char *)"libtrace_udp_source_get", _wrap_libtrace_udp_source_get, METH_VARARGS, NULL}, 4573 { (char *)"libtrace_udp_dest_get", _wrap_libtrace_udp_dest_get, METH_VARARGS, NULL}, 4574 { (char *)"libtrace_udp_len_get", _wrap_libtrace_udp_len_get, METH_VARARGS, NULL}, 4575 { (char *)"libtrace_udp_check_get", _wrap_libtrace_udp_check_get, METH_VARARGS, NULL}, 4576 { (char *)"libtrace_udp_swigregister", libtrace_udp_swigregister, METH_VARARGS, NULL}, 4577 { (char *)"libtrace_icmp_type_set", _wrap_libtrace_icmp_type_set, METH_VARARGS, NULL}, 4578 { (char *)"libtrace_icmp_type_get", _wrap_libtrace_icmp_type_get, METH_VARARGS, NULL}, 4579 { (char *)"libtrace_icmp_code_set", _wrap_libtrace_icmp_code_set, METH_VARARGS, NULL}, 4580 { (char *)"libtrace_icmp_code_get", _wrap_libtrace_icmp_code_get, METH_VARARGS, NULL}, 4581 { (char *)"libtrace_icmp_checksum_set", _wrap_libtrace_icmp_checksum_set, METH_VARARGS, NULL}, 4582 { (char *)"libtrace_icmp_checksum_get", _wrap_libtrace_icmp_checksum_get, METH_VARARGS, NULL}, 4583 { (char *)"libtrace_icmp_un_get", _wrap_libtrace_icmp_un_get, METH_VARARGS, NULL}, 4584 { (char *)"libtrace_icmp_swigregister", libtrace_icmp_swigregister, METH_VARARGS, NULL}, 4585 { (char *)"libtrace_icmp_un_gateway_set", _wrap_libtrace_icmp_un_gateway_set, METH_VARARGS, NULL}, 4586 { (char *)"libtrace_icmp_un_gateway_get", _wrap_libtrace_icmp_un_gateway_get, METH_VARARGS, NULL}, 4587 { (char *)"libtrace_icmp_un_frag_get", _wrap_libtrace_icmp_un_frag_get, METH_VARARGS, NULL}, 4588 { (char *)"libtrace_icmp_un_echo_get", _wrap_libtrace_icmp_un_echo_get, METH_VARARGS, NULL}, 4589 { (char *)"libtrace_icmp_un_swigregister", libtrace_icmp_un_swigregister, METH_VARARGS, NULL}, 4590 { (char *)"libtrace_icmp_un_frag___unused_set", _wrap_libtrace_icmp_un_frag___unused_set, METH_VARARGS, NULL}, 4591 { (char *)"libtrace_icmp_un_frag___unused_get", _wrap_libtrace_icmp_un_frag___unused_get, METH_VARARGS, NULL}, 4592 { (char *)"libtrace_icmp_un_frag_mtu_set", _wrap_libtrace_icmp_un_frag_mtu_set, METH_VARARGS, NULL}, 4593 { (char *)"libtrace_icmp_un_frag_mtu_get", _wrap_libtrace_icmp_un_frag_mtu_get, METH_VARARGS, NULL}, 4594 { (char *)"libtrace_icmp_un_frag_swigregister", libtrace_icmp_un_frag_swigregister, METH_VARARGS, NULL}, 4595 { (char *)"libtrace_icmp_un_echo_id_set", _wrap_libtrace_icmp_un_echo_id_set, METH_VARARGS, NULL}, 4596 { (char *)"libtrace_icmp_un_echo_id_get", _wrap_libtrace_icmp_un_echo_id_get, METH_VARARGS, NULL}, 4597 { (char *)"libtrace_icmp_un_echo_sequence_set", _wrap_libtrace_icmp_un_echo_sequence_set, METH_VARARGS, NULL}, 4598 { (char *)"libtrace_icmp_un_echo_sequence_get", _wrap_libtrace_icmp_un_echo_sequence_get, METH_VARARGS, NULL}, 4599 { (char *)"libtrace_icmp_un_echo_swigregister", libtrace_icmp_un_echo_swigregister, METH_VARARGS, NULL}, 4600 { (char *)"new_Packet", _wrap_new_Packet, METH_VARARGS, NULL}, 4601 { (char *)"delete_Packet", _wrap_delete_Packet, METH_VARARGS, NULL}, 4602 { (char *)"Packet_trace_copy_packet", _wrap_Packet_trace_copy_packet, METH_VARARGS, NULL}, 4603 { (char *)"Packet_trace_get_link", _wrap_Packet_trace_get_link, METH_VARARGS, NULL}, 4604 { (char *)"Packet_trace_get_transport", _wrap_Packet_trace_get_transport, METH_VARARGS, NULL}, 4605 { (char *)"Packet_trace_get_ip", _wrap_Packet_trace_get_ip, METH_VARARGS, NULL}, 4606 { (char *)"Packet_trace_get_tcp", _wrap_Packet_trace_get_tcp, METH_VARARGS, NULL}, 4607 { (char *)"Packet_trace_get_udp", _wrap_Packet_trace_get_udp, METH_VARARGS, NULL}, 4608 { (char *)"Packet_trace_get_icmp", _wrap_Packet_trace_get_icmp, METH_VARARGS, NULL}, 4609 { (char *)"Packet_trace_get_destination_mac", _wrap_Packet_trace_get_destination_mac, METH_VARARGS, NULL}, 4610 { (char *)"Packet_trace_get_source_mac", _wrap_Packet_trace_get_source_mac, METH_VARARGS, NULL}, 4611 { (char *)"Packet_trace_ether_ntoa", _wrap_Packet_trace_ether_ntoa, METH_VARARGS, NULL}, 4612 { (char *)"Packet_trace_get_source_port", _wrap_Packet_trace_get_source_port, METH_VARARGS, NULL}, 4613 { (char *)"Packet_trace_get_destination_port", _wrap_Packet_trace_get_destination_port, METH_VARARGS, NULL}, 4614 { (char *)"Packet_trace_get_seconds", _wrap_Packet_trace_get_seconds, METH_VARARGS, NULL}, 4615 { (char *)"Packet_trace_get_erf_timestamp", _wrap_Packet_trace_get_erf_timestamp, METH_VARARGS, NULL}, 4616 { (char *)"Packet_trace_get_timeval", _wrap_Packet_trace_get_timeval, METH_VARARGS, NULL}, 4617 { (char *)"Packet_trace_get_capture_length", _wrap_Packet_trace_get_capture_length, METH_VARARGS, NULL}, 4618 { (char *)"Packet_trace_set_capture_length", _wrap_Packet_trace_set_capture_length, METH_VARARGS, NULL}, 4619 { (char *)"Packet_trace_get_wire_lenth", _wrap_Packet_trace_get_wire_lenth, METH_VARARGS, NULL}, 4620 { (char *)"Packet_trace_get_framing_length", _wrap_Packet_trace_get_framing_length, METH_VARARGS, NULL}, 4621 { (char *)"Packet_trace_get_link_type", _wrap_Packet_trace_get_link_type, METH_VARARGS, NULL}, 4622 { (char *)"Packet_trace_get_direction", _wrap_Packet_trace_get_direction, METH_VARARGS, NULL}, 4623 { (char *)"Packet_trace_set_direction", _wrap_Packet_trace_set_direction, METH_VARARGS, NULL}, 4624 { (char *)"Packet_trace_apply_filter", _wrap_Packet_trace_apply_filter, METH_VARARGS, NULL}, 4625 { (char *)"Packet_trace_get_server_port", _wrap_Packet_trace_get_server_port, METH_VARARGS, NULL}, 4626 { (char *)"Packet_swigregister", Packet_swigregister, METH_VARARGS, NULL}, 4627 { (char *)"new_Filter", _wrap_new_Filter, METH_VARARGS, NULL}, 4628 { (char *)"delete_Filter", _wrap_delete_Filter, METH_VARARGS, NULL}, 4629 { (char *)"Filter_trace_apply_filter", _wrap_Filter_trace_apply_filter, METH_VARARGS, NULL}, 4630 { (char *)"Filter_swigregister", Filter_swigregister, METH_VARARGS, NULL}, 4631 { (char *)"new_Trace", _wrap_new_Trace, METH_VARARGS, NULL}, 4632 { (char *)"delete_Trace", _wrap_delete_Trace, METH_VARARGS, NULL}, 4633 { (char *)"Trace_trace_read_packet", _wrap_Trace_trace_read_packet, METH_VARARGS, NULL}, 4634 { (char *)"Trace_trace_start", _wrap_Trace_trace_start, METH_VARARGS, NULL}, 4635 { (char *)"Trace_trace_pause", _wrap_Trace_trace_pause, METH_VARARGS, NULL}, 4636 { (char *)"Trace_trace_help", _wrap_Trace_trace_help, METH_VARARGS, NULL}, 4637 { (char *)"Trace_trace_config", _wrap_Trace_trace_config, METH_VARARGS, NULL}, 4638 { (char *)"Trace_trace_get_err", _wrap_Trace_trace_get_err, METH_VARARGS, NULL}, 4639 { (char *)"Trace_trace_is_err", _wrap_Trace_trace_is_err, METH_VARARGS, NULL}, 4640 { (char *)"Trace_swigregister", Trace_swigregister, METH_VARARGS, NULL}, 4641 &nbs