ReactOS 0.4.16-dev-258-g81860b4
ip4.h File Reference
#include "lwip/arch.h"
#include "lwip/ip4_addr.h"
Include dependency graph for ip4.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ip4_addr_packed
 
struct  ip_hdr
 

Macros

#define IP_HLEN   20
 
#define IP_HLEN_MAX   60
 
#define IP_RF   0x8000U /* reserved fragment flag */
 
#define IP_DF   0x4000U /* don't fragment flag */
 
#define IP_MF   0x2000U /* more fragments flag */
 
#define IP_OFFMASK   0x1fffU /* mask for fragmenting bits */
 
#define IPH_V(hdr)   ((hdr)->_v_hl >> 4)
 
#define IPH_HL(hdr)   ((hdr)->_v_hl & 0x0f)
 
#define IPH_HL_BYTES(hdr)   ((u8_t)(IPH_HL(hdr) * 4))
 
#define IPH_TOS(hdr)   ((hdr)->_tos)
 
#define IPH_LEN(hdr)   ((hdr)->_len)
 
#define IPH_ID(hdr)   ((hdr)->_id)
 
#define IPH_OFFSET(hdr)   ((hdr)->_offset)
 
#define IPH_OFFSET_BYTES(hdr)   ((u16_t)((lwip_ntohs(IPH_OFFSET(hdr)) & IP_OFFMASK) * 8U))
 
#define IPH_TTL(hdr)   ((hdr)->_ttl)
 
#define IPH_PROTO(hdr)   ((hdr)->_proto)
 
#define IPH_CHKSUM(hdr)   ((hdr)->_chksum)
 
#define IPH_VHL_SET(hdr, v, hl)   (hdr)->_v_hl = (u8_t)((((v) << 4) | (hl)))
 
#define IPH_TOS_SET(hdr, tos)   (hdr)->_tos = (tos)
 
#define IPH_LEN_SET(hdr, len)   (hdr)->_len = (len)
 
#define IPH_ID_SET(hdr, id)   (hdr)->_id = (id)
 
#define IPH_OFFSET_SET(hdr, off)   (hdr)->_offset = (off)
 
#define IPH_TTL_SET(hdr, ttl)   (hdr)->_ttl = (u8_t)(ttl)
 
#define IPH_PROTO_SET(hdr, proto)   (hdr)->_proto = (u8_t)(proto)
 
#define IPH_CHKSUM_SET(hdr, chksum)   (hdr)->_chksum = (chksum)
 

Typedefs

typedef typedefPACK_STRUCT_END struct ip4_addr_packed ip4_addr_p_t
 

Variables

PACK_STRUCT_BEGIN struct ip4_addr_packed PACK_STRUCT_STRUCT
 

Detailed Description

IPv4 protocol definitions

Definition in file ip4.h.

Macro Definition Documentation

◆ IP_DF

#define IP_DF   0x4000U /* don't fragment flag */

Definition at line 85 of file ip4.h.

◆ IP_HLEN

#define IP_HLEN   20

Definition at line 64 of file ip4.h.

◆ IP_HLEN_MAX

#define IP_HLEN_MAX   60

Definition at line 66 of file ip4.h.

◆ IP_MF

#define IP_MF   0x2000U /* more fragments flag */

Definition at line 86 of file ip4.h.

◆ IP_OFFMASK

#define IP_OFFMASK   0x1fffU /* mask for fragmenting bits */

Definition at line 87 of file ip4.h.

◆ IP_RF

#define IP_RF   0x8000U /* reserved fragment flag */

Definition at line 84 of file ip4.h.

◆ IPH_CHKSUM

#define IPH_CHKSUM (   hdr)    ((hdr)->_chksum)

Definition at line 114 of file ip4.h.

◆ IPH_CHKSUM_SET

#define IPH_CHKSUM_SET (   hdr,
  chksum 
)    (hdr)->_chksum = (chksum)

Definition at line 124 of file ip4.h.

◆ IPH_HL

#define IPH_HL (   hdr)    ((hdr)->_v_hl & 0x0f)

Definition at line 105 of file ip4.h.

◆ IPH_HL_BYTES

#define IPH_HL_BYTES (   hdr)    ((u8_t)(IPH_HL(hdr) * 4))

Definition at line 106 of file ip4.h.

◆ IPH_ID

#define IPH_ID (   hdr)    ((hdr)->_id)

Definition at line 109 of file ip4.h.

◆ IPH_ID_SET

#define IPH_ID_SET (   hdr,
  id 
)    (hdr)->_id = (id)

Definition at line 120 of file ip4.h.

◆ IPH_LEN

#define IPH_LEN (   hdr)    ((hdr)->_len)

Definition at line 108 of file ip4.h.

◆ IPH_LEN_SET

#define IPH_LEN_SET (   hdr,
  len 
)    (hdr)->_len = (len)

Definition at line 119 of file ip4.h.

◆ IPH_OFFSET

#define IPH_OFFSET (   hdr)    ((hdr)->_offset)

Definition at line 110 of file ip4.h.

◆ IPH_OFFSET_BYTES

#define IPH_OFFSET_BYTES (   hdr)    ((u16_t)((lwip_ntohs(IPH_OFFSET(hdr)) & IP_OFFMASK) * 8U))

Definition at line 111 of file ip4.h.

◆ IPH_OFFSET_SET

#define IPH_OFFSET_SET (   hdr,
  off 
)    (hdr)->_offset = (off)

Definition at line 121 of file ip4.h.

◆ IPH_PROTO

#define IPH_PROTO (   hdr)    ((hdr)->_proto)

Definition at line 113 of file ip4.h.

◆ IPH_PROTO_SET

#define IPH_PROTO_SET (   hdr,
  proto 
)    (hdr)->_proto = (u8_t)(proto)

Definition at line 123 of file ip4.h.

◆ IPH_TOS

#define IPH_TOS (   hdr)    ((hdr)->_tos)

Definition at line 107 of file ip4.h.

◆ IPH_TOS_SET

#define IPH_TOS_SET (   hdr,
  tos 
)    (hdr)->_tos = (tos)

Definition at line 118 of file ip4.h.

◆ IPH_TTL

#define IPH_TTL (   hdr)    ((hdr)->_ttl)

Definition at line 112 of file ip4.h.

◆ IPH_TTL_SET

#define IPH_TTL_SET (   hdr,
  ttl 
)    (hdr)->_ttl = (u8_t)(ttl)

Definition at line 122 of file ip4.h.

◆ IPH_V

#define IPH_V (   hdr)    ((hdr)->_v_hl >> 4)

Definition at line 104 of file ip4.h.

◆ IPH_VHL_SET

#define IPH_VHL_SET (   hdr,
  v,
  hl 
)    (hdr)->_v_hl = (u8_t)((((v) << 4) | (hl)))

Definition at line 117 of file ip4.h.

Typedef Documentation

◆ ip4_addr_p_t

typedef typedefPACK_STRUCT_END struct ip4_addr_packed ip4_addr_p_t

Definition at line 61 of file ip4.h.

Variable Documentation

◆ PACK_STRUCT_STRUCT

PACK_STRUCT_BEGIN struct ip_hdr PACK_STRUCT_STRUCT