Changeset 95ca714
- Timestamp:
- 06/26/18 18:11:38 (3 years ago)
- Branches:
- cachetimestamps, develop, master, rc-4.0.4, ringdecrementfix, ringperformance
- Children:
- f57722d6
- Parents:
- f9df20e (diff), 32ee9b2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- lib
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_atmhdr.c
r2c457ec r32ee9b2 202 202 NULL, /* fin_packet */ 203 203 NULL, /* write_packet */ 204 NULL, /* flush_output */ 204 205 atmhdr_get_link_type, /* get_link_type */ 205 206 NULL, /* get_direction */ -
lib/format_bpf.c
r5e3f16c r32ee9b2 666 666 NULL, /* fin_packet */ 667 667 NULL, /* write_packet */ 668 NULL, /* flush_output */ 668 669 bpf_get_link_type, /* get_link_type */ 669 670 bpf_get_direction, /* get_direction */ -
lib/format_dag24.c
ree6e802 r32ee9b2 529 529 NULL, /* fin_packet */ 530 530 NULL, /* write_packet */ 531 NULL, /* flush_output */ 531 532 erf_get_link_type, /* get_link_type */ 532 533 erf_get_direction, /* get_direction */ -
lib/format_dag25.c
rcc9c9de r32ee9b2 1564 1564 NULL, /* fin_packet */ 1565 1565 dag_write_packet, /* write_packet */ 1566 NULL, /* flush_output */ 1566 1567 erf_get_link_type, /* get_link_type */ 1567 1568 erf_get_direction, /* get_direction */ -
lib/format_dpdk.c
r6d17620 r32ee9b2 2159 2159 dpdk_fin_packet, /* fin_packet */ 2160 2160 dpdk_write_packet, /* write_packet */ 2161 NULL, /* flush_output */ 2161 2162 dpdk_get_link_type, /* get_link_type */ 2162 2163 dpdk_get_direction, /* get_direction */ -
lib/format_dpdkndag.c
re54bd5f r32ee9b2 733 733 NULL, /* fin_packet */ 734 734 NULL, /* write_packet */ 735 NULL, /* flush_output */ 735 736 erf_get_link_type, /* get_link_type */ 736 737 erf_get_direction, /* get_direction */ -
lib/format_duck.c
ree6e802 r32ee9b2 337 337 NULL, /* fin_packet */ 338 338 duck_write_packet, /* write_packet */ 339 NULL, /* flush_output */ 339 340 duck_get_link_type, /* get_link_type */ 340 341 NULL, /* get_direction */ -
lib/format_erf.c
r207e288 r32ee9b2 597 597 } 598 598 return numbytes + framinglen; 599 } 600 601 static int erf_flush_output(libtrace_out_t *libtrace) { 602 return wandio_wflush(OUTPUT->file); 599 603 } 600 604 … … 868 872 NULL, /* fin_packet */ 869 873 erf_write_packet, /* write_packet */ 874 erf_flush_output, /* flush_output */ 870 875 erf_get_link_type, /* get_link_type */ 871 876 erf_get_direction, /* get_direction */ … … 912 917 NULL, /* fin_packet */ 913 918 erf_write_packet, /* write_packet */ 919 erf_flush_output, /* flush_output */ 914 920 erf_get_link_type, /* get_link_type */ 915 921 erf_get_direction, /* get_direction */ -
lib/format_etsilive.c
r5577521 r32ee9b2 648 648 NULL, /* fin_packet */ 649 649 NULL, /* write_packet */ 650 NULL, /* flush_output */ 650 651 etsilive_get_link_type, /* get_link_type */ 651 652 NULL, /* get_direction */ -
lib/format_legacy.c
r2c457ec r32ee9b2 523 523 NULL, /* fin_packet */ 524 524 NULL, /* write_packet */ 525 NULL, /* flush_output */ 525 526 legacyatm_get_link_type, /* get_link_type */ 526 527 NULL, /* get_direction */ … … 567 568 NULL, /* fin_packet */ 568 569 NULL, /* write_packet */ 570 NULL, /* flush_output */ 569 571 legacyeth_get_link_type, /* get_link_type */ 570 572 NULL, /* get_direction */ … … 611 613 NULL, /* fin_packet */ 612 614 NULL, /* write_packet */ 615 NULL, /* flush_output */ 613 616 legacypos_get_link_type, /* get_link_type */ 614 617 NULL, /* get_direction */ … … 655 658 NULL, /* fin_packet */ 656 659 NULL, /* write_packet */ 660 NULL, /* flush_output */ 657 661 legacynzix_get_link_type, /* get_link_type */ 658 662 NULL, /* get_direction */ -
lib/format_linux_int.c
rdb84bb2 r32ee9b2 496 496 NULL, /* fin_packet */ 497 497 linuxnative_write_packet, /* write_packet */ 498 NULL, /* flush_output */ 498 499 linuxnative_get_link_type, /* get_link_type */ 499 500 linuxnative_get_direction, /* get_direction */ … … 556 557 NULL, /* fin_packet */ 557 558 NULL, /* write_packet */ 559 NULL, /* flush_output */ 558 560 linuxnative_get_link_type, /* get_link_type */ 559 561 linuxnative_get_direction, /* get_direction */ -
lib/format_linux_ring.c
r1060b6d r32ee9b2 70 70 /* Cached page size, the page size shouldn't be changing */ 71 71 static int pagesize = 0; 72 73 static pthread_mutex_t pagesize_mutex; 72 74 73 75 /* … … 88 90 struct ifreq ifr; 89 91 unsigned max_frame = LIBTRACE_PACKET_BUFSIZE; 90 pagesize = getpagesize(); 92 pthread_mutex_lock(&pagesize_mutex); 93 if (pagesize == 0) { 94 pagesize = getpagesize(); 95 } 96 pthread_mutex_unlock(&pagesize_mutex); 91 97 92 98 strcpy(ifr.ifr_name, uri); … … 545 551 546 552 stream->last_timestamp = packet->order; 547 548 553 549 554 /* We just need to get prepare_packet to set all our packet pointers … … 743 748 linuxring_fin_packet, /* fin_packet */ 744 749 linuxring_write_packet, /* write_packet */ 750 NULL, /* flush_output */ 745 751 linuxring_get_link_type, /* get_link_type */ 746 752 linuxring_get_direction, /* get_direction */ … … 805 811 NULL, /* fin_packet */ 806 812 NULL, /* write_packet */ 813 NULL, /* flush_output */ 807 814 linuxring_get_link_type, /* get_link_type */ 808 815 linuxring_get_direction, /* get_direction */ … … 835 842 void linuxring_constructor(void) 836 843 { 844 pthread_mutex_init(&pagesize_mutex, NULL); 837 845 register_format(&linuxring); 838 846 } -
lib/format_ndag.c
r7c33187 r32ee9b2 1434 1434 NULL, /* fin_packet */ 1435 1435 NULL, /* write_packet */ 1436 NULL, /* flush_output */ 1436 1437 erf_get_link_type, /* get_link_type */ 1437 1438 erf_get_direction, /* get_direction */ -
lib/format_pcap.c
r5a70a80 r32ee9b2 583 583 } 584 584 585 static int pcap_flush_output(libtrace_out_t *libtrace) { 586 return pcap_dump_flush(OUTPUT.trace.dump); 587 } 588 585 589 static int pcapint_write_packet(libtrace_out_t *libtrace, 586 590 libtrace_packet_t *packet) … … 779 783 NULL, /* fin_packet */ 780 784 pcap_write_packet, /* write_packet */ 785 pcap_flush_output, /* flush_output */ 781 786 pcap_get_link_type, /* get_link_type */ 782 787 pcapint_get_direction, /* get_direction */ … … 823 828 NULL, /* fin_packet */ 824 829 pcapint_write_packet, /* write_packet */ 830 NULL, /* flush_output */ 825 831 pcap_get_link_type, /* get_link_type */ 826 832 pcapint_get_direction, /* get_direction */ -
lib/format_pcapfile.c
rcc9c9de r32ee9b2 532 532 533 533 return numbytes+ret; 534 } 535 536 static int pcapfile_flush_output(libtrace_out_t *out) { 537 538 return wandio_wflush(DATAOUT(out)->file); 534 539 } 535 540 … … 696 701 NULL, /* fin_packet */ 697 702 pcapfile_write_packet, /* write_packet */ 703 pcapfile_flush_output, /* flush_output */ 698 704 pcapfile_get_link_type, /* get_link_type */ 699 705 pcapfile_get_direction, /* get_direction */ -
lib/format_pcapng.c
r9845e97 r32ee9b2 1470 1470 NULL, /* fin_packet */ 1471 1471 NULL, /* write_packet */ 1472 NULL, /* flush_output */ 1472 1473 pcapng_get_link_type, /* get_link_type */ 1473 1474 pcapng_get_direction, /* get_direction */ -
lib/format_rt.c
ree6e802 r32ee9b2 845 845 NULL, /* fin_packet */ 846 846 NULL, /* write_packet */ 847 NULL, /* flush_output */ 847 848 rt_get_link_type, /* get_link_type */ 848 849 NULL, /* get_direction */ -
lib/format_tsh.c
r2c457ec r32ee9b2 245 245 NULL, /* fin_packet */ 246 246 NULL, /* write_packet */ 247 NULL, /* flush_output */ 247 248 tsh_get_link_type, /* get_link_type */ 248 249 tsh_get_direction, /* get_direction */ … … 294 295 NULL, /* fin_packet */ 295 296 NULL, /* write_packet */ 297 NULL, /* flush_output */ 296 298 tsh_get_link_type, /* get_link_type */ 297 299 tsh_get_direction, /* get_direction */ -
lib/libtrace.h.in
rcc9c9de r32ee9b2 1537 1537 DLLEXPORT void trace_destroy_output(libtrace_out_t *trace); 1538 1538 1539 /** Flush an output trace, forcing any buffered packets to be written 1540 * @param libtrace The output trace to be flushed 1541 */ 1542 DLLEXPORT int trace_flush_output(libtrace_out_t *libtrace); 1543 1539 1544 /** Check (and clear) the current error state of an input trace 1540 1545 * @param trace The input trace to check the error state on -
lib/libtrace_int.h
rcc9c9de r32ee9b2 624 624 */ 625 625 int (*write_packet)(libtrace_out_t *libtrace, libtrace_packet_t *packet); 626 627 /** Flush any buffered output for an output trace. 628 * 629 * @param libtrace The output trace to be flushed 630 */ 631 int (*flush_output)(libtrace_out_t *libtrace); 632 626 633 /** Returns the libtrace link type for a packet. 627 634 * -
lib/trace.c
rcc9c9de r32ee9b2 816 816 } 817 817 818 DLLEXPORT int trace_flush_output(libtrace_out_t *libtrace) { 819 if (!libtrace) { 820 return -1; 821 } 822 if (libtrace->format && libtrace->format->flush_output) { 823 return libtrace->format->flush_output(libtrace); 824 } 825 return 0; 826 } 827 818 828 DLLEXPORT libtrace_packet_t *trace_create_packet(void) 819 829 {
Note: See TracChangeset
for help on using the changeset viewer.