ROHC compression/decompression library
Data Structures | Macros | Functions
ipv4.h File Reference

The IPv4 header. More...

#include "rohc_utils.h"
#include <stdint.h>
#include "config.h"
Include dependency graph for ipv4.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ipv4_hdr
 The IPv4 header. More...
 

Macros

#define IPV4_ADDR_FORMAT   "%02x%02x%02x%02x (%u.%u.%u.%u)"
 
#define IPV4_ADDR_RAW(x)
 
#define IPV4_RF   0x8000
 
#define IPV4_DF   0x4000
 
#define IPV4_MF   0x2000
 
#define IPV4_OFFMASK   0x1fff
 

Functions

static bool ipv4_is_fragment (const struct ipv4_hdr *const ipv4)
 Whether the IPv4 packet is fragmented or not. More...
 

Detailed Description

The IPv4 header.

Author
Didier Barvaux didie.nosp@m.r@ba.nosp@m.rvaux.nosp@m..org

Macro Definition Documentation

◆ IPV4_ADDR_FORMAT

#define IPV4_ADDR_FORMAT   "%02x%02x%02x%02x (%u.%u.%u.%u)"

The format to print an IPv4 address

◆ IPV4_ADDR_RAW

#define IPV4_ADDR_RAW (   x)
Value:
(x)[0], (x)[1], (x)[2], (x)[3], \
(x)[0], (x)[1], (x)[2], (x)[3]

The data to print an IPv4 address in raw format

◆ IPV4_DF

#define IPV4_DF   0x4000

Mask for Don't Fragment (DF) flag

◆ IPV4_MF

#define IPV4_MF   0x2000

Mask for More Fragments (MF) flag

◆ IPV4_OFFMASK

#define IPV4_OFFMASK   0x1fff

mask for Fragment Offset field

◆ IPV4_RF

#define IPV4_RF   0x8000

Mask for reserved flag

Function Documentation

◆ ipv4_is_fragment()

static bool ipv4_is_fragment ( const struct ipv4_hdr *const  ipv4)
inlinestatic

Whether the IPv4 packet is fragmented or not.

The IPv4 packet shall be at least sizeof(struct ipv4_hdr) long.

Parameters
ipv4The IPv4 packet to check
Returns
true if the IPv4 packet is a fragment, false if the IPv4 packet is not a fragment