Changeset 5eae97a for lib/libtrace.h


Ignore:
Timestamp:
07/26/05 14:58:21 (15 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:
dd6e168
Parents:
8c749ae5
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace.h

    r7e9d51c r5eae97a  
    7575#define COLLECTOR_PORT 3435
    7676
     77/** Opaque structure holding information about an output trace */
     78struct libtrace_out_t;
     79       
    7780/** Opaque structure holding information about a trace */
    7881struct libtrace_t;
     
    208211 *  - wag:/dev/device
    209212 *
    210  *  If an error occured why attempting to open the trace file, NULL is returned
     213 *  If an error occured when attempting to open the trace file, NULL is returned
    211214 *  and an error is output to stdout.
    212215 */
    213216struct libtrace_t *trace_create(char *uri);
    214217
     218/** Creates a trace output file from a URI.
     219 *
     220 * @returns opaque pointer to a libtrace_output_t
     221 *
     222 * Valid URI's are:
     223 *  - gzerf:/path/to/erf/file.gz
     224 *  - gzerf:/path/to/erf/file
     225 *  - rtserver:hostname
     226 *  - rtserver:hostname:port
     227 *
     228 *  If an error occured when attempting to open the output trace, NULL is returned and
     229 *  an error is output to stdout.
     230 */
     231struct libtrace_out_t *trace_output_create(char *uri);
     232
    215233/** Close a trace file, freeing up any resources it may have been using
    216234 *
     
    218236void trace_destroy(struct libtrace_t *trace);
    219237
     238/** Close a trace output file, freeing up any resources it may have been using
     239 *
     240 */
     241void trace_output_destroy(struct libtrace_out_t *trace);
     242
    220243/** Read one packet from the trace into buffer
    221244 *
    222  * @param libtrace      the libtrace opaque pointer
     245 * @param trace         the libtrace opaque pointer
    223246 * @param packet        the packet opaque pointer
    224247 * @returns false if it failed to read a packet
     
    226249 */
    227250int trace_read_packet(struct libtrace_t *trace, struct libtrace_packet_t *packet);
     251
     252/** Write one packet out to the output trace
     253 *
     254 * @param trace         the libtrace_out opaque pointer
     255 * @param packet        the packet opaque pointer
     256 * @returns the number of bytes written out, if zero or negative then an error has occured.
     257 */
     258int trace_write_packet(struct libtrace_out_t *trace, struct libtrace_packet_t *packet);
    228259
    229260/** get a pointer to the link layer
Note: See TracChangeset for help on using the changeset viewer.