Changeset 431548c5
- Timestamp:
- 05/04/06 14:54:59 (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:
- 48a20e3
- Parents:
- e5f1431
- Location:
- lib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/fifo.c
r9e830d4 r431548c5 51 51 * #define MIN(a,b) ({ int _a = a; int _b = b; (_a < _b) ? _a : _b; }) 52 52 */ 53 #define MIN(a,b) ((a)<(b)?(a):(b))53 #define FIFO_MIN(a,b) ((a)<(b)?(a):(b)) 54 54 55 55 static char *tracefifo_stat_buffer = 0; … … 201 201 lenleft = len; 202 202 while (lenleft > 0) { 203 size = MIN( ( fifo->length - fifo->datamap[which]), lenleft);203 size = FIFO_MIN( ( fifo->length - fifo->datamap[which]), lenleft); 204 204 memcpy(buffer, 205 205 (char *)((ptrdiff_t)fifo->base + fifo->datamap[which]), … … 228 228 lenleft = len; 229 229 while (lenleft > 0) { 230 size = MIN((fifo->length - fifo->datamap[FIFO_PTR_IN]), lenleft );230 size = FIFO_MIN((fifo->length - fifo->datamap[FIFO_PTR_IN]), lenleft ); 231 231 memcpy((char *)((ptrdiff_t)fifo->base + fifo->datamap[FIFO_PTR_IN]), 232 232 buffer, -
lib/format_erf.c
re5f1431 r431548c5 775 775 } 776 776 777 static int8_t erf_get_direction(const libtrace_packet_t *packet) {777 static libtrace_direction_t erf_get_direction(const libtrace_packet_t *packet) { 778 778 dag_record_t *erfptr = 0; 779 779 erfptr = (dag_record_t *)packet->header; … … 781 781 } 782 782 783 static int8_t erf_set_direction(libtrace_packet_t *packet, int8_t direction) {783 static libtrace_direction_t erf_set_direction(libtrace_packet_t *packet, libtrace_direction_t direction) { 784 784 dag_record_t *erfptr = 0; 785 785 erfptr = (dag_record_t *)packet->header; -
lib/format_linux.c
r9a5b234 r431548c5 273 273 } 274 274 275 static int8_t linuxnative_get_direction(const struct libtrace_packet_t *packet) {275 static libtrace_direction_t linuxnative_get_direction(const struct libtrace_packet_t *packet) { 276 276 switch (((struct libtrace_linuxnative_header*)(packet->buffer))->hdr.sll_pkttype) { 277 277 case PACKET_OUTGOING: 278 return 0;278 return TRACE_DIR_OUTGOING; 279 279 default: 280 return 1;280 return TRACE_DIR_INCOMING; 281 281 } 282 282 } -
lib/format_pcap.c
re5f1431 r431548c5 368 368 } 369 369 370 static int8_t pcap_set_direction(libtrace_packet_t *packet,int8_t dir) { 370 static libtrace_direction_t pcap_set_direction(libtrace_packet_t *packet, 371 libtrace_direction_t dir) { 371 372 libtrace_sll_header_t *sll; 372 373 promote_packet(packet); 373 374 sll=packet->payload; 374 if(dir== 0)375 sll->pkttype= 0;375 if(dir==TRACE_DIR_OUTGOING) 376 sll->pkttype=TRACE_DIR_OUTGOING; 376 377 else 377 sll->pkttype= 1;378 sll->pkttype=TRACE_DIR_INCOMING; 378 379 return sll->pkttype; 379 380 } 380 381 381 static int8_t pcap_get_direction(const libtrace_packet_t *packet) {382 static libtrace_direction_t pcap_get_direction(const libtrace_packet_t *packet) { 382 383 libtrace_direction_t direction = -1; 383 384 switch(pcap_get_link_type(packet)) { … … 404 405 */ 405 406 if (ntohs(sll->pkttype == 0)) { 406 direction = 1;407 direction = TRACE_DIR_INCOMING; 407 408 } else { 408 direction = 0;409 direction = TRACE_DIR_OUTGOING; 409 410 } 410 411 break; … … 424 425 if (ntohs(pflog->dir==0)) { 425 426 426 direction = 1;427 direction = TRACE_DIR_INCOMING; 427 428 } 428 429 else { 429 direction = 0;430 direction = TRACE_DIR_OUTGOING; 430 431 } 431 432 break; -
lib/format_wag.c
ref69a05 r431548c5 417 417 } 418 418 419 static int8_t wag_get_direction(const libtrace_packet_t *packet) {419 static libtrace_direction_t wag_get_direction(const libtrace_packet_t *packet) { 420 420 struct frame_data_rx_t *wagptr = (struct frame_data_rx_t *)packet->buffer; 421 421 if (wagptr->hdr.type == 0) { -
lib/libtrace_int.h
re5f1431 r431548c5 240 240 * @note This callback may be NULL if not supported. 241 241 */ 242 int8_t (*get_direction)(const libtrace_packet_t *packet);242 libtrace_direction_t (*get_direction)(const libtrace_packet_t *packet); 243 243 /** set the direction of this packet 244 244 * @note This callback may be NULL if not supported. 245 245 */ 246 int8_t (*set_direction)(libtrace_packet_t *packet, int8_t direction);246 libtrace_direction_t (*set_direction)(libtrace_packet_t *packet, libtrace_direction_t direction); 247 247 /** return the erf timestamp of the packet. 248 248 * @return the 64bit erf timestamp
Note: See TracChangeset
for help on using the changeset viewer.