lib/dp-packet.c
/* Shifts all of the data within the allocated space in 'b' by 'delta' bytes.
 * For example, a 'delta' of 1 would cause each byte of data to move one byte
 * forward (from address 'p' to 'p+1'), and a 'delta' of -1 would cause each
 * byte to move one byte backward (from 'p' to 'p-1'). */
Shifts all of the data within the allocated space in 'b' by 'delta' bytes.
Shifts all of the data within the allocated space in ' b ' by ' delta ' bytes .
void
dp_packet_shift(struct dp_packet *b, int delta)
{
    ovs_assert(delta > 0 ? delta <= dp_packet_tailroom(b)
               : delta < 0 ? -delta <= dp_packet_headroom(b)
               : true);
    if (delta != 0) {
        char *dst = (char *) dp_packet_data(b) + delta;
        memmove(dst, dp_packet_data(b), dp_packet_size(b));
        dp_packet_set_data(b, dst);
    }
}
void dp_packet_shift ( struct dp_packet * b , int delta ) { ovs_assert ( delta > 0 ? delta <= dp_packet_tailroom ( b ) : delta < 0 ? - delta <= dp_packet_headroom ( b ) : true ) ; if ( delta != 0 ) { char * dst = ( char * ) dp_packet_data ( b ) + delta ; memmove ( dst , dp_packet_data ( b ) , dp_packet_size ( b ) ) ; dp_packet_set_data ( b , dst ) ; } }
Shifts all of the data within the allocated space in 'b' by 'delta' bytes.
Shifts all of the data within the allocated space in ' b ' by ' delta ' bytes .