Changeset 39e141f for lib/protocols.c
- Timestamp:
- 04/21/06 10:28:36 (16 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:
- 222d8f5
- Parents:
- d0906e7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/protocols.c
r97e39a7 r39e141f 242 242 #define SW_IP_OFFMASK 0xff1f 243 243 244 void *trace_get_payload_from_ip(libtrace_ip_t *ipptr, uint8_t *prot,244 DLLEXPORT void *trace_get_payload_from_ip(libtrace_ip_t *ipptr, uint8_t *prot, 245 245 uint32_t *remaining) 246 246 { … … 307 307 } 308 308 309 void *trace_get_transport(libtrace_packet_t *packet,309 DLLEXPORT void *trace_get_transport(libtrace_packet_t *packet, 310 310 uint8_t *proto, 311 311 uint32_t *remaining … … 363 363 } 364 364 365 libtrace_tcp_t *trace_get_tcp(libtrace_packet_t *packet) {365 DLLEXPORT libtrace_tcp_t *trace_get_tcp(libtrace_packet_t *packet) { 366 366 uint8_t proto; 367 367 libtrace_tcp_t *tcp; … … 375 375 } 376 376 377 libtrace_tcp_t *trace_get_tcp_from_ip(libtrace_ip_t *ip, uint32_t *remaining)377 DLLEXPORT libtrace_tcp_t *trace_get_tcp_from_ip(libtrace_ip_t *ip, uint32_t *remaining) 378 378 { 379 379 struct libtrace_tcp *tcpptr = 0; … … 387 387 } 388 388 389 libtrace_udp_t *trace_get_udp(libtrace_packet_t *packet) {389 DLLEXPORT libtrace_udp_t *trace_get_udp(libtrace_packet_t *packet) { 390 390 uint8_t proto; 391 391 libtrace_udp_t *udp; … … 399 399 } 400 400 401 libtrace_udp_t *trace_get_udp_from_ip(libtrace_ip_t *ip, uint32_t *remaining)401 DLLEXPORT libtrace_udp_t *trace_get_udp_from_ip(libtrace_ip_t *ip, uint32_t *remaining) 402 402 { 403 403 struct libtrace_udp *udpptr = 0; … … 411 411 } 412 412 413 libtrace_icmp_t *trace_get_icmp(libtrace_packet_t *packet) {413 DLLEXPORT libtrace_icmp_t *trace_get_icmp(libtrace_packet_t *packet) { 414 414 uint8_t proto; 415 415 libtrace_icmp_t *icmp; … … 423 423 } 424 424 425 libtrace_icmp_t *trace_get_icmp_from_ip(libtrace_ip_t *ip, uint32_t *remaining)425 DLLEXPORT libtrace_icmp_t *trace_get_icmp_from_ip(libtrace_ip_t *ip, uint32_t *remaining) 426 426 { 427 427 libtrace_icmp_t *icmpptr = 0; … … 435 435 } 436 436 437 void *trace_get_payload_from_udp(libtrace_udp_t *udp, uint32_t *remaining)437 DLLEXPORT void *trace_get_payload_from_udp(libtrace_udp_t *udp, uint32_t *remaining) 438 438 { 439 439 if (remaining) { … … 445 445 } 446 446 447 void *trace_get_payload_from_tcp(libtrace_tcp_t *tcp, uint32_t *remaining)447 DLLEXPORT void *trace_get_payload_from_tcp(libtrace_tcp_t *tcp, uint32_t *remaining) 448 448 { 449 449 unsigned int dlen = tcp->doff*4; … … 456 456 } 457 457 458 void *trace_get_payload_from_icmp(libtrace_icmp_t *icmp, uint32_t *remaining)458 DLLEXPORT void *trace_get_payload_from_icmp(libtrace_icmp_t *icmp, uint32_t *remaining) 459 459 { 460 460 if (remaining) { … … 473 473 /* Return the client port 474 474 */ 475 uint16_t trace_get_source_port(const libtrace_packet_t *packet)475 DLLEXPORT uint16_t trace_get_source_port(const libtrace_packet_t *packet) 476 476 { 477 477 struct ports_t *port = … … 486 486 487 487 /* Same as get_source_port except use the destination port */ 488 uint16_t trace_get_destination_port(const libtrace_packet_t *packet)488 DLLEXPORT uint16_t trace_get_destination_port(const libtrace_packet_t *packet) 489 489 { 490 490 struct ports_t *port = … … 530 530 } 531 531 532 uint8_t *trace_get_destination_mac(libtrace_packet_t *packet) {532 DLLEXPORT uint8_t *trace_get_destination_mac(libtrace_packet_t *packet) { 533 533 void *link = trace_get_link(packet); 534 534 libtrace_80211_t *wifi; … … 562 562 } 563 563 564 struct sockaddr *trace_get_source_address(const libtrace_packet_t *packet,564 DLLEXPORT struct sockaddr *trace_get_source_address(const libtrace_packet_t *packet, 565 565 struct sockaddr *addr) 566 566 { … … 616 616 } 617 617 618 struct sockaddr *trace_get_destination_address(const libtrace_packet_t *packet,618 DLLEXPORT struct sockaddr *trace_get_destination_address(const libtrace_packet_t *packet, 619 619 struct sockaddr *addr) 620 620 { … … 688 688 * @author Perry Lorier 689 689 */ 690 int trace_get_next_option(unsigned char **ptr,int *len,690 DLLEXPORT int trace_get_next_option(unsigned char **ptr,int *len, 691 691 unsigned char *type, 692 692 unsigned char *optlen,
Note: See TracChangeset
for help on using the changeset viewer.