Changeset 39e141f for lib/protocols.c


Ignore:
Timestamp:
04/21/06 10:28:36 (16 years ago)
Author:
Perry Lorier <perry@…>
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
Message:

Merge windows portability fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/protocols.c

    r97e39a7 r39e141f  
    242242#define SW_IP_OFFMASK 0xff1f
    243243
    244 void *trace_get_payload_from_ip(libtrace_ip_t *ipptr, uint8_t *prot,
     244DLLEXPORT void *trace_get_payload_from_ip(libtrace_ip_t *ipptr, uint8_t *prot,
    245245                uint32_t *remaining)
    246246{
     
    307307}
    308308
    309 void *trace_get_transport(libtrace_packet_t *packet,
     309DLLEXPORT void *trace_get_transport(libtrace_packet_t *packet,
    310310                uint8_t *proto,
    311311                uint32_t *remaining
     
    363363}
    364364
    365 libtrace_tcp_t *trace_get_tcp(libtrace_packet_t *packet) {
     365DLLEXPORT libtrace_tcp_t *trace_get_tcp(libtrace_packet_t *packet) {
    366366        uint8_t proto;
    367367        libtrace_tcp_t *tcp;
     
    375375}
    376376
    377 libtrace_tcp_t *trace_get_tcp_from_ip(libtrace_ip_t *ip, uint32_t *remaining)
     377DLLEXPORT libtrace_tcp_t *trace_get_tcp_from_ip(libtrace_ip_t *ip, uint32_t *remaining)
    378378{
    379379        struct libtrace_tcp *tcpptr = 0;
     
    387387}
    388388
    389 libtrace_udp_t *trace_get_udp(libtrace_packet_t *packet) {
     389DLLEXPORT libtrace_udp_t *trace_get_udp(libtrace_packet_t *packet) {
    390390        uint8_t proto;
    391391        libtrace_udp_t *udp;
     
    399399}
    400400
    401 libtrace_udp_t *trace_get_udp_from_ip(libtrace_ip_t *ip, uint32_t *remaining)
     401DLLEXPORT libtrace_udp_t *trace_get_udp_from_ip(libtrace_ip_t *ip, uint32_t *remaining)
    402402{
    403403        struct libtrace_udp *udpptr = 0;
     
    411411}
    412412
    413 libtrace_icmp_t *trace_get_icmp(libtrace_packet_t *packet) {
     413DLLEXPORT libtrace_icmp_t *trace_get_icmp(libtrace_packet_t *packet) {
    414414        uint8_t proto;
    415415        libtrace_icmp_t *icmp;
     
    423423}
    424424
    425 libtrace_icmp_t *trace_get_icmp_from_ip(libtrace_ip_t *ip, uint32_t *remaining)
     425DLLEXPORT libtrace_icmp_t *trace_get_icmp_from_ip(libtrace_ip_t *ip, uint32_t *remaining)
    426426{
    427427        libtrace_icmp_t *icmpptr = 0;
     
    435435}
    436436
    437 void *trace_get_payload_from_udp(libtrace_udp_t *udp, uint32_t *remaining)
     437DLLEXPORT void *trace_get_payload_from_udp(libtrace_udp_t *udp, uint32_t *remaining)
    438438{
    439439        if (remaining) {
     
    445445}
    446446
    447 void *trace_get_payload_from_tcp(libtrace_tcp_t *tcp, uint32_t *remaining)
     447DLLEXPORT void *trace_get_payload_from_tcp(libtrace_tcp_t *tcp, uint32_t *remaining)
    448448{
    449449        unsigned int dlen = tcp->doff*4;
     
    456456}
    457457
    458 void *trace_get_payload_from_icmp(libtrace_icmp_t *icmp, uint32_t *remaining)
     458DLLEXPORT void *trace_get_payload_from_icmp(libtrace_icmp_t *icmp, uint32_t *remaining)
    459459{
    460460        if (remaining) {
     
    473473/* Return the client port
    474474 */
    475 uint16_t trace_get_source_port(const libtrace_packet_t *packet)
     475DLLEXPORT uint16_t trace_get_source_port(const libtrace_packet_t *packet)
    476476{
    477477        struct ports_t *port =
     
    486486
    487487/* Same as get_source_port except use the destination port */
    488 uint16_t trace_get_destination_port(const libtrace_packet_t *packet)
     488DLLEXPORT uint16_t trace_get_destination_port(const libtrace_packet_t *packet)
    489489{
    490490        struct ports_t *port =
     
    530530}
    531531
    532 uint8_t *trace_get_destination_mac(libtrace_packet_t *packet) {
     532DLLEXPORT uint8_t *trace_get_destination_mac(libtrace_packet_t *packet) {
    533533        void *link = trace_get_link(packet);
    534534        libtrace_80211_t *wifi;
     
    562562}
    563563
    564 struct sockaddr *trace_get_source_address(const libtrace_packet_t *packet,
     564DLLEXPORT struct sockaddr *trace_get_source_address(const libtrace_packet_t *packet,
    565565                struct sockaddr *addr)
    566566{
     
    616616}
    617617
    618 struct sockaddr *trace_get_destination_address(const libtrace_packet_t *packet,
     618DLLEXPORT struct sockaddr *trace_get_destination_address(const libtrace_packet_t *packet,
    619619                struct sockaddr *addr)
    620620{
     
    688688 * @author Perry Lorier
    689689 */
    690 int trace_get_next_option(unsigned char **ptr,int *len,
     690DLLEXPORT int trace_get_next_option(unsigned char **ptr,int *len,
    691691                        unsigned char *type,
    692692                        unsigned char *optlen,
Note: See TracChangeset for help on using the changeset viewer.