Changeset 52f8fc2 for lib/trace.c


Ignore:
Timestamp:
02/23/06 13:14:32 (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:
8ea5b38
Parents:
aa62105
Message:

Cleanup some uses of packet->trace where the trace is already available!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    r91c9552 r52f8fc2  
    558558 *
    559559 */
    560 int trace_read_packet(struct libtrace_t *libtrace, struct libtrace_packet_t *packet) {
     560int trace_read_packet(libtrace_t *libtrace, libtrace_packet_t *packet) {
    561561
    562562        assert(libtrace && "You called trace_read_packet() with a NULL libtrace parameter!\n");
     
    10271027 * @author Daniel Lawson
    10281028 */
    1029 uint64_t trace_get_erf_timestamp(const struct libtrace_packet_t *packet) {
     1029uint64_t trace_get_erf_timestamp(const libtrace_packet_t *packet) {
    10301030        uint64_t timestamp = 0;
    10311031        double seconds = 0.0;
     
    10581058 * @author Perry Lorier
    10591059 */
    1060 struct timeval trace_get_timeval(const struct libtrace_packet_t *packet) {
     1060struct timeval trace_get_timeval(const libtrace_packet_t *packet) {
    10611061        struct timeval tv;
    10621062        uint64_t ts = 0;
     
    11211121}
    11221122
    1123 /* Get the size of the packet in the trace
    1124  * @param packet        the packet opaque pointer
    1125  * @returns the size of the packet in the trace
    1126  * @author Perry Lorier
    1127  * @note The return size refers to the network-level payload of the packet and
    1128  * does not include any capture headers. For example, an Ethernet packet with
    1129  * an empty TCP packet will return sizeof(ethernet_header) + sizeof(ip_header)
    1130  * + sizeof(tcp_header).
    1131  * @note Due to this being a header capture, or anonymisation, this may not
    1132  * be the same size as the original packet.  See trace_get_wire_length() for the
    1133  * original size of the packet.
    1134  * @note This can (and often is) different for different packets in a trace!
    1135  * @note This is sometimes called the "snaplen".
    1136  */
    11371123int trace_get_capture_length(const struct libtrace_packet_t *packet) {
    11381124
     
    11731159 */
    11741160SIMPLE_FUNCTION
    1175 int trace_get_framing_length(const struct libtrace_packet_t *packet) {
     1161int trace_get_framing_length(const libtrace_packet_t *packet) {
    11761162        if (packet->trace->format->get_framing_length) {
    11771163                return packet->trace->format->get_framing_length(packet);
     
    11871173 * @author Daniel Lawson
    11881174 */
    1189 libtrace_linktype_t trace_get_link_type(const struct libtrace_packet_t *packet ) {
     1175libtrace_linktype_t trace_get_link_type(const libtrace_packet_t *packet ) {
    11901176        if (packet->trace->format->get_link_type) {
    11911177                return packet->trace->format->get_link_type(packet);
Note: See TracChangeset for help on using the changeset viewer.