Changeset ffc8c8d for lib/format_wag.c


Ignore:
Timestamp:
08/11/05 11:30:41 (16 years ago)
Author:
Daniel Lawson <dlawson@…>
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:
4d5a9a7
Parents:
a8ba977
Message:

better return codes in format_*.c, trace_perror stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_wag.c

    r39b37d2 rffc8c8d  
    4747#endif
    4848#include <sys/types.h>
     49#include <sys/time.h>
     50#include <time.h>
    4951#include <sys/socket.h>
    5052#include <sys/un.h>
     
    145147                }
    146148        }
     149        return 1;
    147150}
    148151
     
    239242
    240243                // wag isn't in network byte order yet
    241                 size = htons(size);
     244                //size = htons(size);
    242245                //printf("%d %d\n",size,htons(size));
    243246
     
    280283        uint64_t timestamp = 0;
    281284        timestamp = wagptr->ts.subsecs;
    282         timestamp |= (uint64_t)wagptr->ts.secs<<32;
     285        //timestamp |= (uint64_t)wagptr->ts.secs<<32;
    283286        timestamp = ((timestamp%44000000)*(UINT_MAX/44000000))
    284287                | ((timestamp/44000000)<<32);
     
    288291static int wag_get_capture_length(const struct libtrace_packet_t *packet) {
    289292        struct wag_data_frame *wagptr = (struct wag_data_frame *)packet->buffer;
    290         return (wagptr->hdr.size);
    291         //return ntohs(wagptr->hdr.size);
     293        //return (wagptr->hdr.size);
     294        return ntohs(wagptr->hdr.size);
    292295}
    293296
    294297static int wag_get_wire_length(const struct libtrace_packet_t *packet) {
    295298        struct wag_data_frame *wagptr = (struct wag_data_frame *)packet->buffer;
    296         return (wagptr->hdr.size);
    297         //return ntohs(wagptr->hdr.size);
     299        //return (wagptr->hdr.size);
     300        return ntohs(wagptr->hdr.size);
    298301}
    299302
     
    340343        wag_get_direction,              /* get_direction */
    341344        NULL,                           /* set_direction */
    342         wag_get_erf_timestamp,          /* get_wag_timestamp */
     345        wag_get_erf_timestamp,          /* get_erf_timestamp */
    343346        NULL,                           /* get_timeval */
    344347        NULL,                           /* get_seconds */
Note: See TracChangeset for help on using the changeset viewer.