Changeset 47de0aa for swig/libtrace.i
- Timestamp:
- 06/29/06 21:07:50 (16 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.