ROHC compression/decompression library
|
Bitwised operations for ROHC compression/decompression. More...
#include "config.h"
Go to the source code of this file.
Macros | |
#define | GET_BIT_0(x) ((*(x)) & 0x01) |
#define | GET_BIT_1(x) ((*(x)) & 0x02) |
#define | GET_BIT_2(x) ((*(x)) & 0x04) |
#define | GET_BIT_3(x) ((*(x)) & 0x08) |
#define | GET_BIT_4(x) ((*(x)) & 0x10) |
#define | GET_BIT_5(x) ((*(x)) & 0x20) |
#define | GET_BIT_6(x) ((*(x)) & 0x40) |
#define | GET_BIT_7(x) ((*(x)) & 0x80) |
#define | GET_BIT_0_2(x) ((*(x)) & 0x07) |
#define | GET_BIT_0_4(x) ((*(x)) & 0x1f) |
#define | GET_BIT_0_3(x) ((*(x)) & 0x0f) |
#define | GET_BIT_0_5(x) ((*(x)) & 0x3f) |
#define | GET_BIT_0_6(x) ((*(x)) & 0x7f) |
#define | GET_BIT_0_7(x) ((*(x)) & 0xff) |
#define | GET_BIT_1_7(x) ( ((*(x)) & 0xfe) >> 1 ) |
#define | GET_BIT_3_4(x) ( ((*(x)) & 0x18) >> 3 ) |
#define | GET_BIT_3_5(x) ( ((*(x)) & 0x38) >> 3 ) |
#define | GET_BIT_3_6(x) ( ((*(x)) & 0x78) >> 3 ) |
#define | GET_BIT_3_7(x) ( ((*(x)) & 0xf8) >> 3 ) |
#define | GET_BIT_4_7(x) ( ((*(x)) & 0xf0) >> 4 ) |
#define | GET_BIT_5_7(x) ( ((*(x)) & 0xe0) >> 5 ) |
#define | GET_BIT_6_7(x) ( ((*(x)) & 0xc0) >> 6 ) |
#define | GET_BIT_4_6(x) ( ((*(x)) & 0x70) >> 4 ) |
#define | GET_REAL(x) ((x) ? 1 : 0) |
Convert GET_BIT_* values to 0 or 1. More... | |
#define | GET_BOOL(x) ((x) ? true : false) |
Convert GET_BIT_* values to boolean. More... | |
#define | GET_NEXT_16_BITS(x) ((((*((x) + 1)) << 8) & 0xff00) | ((*(x)) & 0x00ff)) |
Get the next 16 bits at the given memory location in Network Byte Order. More... | |
#define | APPEND_BITS(field_descr, ext_no, field, field_nr, bits, bits_nr, max) |
#define | APPEND_SN_BITS(ext_no, base, bits, bits_nr) |
#define | APPEND_OUTER_IP_ID_BITS(ext_no, base, bits, bits_nr) |
#define | APPEND_INNER_IP_ID_BITS(ext_no, base, bits, bits_nr) |
#define | APPEND_TS_BITS(ext_no, base, bits, bits_nr) |
Bitwised operations for ROHC compression/decompression.
#define APPEND_BITS | ( | field_descr, | |
ext_no, | |||
field, | |||
field_nr, | |||
bits, | |||
bits_nr, | |||
max | |||
) |
Append new LSB bits to already extracted bits
#define APPEND_INNER_IP_ID_BITS | ( | ext_no, | |
base, | |||
bits, | |||
bits_nr | |||
) |
Inner IP-ID: append new LSB bits to already extracted bits
#define APPEND_OUTER_IP_ID_BITS | ( | ext_no, | |
base, | |||
bits, | |||
bits_nr | |||
) |
Outer IP-ID: append new LSB bits to already extracted bits
#define APPEND_SN_BITS | ( | ext_no, | |
base, | |||
bits, | |||
bits_nr | |||
) |
SN: append new LSB bits to already extracted bits
#define APPEND_TS_BITS | ( | ext_no, | |
base, | |||
bits, | |||
bits_nr | |||
) |
TS: append new LSB bits to already extracted bits
#define GET_BIT_0 | ( | x | ) | ((*(x)) & 0x01) |
#define GET_BIT_0_2 | ( | x | ) | ((*(x)) & 0x07) |
#define GET_BIT_0_3 | ( | x | ) | ((*(x)) & 0x0f) |
#define GET_BIT_0_4 | ( | x | ) | ((*(x)) & 0x1f) |
#define GET_BIT_0_5 | ( | x | ) | ((*(x)) & 0x3f) |
#define GET_BIT_0_6 | ( | x | ) | ((*(x)) & 0x7f) |
#define GET_BIT_0_7 | ( | x | ) | ((*(x)) & 0xff) |
#define GET_BIT_1 | ( | x | ) | ((*(x)) & 0x02) |
#define GET_BIT_1_7 | ( | x | ) | ( ((*(x)) & 0xfe) >> 1 ) |
#define GET_BIT_2 | ( | x | ) | ((*(x)) & 0x04) |
#define GET_BIT_3 | ( | x | ) | ((*(x)) & 0x08) |
#define GET_BIT_3_4 | ( | x | ) | ( ((*(x)) & 0x18) >> 3 ) |
#define GET_BIT_3_5 | ( | x | ) | ( ((*(x)) & 0x38) >> 3 ) |
#define GET_BIT_3_6 | ( | x | ) | ( ((*(x)) & 0x78) >> 3 ) |
#define GET_BIT_3_7 | ( | x | ) | ( ((*(x)) & 0xf8) >> 3 ) |
#define GET_BIT_4 | ( | x | ) | ((*(x)) & 0x10) |
#define GET_BIT_4_6 | ( | x | ) | ( ((*(x)) & 0x70) >> 4 ) |
#define GET_BIT_4_7 | ( | x | ) | ( ((*(x)) & 0xf0) >> 4 ) |
#define GET_BIT_5 | ( | x | ) | ((*(x)) & 0x20) |
#define GET_BIT_5_7 | ( | x | ) | ( ((*(x)) & 0xe0) >> 5 ) |
#define GET_BIT_6 | ( | x | ) | ((*(x)) & 0x40) |
#define GET_BIT_6_7 | ( | x | ) | ( ((*(x)) & 0xc0) >> 6 ) |
#define GET_BIT_7 | ( | x | ) | ((*(x)) & 0x80) |
#define GET_BOOL | ( | x | ) | ((x) ? true : false) |
Convert GET_BIT_* values to boolean.
example: GET_BOOL(GET_BIT_5(data_ptr));
#define GET_NEXT_16_BITS | ( | x | ) | ((((*((x) + 1)) << 8) & 0xff00) | ((*(x)) & 0x00ff)) |
Get the next 16 bits at the given memory location in Network Byte Order.
#define GET_REAL | ( | x | ) | ((x) ? 1 : 0) |
Convert GET_BIT_* values to 0 or 1.
example: GET_REAL(GET_BIT_5(data_ptr));