Generic framework for RFC3095-based compression profiles such as IP-only, UDP, UDP-Lite, ESP, and RTP profiles.  
More...
#include "rohc_comp_internals.h"
#include "rohc_packets.h"
#include "protocols/uncomp_pkt_hdrs.h"
#include "schemes/comp_list.h"
#include "ip.h"
#include "crc.h"
#include <stdlib.h>
 
Go to the source code of this file.
 | 
| bool  | rohc_comp_rfc3095_create (struct rohc_comp_ctxt *const context, const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs) | 
|   | Create a new context and initialize it thanks to the given IP packet.  More...
  | 
|   | 
| void  | rohc_comp_rfc3095_destroy (struct rohc_comp_ctxt *const context) | 
|   | Destroy the context.  More...
  | 
|   | 
| rohc_ext_t  | decide_extension (const struct rohc_comp_ctxt *const context, const rohc_packet_t packet_type) | 
|   | Decide what extension shall be used in the UO-1-ID/UOR-2 packet.  More...
  | 
|   | 
| int  | rohc_comp_rfc3095_encode (struct rohc_comp_ctxt *const context, const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs, uint8_t *const rohc_pkt, const size_t rohc_pkt_max_len, rohc_packet_t *const packet_type) | 
|   | Encode an IP packet according to a pattern decided by several different factors.  More...
  | 
|   | 
| bool  | rohc_comp_rfc3095_feedback (struct rohc_comp_ctxt *const context, const enum rohc_feedback_type feedback_type, const uint8_t *const packet, const size_t packet_len, const uint8_t *const feedback_data, const size_t feedback_data_len) | 
|   | Update the profile when feedback is received.  More...
  | 
|   | 
| void  | rohc_get_ipid_bits (const struct rohc_comp_ctxt *const context, bool *const innermost_ip_id_changed, bool *const innermost_ip_id_3bits_possible, bool *const innermost_ip_id_5bits_possible, bool *const innermost_ip_id_8bits_possible, bool *const innermost_ip_id_11bits_possible, bool *const outermost_ip_id_changed, bool *const outermost_ip_id_11bits_possible) | 
|   | Get the number of non-random outer/inner IP-ID bits.  More...
  | 
|   | 
| static size_t  | get_nr_ipv4_non_rnd (const struct rohc_comp_rfc3095_ctxt *const ctxt) | 
|   | How many IP headers are IPv4 headers with non-random IP-IDs ?  More...
  | 
|   | 
| static size_t  | get_nr_ipv4_non_rnd_with_bits (const struct rohc_comp_rfc3095_ctxt *const ctxt) | 
|   | How many IP headers are IPv4 headers with non-random IP-IDs and some bits to transmit ?  More...
  | 
|   | 
| static bool  | does_at_least_one_sid_change (const struct rohc_comp_rfc3095_ctxt *const ctxt, const uint8_t oa_repetitions_nr) | 
|   | at least one SID flag changed now or in the last few packets?  More...
  | 
|   | 
| static bool  | does_at_least_one_rnd_change (const struct rohc_comp_rfc3095_ctxt *const ctxt, const uint8_t oa_repetitions_nr) | 
|   | at least one RND flag changed now or in the last few packets?  More...
  | 
|   | 
Generic framework for RFC3095-based compression profiles such as IP-only, UDP, UDP-Lite, ESP, and RTP profiles. 
- Author
 - Didier Barvaux didie.nosp@m.r.ba.nosp@m.rvaux.nosp@m.@tou.nosp@m.louse.nosp@m..viv.nosp@m.eris..nosp@m.com 
 
- 
Didier Barvaux didie.nosp@m.r@ba.nosp@m.rvaux.nosp@m..org 
 
 
◆ decide_extension()
Decide what extension shall be used in the UO-1-ID/UOR-2 packet. 
Extensions 0, 1 & 2 are IPv4 only because of the IP-ID.
- Parameters
 - 
  
    | context | The compression context  | 
    | packet_type | The type of ROHC packet that is created  | 
  
   
- Returns
 - The extension code among ROHC_EXT_NONE, ROHC_EXT_0, ROHC_EXT_1 and ROHC_EXT_3 if successful, ROHC_EXT_UNKNOWN otherwise 
 
 
 
