Changeset c0506ea for lib/libtrace.h.in


Ignore:
Timestamp:
09/20/11 14:21:53 (10 years ago)
Author:
Shane Alcock <salcock@…>
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:
c0ccccd
Parents:
2cf2c2d
Message:
  • We now use pcap_create and pcap_activate for pcap interfaces if libpcap 1.0 or later is available. This doesn't seem to make much of a difference performance-wise, as pcap_open_live was updated to use these functions anyway. This means if mmapped packet capture is available, we would have used it via pcap_open_live anyway.
  • Added a new function (trace_interrupt). Calling this function will set an internal variable which can be used to cause any blocking read_packet function to exit with an EOF. Useful for programs that are handling signals themselves and need a way to tell libtrace to stop. Prior to this, programs like tracestats would not exit on Ctrl-C if reading from a pcap interface which was not receiving any packets.
  • Updated pcap interface format to respond to trace_interrupt.
  • Optimising trace_apply_filter to minimise calls to trace_get_link_type and trace_get_packet_buffer.
  • Removed unused extern variable "form" from libtrace_int.h
  • Fixed bug with filters in the pcap interface format which would result in "invalid BPF program" error message when filter was definitely legit.
  • Updated version number to 3.0.13
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace.h.in

    ree58d0d rc0506ea  
    775775DLLEXPORT void trace_help(void);
    776776
     777/** Causes a libtrace reader to stop blocking whilst waiting on new packets
     778 * and immediately return EOF.
     779 *
     780 * This function is useful if you are handling signals within your libtrace
     781 * program. If a live source is not receiving any packets (or they are being
     782 * filtered), a call to trace_read_packet will result in an infinite loop as
     783 * it will block until a packet is received. Normally, a SIGINT would cause the
     784 * program to end and thus break the loop, but if you are handling the signal
     785 * yourself then that signal will never reach libtrace.
     786 *
     787 * Instead this function sets a global variable within libtrace that will
     788 * cause a blocking live capture to break on the next internal timeout,
     789 * allowing control to be returned to the user and their own signal handling
     790 * to kick in.
     791 */
     792DLLEXPORT void trace_interrupt(void);
     793
    777794/** @name Trace management
    778795 * These members deal with creating, configuring, starting, pausing and
Note: See TracChangeset for help on using the changeset viewer.