Changeset 58e9e02 for lib/libtrace.h
- Timestamp:
- 04/28/05 15:22:40 (17 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:
- a6badc2
- Parents:
- 48cfaed
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/libtrace.h
r7bb7dda r58e9e02 34 34 #include <sys/types.h> 35 35 #include <netinet/in.h> 36 37 /** API version as 3 byte hex digits */ 38 #define LIBTRACE_API_VERSION 0x010010 36 39 37 40 #ifdef __cplusplus … … 239 242 * @returns a pointer to the IP header, or NULL if there is not an IP packet 240 243 */ 241 struct libtrace_ip *trace_get_ip( struct libtrace_packet_t *packet);244 struct libtrace_ip *trace_get_ip(const struct libtrace_packet_t *packet); 242 245 243 246 /** get a pointer to the TCP header (if any) … … 246 249 * @returns a pointer to the TCP header, or NULL if there is not a TCP packet 247 250 */ 248 struct libtrace_tcp *trace_get_tcp( struct libtrace_packet_t *packet);251 struct libtrace_tcp *trace_get_tcp(const struct libtrace_packet_t *packet); 249 252 250 253 /** get a pointer to the TCP header (if any) given a pointer to the IP header … … 265 268 * @returns a pointer to the UDP header, or NULL if this is not a UDP packet 266 269 */ 267 struct libtrace_udp *trace_get_udp( struct libtrace_packet_t *packet);270 struct libtrace_udp *trace_get_udp(const struct libtrace_packet_t *packet); 268 271 269 272 /** get a pointer to the UDP header (if any) given a pointer to the IP header … … 282 285 * @returns a pointer to the ICMP header, or NULL if this is not a ICMP packet 283 286 */ 284 struct libtrace_icmp *trace_get_icmp( struct libtrace_packet_t *packet);287 struct libtrace_icmp *trace_get_icmp(const struct libtrace_packet_t *packet); 285 288 286 289 /** get a pointer to the ICMP header (if any) given a pointer to the IP header … … 479 482 */ 480 483 int trace_bpf_filter(struct libtrace_filter_t *filter, 481 struct libtrace_packet_t *packet);484 const struct libtrace_packet_t *packet); 482 485 483 486 484 487 typedef enum {USE_DEST, USE_SOURCE} serverport_t; 488 489 /** Get the source port 490 * @param packet the packet to read from 491 * @returns a port in \em HOST byte order, or equivilent to ports for this 492 * protocol, or 0 if this protocol has no ports. 493 * @author Perry Lorier 494 */ 495 uint16_t trace_get_source_port(const struct libtrace_packet_t *); 496 497 /** Get the destination port 498 * @param packet the packet to read from 499 * @returns a port in \em HOST byte order, or equivilent to ports for this 500 * protocol, or 0 if this protocol has no ports. 501 * @author Perry Lorier 502 */ 503 uint16_t trace_get_destination_port(const struct libtrace_packet_t *); 485 504 486 505 /** hint at the server port in specified protocol
Note: See TracChangeset
for help on using the changeset viewer.