Changeset b51edf5
- Timestamp:
- 03/07/06 10:50:19 (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:
- 8f80e87
- Parents:
- e4e1635
- Location:
- lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_rt.c
r7ac9705 rb51edf5 448 448 /* FIXME: Do something useful here as well */ 449 449 break; 450 case RT_KEYCHANGE: 451 break; 450 452 default: 451 453 printf("Bad rt type for client receipt: %d\n", … … 453 455 } 454 456 } 455 return trace_get_capture_length(packet)+trace_get_framing_length(packet); 457 /* Return the number of bytes read from the stream */ 458 return sizeof(rt_header_t) + packet->size; 456 459 } 457 460 … … 480 483 case RT_OPTION: 481 484 return sizeof(rt_option_t); 485 case RT_KEYCHANGE: 486 return sizeof(rt_keychange_t); 482 487 } 483 488 printf("Unknown type: %d\n", packet->type); -
lib/rt_protocol.h
r7ac9705 rb51edf5 14 14 #define RT_DATA_PCAP 2000 15 15 16 /* Procedure for adding new RT control types 17 * ------------------------------------------- 18 * 19 * Add type to the enum list 20 * Add a struct below (even if it is empty) 21 * Update rt_get_capture_length 22 * If type is intended to be sent TO clients, update rt_read_packet 23 * Otherwise, update server implementations e.g. WDCAP 24 * 25 * Procedure for adding new RT data types 26 * ---------------------------------------- 27 * 28 * If you are adding a new format: 29 * RT_DATA_(new format) must be equal to RT_DATA_SIMPLE + 30 * TRACE_FORMAT_(new_format) 31 * Add a new dummy trace type to the rt_format_t structure 32 * Set the dummy trace to NULL in rt_init_input 33 * Update rt_set_format 34 * 35 * If you are adding a new PCAP DLT type: 36 * RT_DATA_PCAP_(new DLT) must be equal to RT_DATA_PCAP + (DLT value) 37 * 38 */ 39 16 40 /* Type field definitions */ 17 41 enum rt_field_t { … … 27 51 RT_PAUSE_ACK =10, /* Server is paused message */ 28 52 RT_OPTION =11, /* Option request */ 53 RT_KEYCHANGE =12, /* Anonymisation key has changed */ 29 54 30 55 RT_DATA_ERF =RT_DATA_SIMPLE + TRACE_FORMAT_ERF, … … 44 69 RT_DATA_PCAP_PFLOG =RT_DATA_PCAP + DLT_PFLOG, 45 70 #endif 46 71 RT_LAST = 3000 47 72 }; 48 73 … … 116 141 } rt_option_t; 117 142 118 119 143 typedef struct rt_keychange { 144 145 } rt_keychange_t; 120 146 121 147 #endif -
lib/trace.c
re4e1635 rb51edf5 1172 1172 /* timeval -> seconds */ 1173 1173 tv = packet->trace->format->get_timeval(packet); 1174 seconds = tv.tv_sec + ((tv.tv_usec * UINT_MAX * 1.0)/1000000);1174 seconds = tv.tv_sec + ((tv.tv_usec * 1.0) / 1000000); 1175 1175 } 1176 1176 … … 1180 1180 size_t trace_get_capture_length(const libtrace_packet_t *packet) { 1181 1181 1182 assert(packet->size>0 && packet->size<65536); 1182 /* Packets can be have a size of zero */ 1183 assert(packet->size>=0 && packet->size<65536); 1183 1184 1184 1185 if (packet->trace->format->get_capture_length) {
Note: See TracChangeset
for help on using the changeset viewer.