ROHC compression/decompression library
Classes | Functions
c_uncompressed.h File Reference

ROHC compression context for the uncompressed profile. More...

#include "rohc_comp.h"
Include dependency graph for c_uncompressed.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sc_uncompressed_context
 The Uncompressed context. More...

Functions

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 *c, rohc_mode new_mode)
 Change the mode of the context.
void uncompressed_change_state (struct c_context *c, 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.

Detailed Description

ROHC compression context for the uncompressed profile.

Author:
Didier Barvaux <didier.barvaux@toulouse.viveris.com>
The hackers from ROHC for Linux

Function Documentation

void uncompressed_change_mode ( struct c_context context,
rohc_mode  new_mode 
)

Change the mode of the context.

Parameters:
contextThe compression context
new_modeThe 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.

Parameters:
contextThe compression context
new_stateThe 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.

Parameters:
contextThe compression context
ipThe IP header
destThe rohc-packet-under-build buffer
payload_offsetOUT: the offset of the payload in the buffer
dest_sizeThe maximal size of the ROHC packet
Returns:
The position in the rohc-packet-under-build buffer if successful, -1 otherwise

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.

Parameters:
contextThe compression context
ipThe IP header
destThe rohc-packet-under-build buffer
payload_offsetOUT: the offset of the payload in the buffer
dest_sizeThe maximal size of the ROHC packet
Returns:
The position in the rohc-packet-under-build buffer if successful, -1 otherwise

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.

Parameters:
contextThe compression context
ipThe IP header
destThe rohc-packet-under-build buffer
payload_offsetOUT: the offset of the payload in the buffer
dest_sizeThe maximal size of the ROHC packet
Returns:
The position in the rohc-packet-under-build buffer if successful, -1 otherwise

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.

Parameters:
contextThe 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().

Periodically change the context state after a certain number of packets.

Parameters:
contextThe 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().