ConOpSys V2970  P004.07
ANVILEX control operating system
Classes | Macros | Typedefs | Variables
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

Macro Definition Documentation

◆ IP_DF

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

◆ IP_HLEN

#define IP_HLEN   20

◆ IP_HLEN_MAX

#define IP_HLEN_MAX   60

◆ IP_MF

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

◆ IP_OFFMASK

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

◆ IP_RF

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

◆ IPH_CHKSUM

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

◆ IPH_CHKSUM_SET

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

◆ IPH_HL

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

◆ IPH_HL_BYTES

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

◆ IPH_ID

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

◆ IPH_ID_SET

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

◆ IPH_LEN

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

◆ IPH_LEN_SET

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

◆ IPH_OFFSET

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

◆ IPH_OFFSET_BYTES

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

◆ IPH_OFFSET_SET

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

◆ IPH_PROTO

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

◆ IPH_PROTO_SET

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

◆ IPH_TOS

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

◆ IPH_TOS_SET

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

◆ IPH_TTL

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

◆ IPH_TTL_SET

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

◆ IPH_V

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

◆ IPH_VHL_SET

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

Typedef Documentation

◆ ip4_addr_p_t

typedef typedefPACK_STRUCT_END struct ip4_addr_packed ip4_addr_p_t

Variable Documentation

◆ PACK_STRUCT_STRUCT

PACK_STRUCT_BEGIN struct ip_hdr PACK_STRUCT_STRUCT