source: lib/libtrace.h @ 5395ce6

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 5395ce6 was 5395ce6, checked in by Perry Lorier <perry@…>, 16 years ago
  • Fix prototypes for trace_get_<mumble>_from_ip
  • Fix documentation for the event framework
  • Property mode set to 100644
File size: 21.7 KB
Line 
1/*
2 * This file is part of libtrace
3 *
4 * Copyright (c) 2004 The University of Waikato, Hamilton, New Zealand.
5 * Authors: Daniel Lawson
6 *          Perry Lorier
7 *         
8 * All rights reserved.
9 *
10 * This code has been developed by the University of Waikato WAND
11 * research group. For further information please see http://www.wand.net.nz/
12 *
13 * libtrace is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * libtrace is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with libtrace; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26 *
27 * $Id$
28 *
29 */
30
31#ifndef LIBTRACE_H
32#define LIBTRACE_H
33
34#include <sys/types.h>
35#include <netinet/in.h>
36
37/** API version as 2 byte hex digits, eg 0xXXYYZZ */
38#define LIBTRACE_API_VERSION 0x020016  /* 2.0.22 */
39
40#ifdef __cplusplus
41extern "C" { 
42#endif
43/** @file
44 *
45 * @brief Trace file processing library header
46 *
47 * @author Daniel Lawson
48 * @author Perry Lorier
49 *
50 * @version $Id$
51 *
52 * This library provides a per packet interface into a trace file, or a live
53 * captures.  It supports ERF, DAG cards, WAG cards, WAG's event format,
54 * pcap etc.
55 *
56 * @par Usage
57 * See the example/ directory in the source distribution for some simple examples
58 * @par Linking
59 * To use this library you need to link against libtrace by passing -ltrace
60 * to your linker. You may also need to link against a version of libpcap
61 * and of zlib which are compiled for largefile support (if you wish to access
62 * traces larger than 2 GB). This is left as an exercise for the reader. Debian
63 * Woody, at least, does not support large file offsets.
64 *
65 */
66
67#define COLLECTOR_PORT 3435
68
69       
70/** Opaque structure holding information about an output trace */
71struct libtrace_out_t;
72       
73/** Opaque structure holding information about a trace */
74struct libtrace_t;
75       
76/** Opaque structure holding information about a bpf filter */
77struct libtrace_filter_t;
78
79/** Structure holding information about a packet */
80#define LIBTRACE_PACKET_BUFSIZE 65536
81struct libtrace_packet_t {
82        struct libtrace_t *trace;
83        //void *buffer;
84        char buffer[LIBTRACE_PACKET_BUFSIZE];
85        size_t size;
86        uint8_t status;
87};
88                     
89
90/** Enumeration of error codes */
91enum {E_NOERROR, E_BAD_FORMAT, E_NO_INIT, E_NO_INIT_OUT, E_URI_LONG, E_URI_NOCOLON, E_INIT_FAILED };
92
93/** Structure for dealing with IP packets */
94struct libtrace_ip
95{
96#if BYTE_ORDER == LITTLE_ENDIAN
97    unsigned int ip_hl:4;               /**< header length */
98    unsigned int ip_v:4;                /**< version */
99#elif BYTE_ORDER == BIG_ENDIAN
100    unsigned int ip_v:4;                /**< version */
101    unsigned int ip_hl:4;               /**< header length */
102#else
103#   error "Adjust your <bits/endian.h> defines"
104#endif
105    u_int8_t ip_tos;                    /**< type of service */
106    u_short ip_len;                     /**< total length */
107    u_short ip_id;                      /**< identification */
108    u_short ip_off;                     /**< fragment offset field */
109#define IP_RF 0x8000                    /**< reserved fragment flag */
110#define IP_DF 0x4000                    /**< dont fragment flag */
111#define IP_MF 0x2000                    /**< more fragments flag */
112#define IP_OFFMASK 0x1fff               /**< mask for fragmenting bits */
113    u_int8_t ip_ttl;                    /**< time to live */
114    u_int8_t ip_p;                      /**< protocol */
115    u_short ip_sum;                     /**< checksum */
116    struct in_addr ip_src;              /**< source address */
117    struct in_addr ip_dst;              /**< dest address */
118} __attribute__ ((__packed__));
119
120/** Structure for dealing with TCP packets */
121struct libtrace_tcp
122  {
123    u_int16_t source;           /**< Source Port */
124    u_int16_t dest;             /**< Destination port */
125    u_int32_t seq;              /**< Sequence number */
126    u_int32_t ack_seq;          /**< Acknowledgement Number */
127#  if BYTE_ORDER == LITTLE_ENDIAN
128    u_int16_t res1:4;           /**< Reserved bits */
129    u_int16_t doff:4;           
130    u_int16_t fin:1;            /**< FIN */
131    u_int16_t syn:1;            /**< SYN flag */
132    u_int16_t rst:1;            /**< RST flag */
133    u_int16_t psh:1;            /**< PuSH flag */
134    u_int16_t ack:1;            /**< ACK flag */
135    u_int16_t urg:1;            /**< URG flag */
136    u_int16_t res2:2;           /**< Reserved */
137#  elif BYTE_ORDER == BIG_ENDIAN
138    u_int16_t doff:4;           
139    u_int16_t res1:4;           /**< Reserved bits */
140    u_int16_t res2:2;           /**< Reserved */
141    u_int16_t urg:1;            /**< URG flag */
142    u_int16_t ack:1;            /**< ACK flag */
143    u_int16_t psh:1;            /**< PuSH flag */
144    u_int16_t rst:1;            /**< RST flag */
145    u_int16_t syn:1;            /**< SYN flag */
146    u_int16_t fin:1;            /**< FIN flag */
147#  else
148#   error "Adjust your <bits/endian.h> defines"
149#  endif
150    u_int16_t window;           /**< Window Size */
151    u_int16_t check;            /**< Checksum */
152    u_int16_t urg_ptr;          /**< Urgent Pointer */
153} __attribute__ ((__packed__));
154
155/** UDP Header for dealing with UDP packets */
156struct libtrace_udp {
157  u_int16_t     source;         /**< Source port */
158  u_int16_t     dest;           /**< Destination port */
159  u_int16_t     len;            /**< Length */
160  u_int16_t     check;          /**< Checksum */
161} __attribute__ ((__packed__));
162
163/** ICMP Header for dealing with icmp packets */
164struct libtrace_icmp
165{
166  u_int8_t type;                /**< message type */
167  u_int8_t code;                /**< type sub-code */
168  u_int16_t checksum;           /**< checksum */
169  union
170  {
171    struct
172    {
173      u_int16_t id;
174      u_int16_t sequence;
175    } echo;                     /**< echo datagram */
176    u_int32_t   gateway;        /**< gateway address */
177    struct
178    {
179      u_int16_t unused;
180      u_int16_t mtu;
181    } frag;                     /**< path mtu discovery */
182  } un;
183} __attribute__ ((__packed__));
184
185/** 802.3 frame */
186struct libtrace_ether
187{
188  u_int8_t ether_dhost[6];      /* destination ether addr */
189  u_int8_t ether_shost[6];      /* source ether addr */
190  u_int16_t ether_type;         /* packet type ID field (next-header) */
191} __attribute__ ((__packed__));
192
193/** 802.1Q frame */
194struct libtrace_8021q
195{
196  u_int8_t  ether_dhost[6];      /* destination eth addr */
197  u_int8_t  ether_shost[6];      /* source ether addr    */
198  u_int16_t ether_type;          /* packet type ID field , 0x8100 for VLAN */
199  u_int16_t vlan_pri:3;          /* vlan user priority */
200  u_int16_t vlan_cfi:1;          /* vlan format indicator, 0 for ethernet, 1 for token ring */
201  u_int16_t vlan_id:12;          /* vlan id */
202  u_int16_t vlan_ether_type;     /* vlan sub-packet type ID field (next-header)*/
203} __attribute__ ((__packed__));
204
205/** Prints help information for libtrace
206 *
207 * Function prints out some basic help information regarding libtrace,
208 * and then prints out the help() function registered with each input module
209 */
210void trace_help();
211
212/** Gets the output format for a given output trace
213 *
214 * @params libtrace     the output trace to get the name of the format fo
215 * @returns callee-owned null-terminated char* containing the output format
216 *
217 */
218char *trace_get_output_format(struct libtrace_out_t *libtrace);
219
220/** Prints error information
221 *
222 * Prints out a descriptive error message for the currently set trace_err value
223 */
224void trace_perror(char *caller);
225
226/** Create a trace file from a URI
227 *
228 * @params char * containing a valid libtrace URI
229 * @returns opaque pointer to a libtrace_t
230 *
231 * Valid URI's are:
232 *  - erf:/path/to/erf/file
233 *  - erf:/path/to/erf/file.gz
234 *  - erf:/path/to/rtclient/socket
235 *  - erf:-  (stdin)
236 *  - dag:/dev/dagcard                 
237 *  - pcapint:pcapinterface                (eg: pcap:eth0)
238 *  - pcap:/path/to/pcap/file
239 *  - pcap:-
240 *  - rtclient:hostname
241 *  - rtclient:hostname:port
242 *  - wag:-
243 *  - wag:/path/to/wag/file
244 *  - wag:/path/to/wag/file.gz
245 *  - wag:/path/to/wag/socket
246 *
247 *  If an error occured when attempting to open the trace file, NULL is returned
248 *  and trace_errno is set. Use trace_perror() to get more information
249 */
250struct libtrace_t *trace_create(char *uri);
251
252/** Creates a "dummy" trace file that has only the format type set.
253 *
254 * @returns opaque pointer to a (sparsely initialised) libtrace_t
255 *
256 * IMPORTANT: Do not attempt to call trace_read_packet or other such functions with
257 * the dummy trace. Its intended purpose is to act as a packet->trace for libtrace_packet_t's
258 * that are not associated with a libtrace_t structure.
259 */
260struct libtrace_t *trace_create_dead(char *uri);
261
262/** Creates a trace output file from a URI.
263 *
264 * @param uri   the uri string describing the output format and destination
265 * @returns opaque pointer to a libtrace_output_t
266 * @author Shane Alcock
267 *
268 * Valid URI's are:
269 *  - gzerf:/path/to/erf/file.gz
270 *  - gzerf:/path/to/erf/file
271 *  - rtserver:hostname
272 *  - rtserver:hostname:port
273 *
274 *  If an error occured when attempting to open the output trace, NULL is returned
275 *  and trace_errno is set. Use trace_perror() to get more information
276 */
277struct libtrace_out_t *trace_output_create(char *uri);
278
279/* Parses an output options string and calls the appropriate function to deal with output options.
280 *
281 * @param libtrace      the output trace object to apply the options to
282 * @param options       the options string
283 * @returns -1 if option configuration failed, 0 otherwise
284 *
285 * @author Shane Alcock
286 */
287int trace_output_config(struct libtrace_out_t *libtrace, char *options);
288
289/** Close a trace file, freeing up any resources it may have been using
290 *
291 */
292void trace_destroy(struct libtrace_t *trace);
293
294void trace_destroy_dead(struct libtrace_t *trace);
295
296/** Close a trace output file, freeing up any resources it may have been using
297 *
298 * @param libtrace      the output trace file to be destroyed
299 *
300 * @author Shane Alcock
301 */
302void trace_output_destroy(struct libtrace_out_t *trace);
303
304/** Read one packet from the trace into buffer
305 *
306 * @param trace         the libtrace opaque pointer
307 * @param packet        the packet opaque pointer
308 * @returns 0 on EOF, negative value on error
309 *
310 */
311int trace_read_packet(struct libtrace_t *trace, struct libtrace_packet_t *packet);
312
313/** Write one packet out to the output trace
314 *
315 * @param trace         the libtrace_out opaque pointer
316 * @param packet        the packet opaque pointer
317 * @returns the number of bytes written out, if zero or negative then an error has occured.
318 */
319int trace_write_packet(struct libtrace_out_t *trace, struct libtrace_packet_t *packet);
320
321/** get a pointer to the link layer
322 * @param packet        the packet opaque pointer
323 *
324 * @returns a pointer to the link layer, or NULL if there is no link layer
325 *
326 * @note you should call getLinkType() to find out what type of link layer
327 * this is
328 */
329void *trace_get_link(const struct libtrace_packet_t *packet);
330
331/** get a pointer to the IP header (if any)
332 * @param packet        the packet opaque pointer
333 *
334 * @returns a pointer to the IP header, or NULL if there is not an IP packet
335 */
336struct libtrace_ip *trace_get_ip(const struct libtrace_packet_t *packet);
337
338/** get a pointer to the TCP header (if any)
339 * @param packet        the packet opaque pointer
340 *
341 * @returns a pointer to the TCP header, or NULL if there is not a TCP packet
342 */
343struct libtrace_tcp *trace_get_tcp(const struct libtrace_packet_t *packet);
344
345/** get a pointer to the TCP header (if any) given a pointer to the IP header
346 * @param ip            The IP header
347 * @param[out] skipped  An output variable of the number of bytes skipped
348 *
349 * @returns a pointer to the TCP header, or NULL if this is not a TCP packet
350 *
351 * Skipped can be NULL, in which case it will be ignored by the program.
352 *
353 * @author Perry Lorier
354 */
355struct libtrace_tcp *trace_get_tcp_from_ip(const struct libtrace_ip *ip,int *skipped);
356
357/** get a pointer to the UDP header (if any)
358 * @param packet        the packet opaque pointer
359 *
360 * @returns a pointer to the UDP header, or NULL if this is not a UDP packet
361 */
362struct libtrace_udp *trace_get_udp(const struct libtrace_packet_t *packet);
363
364/** get a pointer to the UDP header (if any) given a pointer to the IP header
365 * @param       ip      The IP header
366 * @param[out]  skipped An output variable of the number of bytes skipped
367 *
368 * @returns a pointer to the UDP header, or NULL if this is not an UDP packet
369 *
370 * Skipped may be NULL, in which case it will be ignored by this function.
371 */
372struct libtrace_udp *trace_get_udp_from_ip(const struct libtrace_ip *ip,int *skipped);
373
374/** get a pointer to the ICMP header (if any)
375 * @param packet        the packet opaque pointer
376 *
377 * @returns a pointer to the ICMP header, or NULL if this is not a ICMP packet
378 */
379struct libtrace_icmp *trace_get_icmp(const struct libtrace_packet_t *packet);
380
381/** get a pointer to the ICMP header (if any) given a pointer to the IP header
382 * @param ip            The IP header
383 * @param[out] skipped  An output variable of the number of bytes skipped
384 *
385 * @returns a pointer to the ICMP header, or NULL if this is not an ICMP packet
386 *
387 * Skipped may be NULL, in which case it will be ignored by this function
388 */
389struct libtrace_icmp *trace_get_icmp_from_ip(const struct libtrace_ip *ip,int *skipped);
390
391/** parse an ip or tcp option
392 * @param[in,out] ptr   the pointer to the current option
393 * @param[in,out] len   the length of the remaining buffer
394 * @param[out] type     the type of the option
395 * @param[out] optlen   the length of the option
396 * @param[out] data     the data of the option
397 *
398 * @returns bool true if there is another option (and the fields are filled in)
399 *               or false if this was the last option.
400 *
401 * This updates ptr to point to the next option after this one, and updates
402 * len to be the number of bytes remaining in the options area.  Type is updated
403 * to be the code of this option, and data points to the data of this option,
404 * with optlen saying how many bytes there are.
405 *
406 * @note Beware of fragmented packets.
407 */
408int trace_get_next_option(unsigned char **ptr,int *len,
409                        unsigned char *type,
410                        unsigned char *optlen,
411                        unsigned char **data);
412
413
414/** Get the current time in DAG time format
415 * @param packet        the packet opaque pointer
416 *
417 * @returns a 64 bit timestamp in DAG ERF format (upper 32 bits are the seconds
418 * past 1970-01-01, the lower 32bits are partial seconds)
419 * @author Daniel Lawson
420 */
421uint64_t trace_get_erf_timestamp(const struct libtrace_packet_t *packet);
422
423/** Get the current time in struct timeval
424 * @param packet        the packet opaque pointer
425 *
426 * @returns time that this packet was seen in a struct timeval
427 * @author Daniel Lawson
428 * @author Perry Lorier
429 */ 
430struct timeval trace_get_timeval(const struct libtrace_packet_t *packet);
431
432/** Get the current time in floating point seconds
433 * @param packet        the packet opaque pointer
434 *
435 * @returns time that this packet was seen in 64bit floating point seconds
436 * @author Daniel Lawson
437 * @author Perry Lorier
438 */
439double trace_get_seconds(const struct libtrace_packet_t *packet);
440
441/** Get the size of the packet in the trace
442 * @param packet        the packet opaque pointer
443 * @returns the size of the packet in the trace
444 * @author Perry Lorier
445 * @note Due to this being a header capture, or anonymisation, this may not
446 * be the same size as the original packet.  See get_wire_length() for the original
447 * size of the packet.
448 * @note This can (and often is) different for different packets in a trace!
449 * @par
450 *  This is sometimes called the "snaplen".
451 */
452
453int trace_get_capture_length(const struct libtrace_packet_t *packet);
454
455/** Get the size of the packet as it was seen on the wire.
456 * @param packet        the packet opaque pointer
457 * @returns the size of the packet as it was on the wire.
458 * @author Perry Lorier
459 * @author Daniel Lawson
460 * @note Due to the trace being a header capture, or anonymisation this may
461 * not be the same as the Capture Len.
462 */ 
463
464int trace_get_wire_length(const struct libtrace_packet_t *packet);
465
466/** Link layer types
467 * This enumates the various different link types that libtrace understands
468 */
469typedef enum { 
470       TRACE_TYPE_LEGACY,       
471       TRACE_TYPE_HDLC_POS, 
472       TRACE_TYPE_ETH,                  /**< 802.3 style Ethernet */
473       TRACE_TYPE_ATM,
474       TRACE_TYPE_80211,                /**< 802.11 frames */
475       TRACE_TYPE_NONE,
476       TRACE_TYPE_LINUX_SLL,            /**< Linux "null" framing */
477       TRACE_TYPE_PFLOG,                /**< FreeBSD's PFlug */
478       TRACE_TYPE_LEGACY_DEFAULT,
479       TRACE_TYPE_LEGACY_POS,
480       TRACE_TYPE_LEGACY_ATM,
481       TRACE_TYPE_LEGACY_ETH
482     } libtrace_linktype_t;
483
484/** Get the type of the link layer
485 * @param packet        the packet opaque pointer
486 * @returns libtrace_linktype_t
487 * @author Perry Lorier
488 * @author Daniel Lawson
489 */
490
491inline libtrace_linktype_t trace_get_link_type(const struct libtrace_packet_t *packet);
492
493/** Get the destination MAC addres
494 * @param packet        the packet opaque pointer
495 * @returns a pointer to the destination mac, (or NULL if there is no
496 * destination MAC)
497 * @author Perry Lorier
498 */
499uint8_t *trace_get_destination_mac(const struct libtrace_packet_t *packet);
500
501/** Get the source MAC addres
502 * @param packet        the packet opaque pointer
503 * @returns a pointer to the source mac, (or NULL if there is no source MAC)
504 * @author Perry Lorier
505 */
506uint8_t *trace_get_source_mac(const struct libtrace_packet_t *packet);
507
508/** Truncate the packet at the suggested length
509 * @param packet        the packet opaque pointer
510 * @param len           the new length of the packet
511 * @returns the new length of the packet, or the original length of the
512 * packet if unchanged
513 * @author Daniel Lawson
514 */
515size_t trace_set_capture_length(struct libtrace_packet_t *packet, size_t size);
516
517/** Set the direction flag, if it has one
518 * @param packet        the packet opaque pointer
519 * @param direction     the new direction (0,1,2,3)
520 * @returns a signed value containing the direction flag, or -1 if this is not supported
521 * @author Daniel Lawson
522 */
523int8_t trace_set_direction(struct libtrace_packet_t *packet, int8_t direction);
524
525/** Get the direction flag, if it has one
526 * @param packet        the packet opaque pointer
527 * @returns a signed value containing the direction flag, or -1 if this is not supported
528 * The direction is defined as 0 for packets originating locally (ie, outbound)
529 * and 1 for packets originating remotely (ie, inbound).
530 * Other values are possible, which might be overloaded to mean special things
531 * for a special trace.
532 * @author Daniel Lawson
533 */
534int8_t trace_get_direction(const struct libtrace_packet_t *packet);
535
536/** Event types
537 * see \ref libtrace_eventobj_t
538 */
539typedef enum {
540        TRACE_EVENT_IOWAIT,     /**< Need to block on fd */
541        TRACE_EVENT_SLEEP,      /**< Sleep for some time */
542        TRACE_EVENT_PACKET,     /**< packet has arrived */
543        TRACE_EVENT_TERMINATE   /**< End of trace */
544} libtrace_event_t;
545
546/** structure returned by libtrace_event explaining what the current event is */
547struct libtrace_eventobj_t {
548        libtrace_event_t type; /**< event type (iowait,sleep,packet) */
549        int fd;                /**< if IOWAIT, the fd to sleep on */
550        double seconds;        /**< if SLEEP, the amount of time to sleep for */
551        int size;              /**< if PACKET, the value returned from trace_read_packet */
552};
553
554/** process a libtrace event
555 * @param trace the libtrace opaque pointer
556 * @param packet the libtrace_packet opaque pointer
557 * @returns libtrace_event struct containing the type, and potential
558 *      fd or seconds to sleep on
559 *
560 * Type can be:
561 *  TRACE_EVENT_IOWAIT  Waiting on I/O on <fd>
562 *  TRACE_EVENT_SLEEP   Next event in <seconds>
563 *  TRACE_EVENT_PACKET  Packet arrived in <buffer> with size <size>
564 *  TRACE_EVENT_TERMINATE Trace terminated (perhaps with an error condition)
565 */
566struct libtrace_eventobj_t trace_event(struct libtrace_t *trace,
567                struct libtrace_packet_t *packet);
568
569/** setup a BPF filter
570 * @param filterstring a char * containing the bpf filter string
571 * @returns opaque pointer pointer to a libtrace_filter_t object
572 * @author Daniel Lawson
573 * @note The filter is not actually compiled at this point, so no correctness
574 * tests are performed here. trace_bpf_setfilter will always return ok, but
575 * if the filter is poorly constructed an error will be generated when the
576 * filter is actually used
577 */
578struct libtrace_filter_t *trace_bpf_setfilter(const char *filterstring);
579
580/** apply a BPF filter
581 * @param filter        the filter opaque pointer
582 * @param packet        the packet opaque pointer
583 * @returns 0 if the filter fails, 1 if it succeeds
584 * @author Daniel Lawson
585 * @note Due to the way BPF filters are built, the filter is not actually compiled
586 * until the first time trace_bpf_filter is called. If your filter is incorrect, it will generate an error message and assert, exiting the program. This behaviour may change to more graceful handling of this error in the future.
587 */
588int trace_bpf_filter(struct libtrace_filter_t *filter,
589                const struct libtrace_packet_t *packet);
590
591
592typedef enum {USE_DEST, USE_SOURCE} serverport_t;
593
594/** Get the source port
595 * @param packet        the packet to read from
596 * @returns a port in \em HOST byte order, or equivilent to ports for this
597 * protocol, or 0 if this protocol has no ports.
598 * @author Perry Lorier
599 */
600uint16_t trace_get_source_port(const struct libtrace_packet_t *packet);
601
602/** Get the destination port
603 * @param packet        the packet to read from
604 * @returns a port in \em HOST byte order, or equivilent to ports for this
605 * protocol, or 0 if this protocol has no ports.
606 * @author Perry Lorier
607 */
608uint16_t trace_get_destination_port(const struct libtrace_packet_t *packet);
609
610/** hint at the server port in specified protocol
611 * @param protocol      the IP layer protocol, eg 6 (tcp), 17 (udp)
612 * @param source        the source port from the packet
613 * @param dest          the destination port from the packet
614 * @returns one of USE_SOURCE or USE_DEST depending on which one you should use
615 * @note ports must be in \em HOST byte order!
616 * @author Daniel Lawson
617 */
618int8_t trace_get_server_port(uint8_t protocol, uint16_t source, uint16_t dest);
619
620/** Takes a uri and splits it into a format and uridata component.
621 * Primarily for internal use but made available for external use.
622 * @param uri           the uri to be parsed
623 * @param format        destination location for the format component of the uri
624 * @returns 0 if an error occured, otherwise returns the uridata component
625 * @author Shane Alcock
626 */
627char *trace_parse_uri(char *uri, char **format);
628#ifdef __cplusplus
629} // extern "C"
630#endif // #ifdef __cplusplus
631#endif // LIBTRACE_H_
Note: See TracBrowser for help on using the repository browser.