◆ does_at_least_one_rnd_change()
  
  
      
        
          | static bool does_at_least_one_rnd_change  | 
          ( | 
          const struct rohc_comp_rfc3095_ctxt *const  | 
          ctxt,  | 
         
        
           | 
           | 
          const uint8_t  | 
          oa_repetitions_nr  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inlinestatic   | 
  
 
at least one RND flag changed now or in the last few packets? 
- Parameters
 - 
  
    | ctxt | The generic compression context  | 
    | oa_repetitions_nr | The number of Optimistic Approach repetitions  | 
  
   
- Returns
 - true if at least one RND flag changed now or in last few packets, false otherwise 
 
 
 
◆ does_at_least_one_sid_change()
  
  
      
        
          | static bool does_at_least_one_sid_change  | 
          ( | 
          const struct rohc_comp_rfc3095_ctxt *const  | 
          ctxt,  | 
         
        
           | 
           | 
          const uint8_t  | 
          oa_repetitions_nr  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inlinestatic   | 
  
 
at least one SID flag changed now or in the last few packets? 
- Parameters
 - 
  
    | ctxt | The generic compression context  | 
    | oa_repetitions_nr | The number of Optimistic Approach repetitions  | 
  
   
- Returns
 - true if at least one SID flag changed now or in last few packets, false otherwise 
 
 
 
◆ get_nr_ipv4_non_rnd()
How many IP headers are IPv4 headers with non-random IP-IDs ? 
- Parameters
 - 
  
    | ctxt | The generic decompression context  | 
  
   
- Returns
 - The number of IPv4 headers with non-random IP-ID fields 
 
 
 
◆ get_nr_ipv4_non_rnd_with_bits()
How many IP headers are IPv4 headers with non-random IP-IDs and some bits to transmit ? 
- Parameters
 - 
  
    | ctxt | The generic compression context  | 
  
   
- Returns
 - The number of IPv4 headers with non-random IP-ID fields and some bits to transmit 
 
 
 
◆ rohc_comp_rfc3095_create()
Create a new context and initialize it thanks to the given IP packet. 
- Parameters
 - 
  
    | context | The compression context  | 
    | uncomp_pkt_hdrs | The uncompressed headers to initialize the new context  | 
  
   
- Returns
 - true if successful, false otherwise 
 
 
 
◆ rohc_comp_rfc3095_destroy()
      
        
          | void rohc_comp_rfc3095_destroy  | 
          ( | 
          struct rohc_comp_ctxt *const  | 
          context | ) | 
           | 
        
      
 
Destroy the context. 
This function is one of the functions that must exist in one profile for the framework to work.
- Parameters
 - 
  
    | context | The compression context  | 
  
   
 
 
◆ rohc_comp_rfc3095_encode()
      
        
          | int rohc_comp_rfc3095_encode  | 
          ( | 
          struct rohc_comp_ctxt *const  | 
          context,  | 
        
        
           | 
           | 
          const struct rohc_pkt_hdrs *const  | 
          uncomp_pkt_hdrs,  | 
        
        
           | 
           | 
          uint8_t *const  | 
          rohc_pkt,  | 
        
        
           | 
           | 
          const size_t  | 
          rohc_pkt_max_len,  | 
        
        
           | 
           | 
          rohc_packet_t *const  | 
          packet_type  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Encode an IP packet according to a pattern decided by several different factors. 
- parse uncompressed packet (done in rohc_compress4)
 
- detect changes between the new uncompressed packet and the context
 
- decide new compressor state
 
- determine how many bytes are required for every field
 
- decide which packet to send
 
- code the ROHC header
 
- copy the packet payload (done in rohc_compress4)
 
- update the context with the new headers
This function is one of the functions that must exist in one profile for the framework to work. 
- Parameters
 - 
  
    | context | The compression context  | 
    | uncomp_pkt_hdrs | The uncompressed headers to encode  | 
    | rohc_pkt | OUT: The ROHC packet  | 
    | rohc_pkt_max_len | The maximum length of the ROHC packet  | 
    | packet_type | OUT: The type of ROHC packet that is created  | 
  
   
- Returns
 - The length of the ROHC packet if successful, -1 otherwise 
 
 
 
◆ rohc_comp_rfc3095_feedback()
      
        
          | bool rohc_comp_rfc3095_feedback  | 
          ( | 
          struct rohc_comp_ctxt *const  | 
          context,  | 
        
        
           | 
           | 
          const enum rohc_feedback_type  | 
          feedback_type,  | 
        
        
           | 
           | 
          const uint8_t *const  | 
          packet,  | 
        
        
           | 
           | 
          const size_t  | 
          packet_len,  | 
        
        
           | 
           | 
          const uint8_t *const  | 
          feedback_data,  | 
        
        
           | 
           | 
          const size_t  | 
          feedback_data_len  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Update the profile when feedback is received. 
This function is one of the functions that must exist in one profile for the framework to work.
- Parameters
 - 
  
    | context | The compression context  | 
    | feedback_type | The feedback type  | 
    | packet | The whole feedback packet with CID bits  | 
    | packet_len | The length of the whole feedback packet with CID bits  | 
    | feedback_data | The feedback data without the CID bits  | 
    | feedback_data_len | The length of the feedback data without the CID bits  | 
  
   
- Returns
 - true if the feedback was successfully handled, false if the feedback could not be taken into account 
 
 
 
◆ rohc_get_ipid_bits()
      
        
          | void rohc_get_ipid_bits  | 
          ( | 
          const struct rohc_comp_ctxt *const  | 
          context,  | 
        
        
           | 
           | 
          bool *const  | 
          innermost_ip_id_changed,  | 
        
        
           | 
           | 
          bool *const  | 
          innermost_ip_id_3bits_possible,  | 
        
        
           | 
           | 
          bool *const  | 
          innermost_ip_id_5bits_possible,  | 
        
        
           | 
           | 
          bool *const  | 
          innermost_ip_id_8bits_possible,  | 
        
        
           | 
           | 
          bool *const  | 
          innermost_ip_id_11bits_possible,  | 
        
        
           | 
           | 
          bool *const  | 
          outermost_ip_id_changed,  | 
        
        
           | 
           | 
          bool *const  | 
          outermost_ip_id_11bits_possible  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Get the number of non-random outer/inner IP-ID bits. 
- Parameters
 - 
  
     | context | The compression context  | 
    | [out] | innermost_ip_id_changed | Whether the innermost IP-ID changed  | 
    | [out] | innermost_ip_id_3bits_possible | Whether the innermost IP-ID may be encoded on 3 bits  | 
    | [out] | innermost_ip_id_5bits_possible | Whether the innermost IP-ID may be encoded on 5 bits  | 
    | [out] | innermost_ip_id_8bits_possible | Whether the innermost IP-ID may be encoded on 8 bits  | 
    | [out] | innermost_ip_id_11bits_possible | Whether the innermost IP-ID may be encoded on 11 bits  | 
    | [out] | outermost_ip_id_changed | Whether the outermost IP-ID changed  | 
    | [out] | outermost_ip_id_11bits_possible | Whether the outermost IP-ID may be encoded on 11 bits  |