Changeset 084d95a
- Timestamp:
- 09/05/05 14:44:41 (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:
- de8c420b
- Parents:
- 03cbfec
- Location:
- lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_erf.c
r03cbfec r084d95a 654 654 payload, 655 655 packet->size - 656 sizeof(dag_record_t));656 (dag_record_size + 2)); 657 657 } else { 658 658 // convert format - build up a new erf header -
lib/libtrace.h
rca87bcd r084d95a 236 236 struct libtrace_t *trace_create(char *uri); 237 237 238 /** Creates a "dummy" trace file that has only the format type set. 239 * 240 * @returns opaque pointer to a (sparsely initialised) libtrace_t 241 * 242 * IMPORTANT: Do not attempt to call trace_read_packet or other such functions with 243 * the dummy trace. Its intended purpose is to act as a packet->trace for libtrace_packet_t's 244 * that are not associated with a libtrace_t structure. 245 */ 246 struct libtrace_t *trace_create_dead(char *uri); 247 238 248 /** Creates a trace output file from a URI. 239 249 * … … 263 273 */ 264 274 void trace_destroy(struct libtrace_t *trace); 275 276 void trace_destroy_dead(struct libtrace_t *trace); 265 277 266 278 /** Close a trace output file, freeing up any resources it may have been using -
lib/trace.c
rb5cd711 r084d95a 308 308 } 309 309 310 struct libtrace_t * trace_create_dead (char *uri) { 311 struct libtrace_t *libtrace = malloc(sizeof(struct libtrace_t)); 312 char *scan = calloc(sizeof(char),URI_PROTO_LINE); 313 char *uridata; 314 int i; 315 316 trace_err.err_num = E_NOERROR; 317 318 if((uridata = strchr(uri,':')) == NULL) { 319 strncpy(scan, uri, strlen(uri)); 320 } else { 321 strncpy(scan,uri, (uridata - uri)); 322 } 323 324 libtrace->format = 0; 325 326 for (i = 0; i < nformats; i++) { 327 if (strlen(scan) == strlen(format_list[i]->name) && 328 !strncasecmp(scan, 329 format_list[i]->name, 330 strlen(scan))) { 331 libtrace->format=format_list[i]; 332 break; 333 } 334 } 335 if (libtrace->format == 0) { 336 trace_err.err_num = E_BAD_FORMAT; 337 trace_err.problem = scan; 338 return 0; 339 } 340 341 return libtrace; 342 343 } 344 310 345 /** Creates a libtrace_out_t structure and the socket / file through which output will be directed. 311 346 * … … 421 456 } 422 457 458 459 void trace_destroy_dead(struct libtrace_t *libtrace) { 460 assert(libtrace); 461 free(libtrace); 462 } 423 463 /** Close an output trace file, freeing up any resources it may have been using 424 464 *
Note: See TracChangeset
for help on using the changeset viewer.