Changeset 89b6069 for examples/tutorial
- Timestamp:
- 03/08/13 14:40:38 (9 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:
- c49459b
- Parents:
- ec0b927
- Location:
- examples/tutorial
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/tutorial/getpayloaddemo.c
raf27241 r89b6069 12 12 #include <getopt.h> 13 13 #include <arpa/inet.h> 14 15 uint64_t packet_count = 0;16 uint64_t capture_count = 0;17 uint64_t wire_count = 0;18 uint32_t next_report = 0;19 14 20 15 static void per_packet(libtrace_packet_t *packet) … … 177 172 } 178 173 179 /* Print the stats for the final reporting period that was probably180 * not complete when the trace finished */181 printf("%u\t", next_report);182 printf("%.2f\t\t", ((double)wire_count) / packet_count);183 printf("%.2f\n", ((double)capture_count) / packet_count);184 185 174 libtrace_cleanup(trace, packet); 186 175 return 0; -
examples/tutorial/gettransportdemo.c
raf27241 r89b6069 10 10 #include <getopt.h> 11 11 #include <arpa/inet.h> 12 13 uint64_t packet_count = 0;14 uint64_t capture_count = 0;15 uint64_t wire_count = 0;16 uint32_t next_report = 0;17 12 18 13 static void per_packet(libtrace_packet_t *packet) … … 127 122 } 128 123 129 /* Print the stats for the final reporting period that was probably130 * not complete when the trace finished */131 printf("%u\t", next_report);132 printf("%.2f\t\t", ((double)wire_count) / packet_count);133 printf("%.2f\n", ((double)capture_count) / packet_count);134 135 124 libtrace_cleanup(trace, packet); 136 125 return 0;
Note: See TracChangeset
for help on using the changeset viewer.