ROHC compression/decompression library
|
ROHC compression context for the uncompressed profile. More...
Functions | |
int | c_uncompressed_create (struct c_context *context, const struct ip_packet ip) |
Create a new Uncompressed context and initialize it thanks to the given IP packet. | |
void | c_uncompressed_destroy (struct c_context *context) |
Destroy the Uncompressed context. | |
int | c_uncompressed_check_context (struct c_context *context, const struct ip_packet ip) |
Check if an IP packet belongs to the Uncompressed context. | |
int | c_uncompressed_encode (struct c_context *context, const struct ip_packet ip, int packet_size, unsigned char *dest, int dest_size, int *payload_offset) |
Encode an IP packet according to a pattern decided by several different factors. | |
void | c_uncompressed_feedback (struct c_context *context, struct c_feedback *feedback) |
Update the profile when feedback arrives. | |
void | uncompressed_decide_state (struct c_context *context) |
Decide the state that should be used for the next packet. | |
void | uncompressed_periodic_down_transition (struct c_context *context) |
Periodically change the context state after a certain number of packets. | |
void | uncompressed_change_mode (struct c_context *context, rohc_mode new_mode) |
Change the mode of the context. | |
void | uncompressed_change_state (struct c_context *context, rohc_c_state new_state) |
Change the state of the context. | |
int | uncompressed_code_packet (struct c_context *context, const struct ip_packet ip, unsigned char *dest, int *payload_offset, int dest_size) |
Build the ROHC packet to send. | |
int | uncompressed_code_IR_packet (struct c_context *context, const struct ip_packet ip, unsigned char *dest, int *payload_offset, int dest_size) |
Build the IR packet. | |
int | uncompressed_code_normal_packet (struct c_context *context, const struct ip_packet ip, unsigned char *dest, int *payload_offset, int dest_size) |
Build the Normal packet. | |
Variables | |
struct c_profile | c_uncompressed_profile |
Define the compression part of the Uncompressed profile as described in the RFC 3095. |
ROHC compression context for the uncompressed profile.
int c_uncompressed_check_context | ( | struct c_context * | context, |
const struct ip_packet | ip | ||
) |
Check if an IP packet belongs to the Uncompressed context.
This function is one of the functions that must exist in one profile for the framework to work.
context | The compression context |
ip | The IP packet to check |
int c_uncompressed_create | ( | struct c_context * | context, |
const struct ip_packet | ip | ||
) |
Create a new Uncompressed context and initialize it thanks to the given IP packet.
This function is one of the functions that must exist in one profile for the framework to work.
context | The compression context |
ip | The IP packet given to initialize the new context |
References sc_uncompressed_context::go_back_ir_count, sc_uncompressed_context::ir_count, sc_uncompressed_context::normal_count, rohc_debugf, and c_context::specific.
void c_uncompressed_destroy | ( | struct c_context * | context | ) |
Destroy the Uncompressed context.
This function is one of the functions that must exist in one profile for the framework to work.
context | The compression context |
References c_context::specific, and zfree.
int c_uncompressed_encode | ( | struct c_context * | context, |
const struct ip_packet | ip, | ||
int | packet_size, | ||
unsigned char * | dest, | ||
int | dest_size, | ||
int * | payload_offset | ||
) |
Encode an IP packet according to a pattern decided by several different factors.
1. Decide state
2. Code packet
This function is one of the functions that must exist in one profile for the framework to work.
context | The compression context |
ip | The IP packet to encode |
packet_size | The length of the IP packet to encode |
dest | The rohc-packet-under-build buffer |
dest_size | The length of the rohc-packet-under-build buffer |
payload_offset | The offset for the payload in the IP packet |
References uncompressed_code_packet(), and uncompressed_decide_state().
void c_uncompressed_feedback | ( | struct c_context * | context, |
struct c_feedback * | feedback | ||
) |
Update the profile when feedback arrives.
This function is one of the functions that must exist in one profile for the framework to work.
context | The compression context |
feedback | The feedback information including the whole feedback packet |
References c_feedback::acktype, crc_calculate(), CRC_INIT_8, CRC_TYPE_8, c_feedback::data, IR, rohc_debugf, c_feedback::size, c_feedback::specific_offset, c_feedback::specific_size, c_feedback::type, uncompressed_change_mode(), and uncompressed_change_state().
void uncompressed_change_mode | ( | struct c_context * | context, |
rohc_mode | new_mode | ||
) |
Change the mode of the context.
context | The compression context |
new_mode | The new mode the context must enter in |
References IR, c_context::mode, and uncompressed_change_state().
Referenced by c_uncompressed_feedback().
void uncompressed_change_state | ( | struct c_context * | context, |
rohc_c_state | new_state | ||
) |
Change the state of the context.
context | The compression context |
new_state | The new state the context must enter in |
References sc_uncompressed_context::ir_count, sc_uncompressed_context::normal_count, c_context::specific, and c_context::state.
Referenced by c_uncompressed_feedback(), uncompressed_change_mode(), uncompressed_decide_state(), and uncompressed_periodic_down_transition().
int uncompressed_code_IR_packet | ( | struct c_context * | context, |
const struct ip_packet | ip, | ||
unsigned char * | dest, | ||
int * | payload_offset, | ||
int | dest_size | ||
) |
Build the IR packet.
IR packet (5.10.1) 0 1 2 3 4 5 6 7 --- --- --- --- --- --- --- --- 1 : Add-CID octet : if for small CIDs and (CID != 0) +---+---+---+---+---+---+---+---+ 2 | 1 1 1 1 1 1 0 |res| +---+---+---+---+---+---+---+---+ : : 3 / 0-2 octets of CID info / 1-2 octets if for large CIDs : : +---+---+---+---+---+---+---+---+ 4 | Profile = 0 | 1 octet +---+---+---+---+---+---+---+---+ 5 | CRC | 1 octet +---+---+---+---+---+---+---+---+ : : (optional) 6 / IP packet / variable length : : --- --- --- --- --- --- --- ---
Part 6 is not managed by this function.
context | The compression context |
ip | The IP header |
dest | The rohc-packet-under-build buffer |
payload_offset | OUT: the offset of the payload in the buffer |
dest_size | The maximal size of the ROHC packet |
References c_context::cid, code_cid_values(), crc_calculate(), CRC_INIT_8, CRC_TYPE_8, rohc_debugf, and ROHC_PROFILE_UNCOMPRESSED.
Referenced by uncompressed_code_packet().
int uncompressed_code_normal_packet | ( | struct c_context * | context, |
const struct ip_packet | ip, | ||
unsigned char * | dest, | ||
int * | payload_offset, | ||
int | dest_size | ||
) |
Build the Normal packet.
Normal packet (5.10.2) 0 1 2 3 4 5 6 7 --- --- --- --- --- --- --- --- 1 : Add-CID octet : if for small CIDs and (CID != 0) +---+---+---+---+---+---+---+---+ 2 | first octet of IP packet | +---+---+---+---+---+---+---+---+ : : 3 / 0-2 octets of CID info / 1-2 octets if for large CIDs : : +---+---+---+---+---+---+---+---+ | | 4 / rest of IP packet / variable length | | +---+---+---+---+---+---+---+---+
Part 4 is not managed by this function.
context | The compression context |
ip | The IP header |
dest | The rohc-packet-under-build buffer |
payload_offset | OUT: the offset of the payload in the buffer |
dest_size | The maximal size of the ROHC packet |
References c_context::cid, code_cid_values(), ip_get_raw_data(), and rohc_debugf.
Referenced by uncompressed_code_packet().
int uncompressed_code_packet | ( | struct c_context * | context, |
const struct ip_packet | ip, | ||
unsigned char * | dest, | ||
int * | payload_offset, | ||
int | dest_size | ||
) |
Build the ROHC packet to send.
context | The compression context |
ip | The IP header |
dest | The rohc-packet-under-build buffer |
payload_offset | OUT: the offset of the payload in the buffer |
dest_size | The maximal size of the ROHC packet |
References code_packet(), FO, ip_get_version(), IPV4, IPV6, IR, sc_uncompressed_context::ir_count, sc_uncompressed_context::normal_count, PACKET_IR, PACKET_NORMAL, PACKET_UNKNOWN, rohc_debugf, c_context::specific, c_context::state, uncompressed_code_IR_packet(), and uncompressed_code_normal_packet().
Referenced by c_uncompressed_encode().
void uncompressed_decide_state | ( | struct c_context * | context | ) |
Decide the state that should be used for the next packet.
context | The compression context |
References FO, IR, sc_uncompressed_context::ir_count, MAX_IR_COUNT, c_context::mode, c_context::specific, c_context::state, U_MODE, uncompressed_change_state(), and uncompressed_periodic_down_transition().
Referenced by c_uncompressed_encode().
void uncompressed_periodic_down_transition | ( | struct c_context * | context | ) |
Periodically change the context state after a certain number of packets.
context | The compression context |
References CHANGE_TO_IR_COUNT, FO, sc_uncompressed_context::go_back_ir_count, IR, c_context::specific, c_context::state, and uncompressed_change_state().
Referenced by uncompressed_decide_state().
struct c_profile c_uncompressed_profile |
{ 0, NULL, ROHC_PROFILE_UNCOMPRESSED, "1.0b", "Uncompressed / Compressor", c_uncompressed_create, c_uncompressed_destroy, c_uncompressed_check_context, c_uncompressed_encode, c_uncompressed_feedback, }
Define the compression part of the Uncompressed profile as described in the RFC 3095.