ROHC compression/decompression library
|
Bitwised operations for ROHC compression/decompression. More...
#include <endian.h>
Go to the source code of this file.
Defines | |
#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. | |
#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. |
Bitwised operations for ROHC compression/decompression.
#define GET_BIT_0 | ( | x | ) | ((*(x)) & 0x01) |
#define GET_BIT_0_2 | ( | x | ) | ((*(x)) & 0x07) |
Referenced by d_feedback_headersize(), d_feedback_size(), decode_extension0(), decode_extension1(), decode_extension2(), decode_uo0(), and decode_uo1().
#define GET_BIT_0_3 | ( | x | ) | ((*(x)) & 0x0f) |
Referenced by d_decode_add_cid(), and d_decode_static_ip6().
#define GET_BIT_0_4 | ( | x | ) | ((*(x)) & 0x1f) |
Referenced by d_sdvalue_decode(), decode_uo1(), and decode_uor2().
#define GET_BIT_0_5 | ( | x | ) | ((*(x)) & 0x3f) |
Referenced by d_sdvalue_decode(), decode_uo1(), and decode_uor2().
#define GET_BIT_0_6 | ( | x | ) | ((*(x)) & 0x7f) |
Referenced by d_sdvalue_decode(), decode_extension3(), and decode_uor2().
#define GET_BIT_0_7 | ( | x | ) | ((*(x)) & 0xff) |
Referenced by d_decode_dynamic_ip4(), d_decode_dynamic_ip6(), d_decode_static_ip4(), d_decode_static_ip6(), d_feedback_size(), d_is_irdyn(), d_is_padding(), d_sdvalue_decode(), decode_extension1(), decode_extension2(), decode_extension3(), decode_uor2(), rtp_decode_dynamic_rtp(), and uncompressed_decode().
#define GET_BIT_1 | ( | x | ) | ((*(x)) & 0x02) |
Referenced by decode_extension3(), decode_inner_header_flags(), and get_bit_index().
#define GET_BIT_1_7 | ( | x | ) | ( ((*(x)) & 0xfe) >> 1 ) |
Referenced by d_is_ir(), and d_is_segment().
#define GET_BIT_2 | ( | x | ) | ((*(x)) & 0x04) |
Referenced by decode_extension3(), decode_inner_header_flags(), and get_bit_index().
#define GET_BIT_3 | ( | x | ) | ((*(x)) & 0x08) |
Referenced by decode_extension3(), decode_inner_header_flags(), and get_bit_index().
#define GET_BIT_3_4 | ( | x | ) | ( ((*(x)) & 0x18) >> 3 ) |
Referenced by decode_extension3().
#define GET_BIT_3_5 | ( | x | ) | ( ((*(x)) & 0x38) >> 3 ) |
Referenced by decode_extension0(), decode_extension1(), and decode_extension2().
#define GET_BIT_3_6 | ( | x | ) | ( ((*(x)) & 0x78) >> 3 ) |
Referenced by decode_uo0(), and decode_uo1().
#define GET_BIT_3_7 | ( | x | ) | ( ((*(x)) & 0xf8) >> 3 ) |
Referenced by d_is_feedback(), and decode_uo1().
#define GET_BIT_4 | ( | x | ) | ((*(x)) & 0x10) |
Referenced by decode_extension3(), decode_inner_header_flags(), and get_bit_index().
#define GET_BIT_4_6 | ( | x | ) | ( ((*(x)) & 0x70) >> 4 ) |
#define GET_BIT_4_7 | ( | x | ) | ( ((*(x)) & 0xf0) >> 4 ) |
Referenced by d_decode_static_ip(), d_decode_static_ip4(), d_decode_static_ip6(), and d_is_add_cid().
#define GET_BIT_5 | ( | x | ) | ((*(x)) & 0x20) |
Referenced by d_decode_dynamic_ip4(), decode_extension3(), decode_inner_header_flags(), decode_uo1(), find_packet_type(), and get_bit_index().
#define GET_BIT_5_7 | ( | x | ) | ( ((*(x)) & 0xe0) >> 5 ) |
Referenced by d_sdvalue_decode(), d_sdvalue_size(), decode_uor2(), and find_packet_type().
#define GET_BIT_6 | ( | x | ) | ((*(x)) & 0x40) |
Referenced by d_decode_dynamic_ip4(), decode_inner_header_flags(), decode_uor2(), find_packet_type(), and get_bit_index().
#define GET_BIT_6_7 | ( | x | ) | ( ((*(x)) & 0xc0) >> 6 ) |
Referenced by d_sdvalue_decode(), d_sdvalue_size(), decode_extension3(), decode_uo1(), extension_type(), and find_packet_type().
#define GET_BIT_7 | ( | x | ) | ((*(x)) & 0x80) |
#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.
Referenced by d_decode_dynamic_ip4(), decode_extension3(), decode_outer_header_flags(), decode_uo0(), decode_uo1(), decode_uor2(), ip_decode_dynamic_ip(), rtp_decode_dynamic_rtp(), rtp_decode_uo_tail_rtp(), udp_decode_dynamic_udp(), udp_decode_static_udp(), udp_decode_uo_tail_udp(), udp_lite_decode_dynamic_udp(), and udp_lite_decode_uo_tail_udp().
#define GET_REAL | ( | x | ) | ((x) ? 1 : 0) |
Convert GET_BIT_* values to 0 or 1.
example: GET_REAL(GET_BIT_5(data_ptr));
Referenced by d_decode_dynamic_ip4(), d_generic_detect_ir_size(), decode_extension3(), decode_inner_header_flags(), decode_outer_header_flags(), decode_uo1(), and decode_uor2().