Changeset fe7b292 for lib/trace.c


Ignore:
Timestamp:
10/20/05 17:41:02 (16 years ago)
Author:
Shane Alcock <salcock@…>
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:
c95b923
Parents:
5496a87
Message:

Fixed issues in set_capture_length regarding the meaning of the parameters and return value

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    r5496a87 rfe7b292  
    13461346 * @param packet        the packet opaque pointer
    13471347 * @param size          the new length of the packet
    1348  * @returns the new length of the packet, or the original length of the
    1349  * packet if unchanged
    1350  * NOTE: len refers to the network-level payload of the packet, and not
     1348 * @returns the new size of the packet
     1349 *
     1350 * NOTE: size and the return size refer to the network-level payload of the packet, and not
    13511351 * any capture headers included as well. For example, to truncate a packet
    1352  * after the IP header, set scan to sizeof(ethernet_header) + sizeof(ip_header)
     1352 * after the IP header, set size to sizeof(ethernet_header) + sizeof(ip_header)
     1353 *
     1354 * If the original network-level payload is smaller than size, then
     1355 * the original size is returned and the packet is left unchanged.
     1356 *
    13531357 * @author Daniel Lawson
    13541358 */
     
    13561360        assert(packet);
    13571361
    1358         if (size > packet->size) {
    1359                 // can't make a packet larger
    1360                 return packet->size;
    1361         }
    1362         if (packet->trace->format->set_capture_length) {
    1363                 return packet->trace->format->set_capture_length(packet,size);
    1364         }
     1362        if (packet->trace->format->truncate_packet) {
     1363                return packet->trace->format->truncate_packet(packet,size);
     1364        }
     1365
    13651366        return -1;
    13661367}
Note: See TracChangeset for help on using the changeset viewer.