ROHC compression/decompression library
Data Structures | Typedefs | Functions
net_pkt.h File Reference

Network packet (may contains several IP headers) More...

#include "rohc_buf.h"
#include "ip.h"
#include "rohc_traces.h"
#include "dllexport.h"
#include "config.h"
Include dependency graph for net_pkt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  net_pkt

Typedefs

typedef uint32_t rohc_ctxt_key_t

Functions

bool ROHC_EXPORT net_pkt_parse (struct net_pkt *const packet, const struct rohc_buf data, rohc_trace_callback_t trace_cb, rohc_trace_callback2_t trace_cb2, void *const trace_cb_priv, rohc_trace_entity_t trace_entity)
 Parse a network packet.
size_t ROHC_EXPORT net_pkt_get_payload_offset (const struct net_pkt *const packet)
 Get the offset of the IP payload in the given packet.

Detailed Description

Network packet (may contains several IP headers)

Author:
Didier Barvaux <didier.barvaux@toulouse.viveris.com>

Typedef Documentation

typedef uint32_t rohc_ctxt_key_t

The key to help identify (not quaranted unique) a compression context


Function Documentation

size_t ROHC_EXPORT net_pkt_get_payload_offset ( const struct net_pkt *const  packet)

Get the offset of the IP payload in the given packet.

The payload begins after the innermost IP header (and its extension headers).

Parameters:
packetThe packet to get the payload offset for
Returns:
The payload offset (in bytes)
bool ROHC_EXPORT net_pkt_parse ( struct net_pkt *const  packet,
const struct rohc_buf  data,
rohc_trace_callback_t  trace_cb,
rohc_trace_callback2_t  trace_cb2,
void *const  trace_cb_priv,
rohc_trace_entity_t  trace_entity 
)

Parse a network packet.

Parameters:
[out]packetThe parsed packet
dataThe data to parse
trace_cbThe old function to call for printing traces
trace_cb2The new function to call for printing traces
trace_cb_privAn optional private context, may be NULL
trace_entityThe entity that emits the traces
Returns:
true if the packet was successfully parsed, false if a problem occurred (a malformed packet is not considered as an error)