ConOpSys V2970
P004.07
ANVILEX control operating system
|
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 |
IPv4 protocol definitions
#define IP_DF 0x4000U /* don't fragment flag */ |
#define IP_HLEN 20 |
#define IP_HLEN_MAX 60 |
#define IP_MF 0x2000U /* more fragments flag */ |
#define IP_OFFMASK 0x1fffU /* mask for fragmenting bits */ |
#define IP_RF 0x8000U /* reserved fragment flag */ |
#define IPH_CHKSUM | ( | hdr | ) | ((hdr)->_chksum) |
#define IPH_CHKSUM_SET | ( | hdr, | |
chksum | |||
) | (hdr)->_chksum = (chksum) |
#define IPH_HL | ( | hdr | ) | ((hdr)->_v_hl & 0x0f) |
#define IPH_ID | ( | hdr | ) | ((hdr)->_id) |
#define IPH_ID_SET | ( | hdr, | |
id | |||
) | (hdr)->_id = (id) |
#define IPH_LEN | ( | hdr | ) | ((hdr)->_len) |
#define IPH_LEN_SET | ( | hdr, | |
len | |||
) | (hdr)->_len = (len) |
#define IPH_OFFSET | ( | hdr | ) | ((hdr)->_offset) |
#define IPH_OFFSET_BYTES | ( | hdr | ) | ((u16_t)((lwip_ntohs(IPH_OFFSET(hdr)) & IP_OFFMASK) * 8U)) |
#define IPH_OFFSET_SET | ( | hdr, | |
off | |||
) | (hdr)->_offset = (off) |
#define IPH_PROTO | ( | hdr | ) | ((hdr)->_proto) |
#define IPH_PROTO_SET | ( | hdr, | |
proto | |||
) | (hdr)->_proto = (u8_t)(proto) |
#define IPH_TOS | ( | hdr | ) | ((hdr)->_tos) |
#define IPH_TOS_SET | ( | hdr, | |
tos | |||
) | (hdr)->_tos = (tos) |
#define IPH_TTL | ( | hdr | ) | ((hdr)->_ttl) |
#define IPH_TTL_SET | ( | hdr, | |
ttl | |||
) | (hdr)->_ttl = (u8_t)(ttl) |
#define IPH_V | ( | hdr | ) | ((hdr)->_v_hl >> 4) |
#define IPH_VHL_SET | ( | hdr, | |
v, | |||
hl | |||
) | (hdr)->_v_hl = (u8_t)((((v) << 4) | (hl))) |
typedef typedefPACK_STRUCT_END struct ip4_addr_packed ip4_addr_p_t |
PACK_STRUCT_BEGIN struct ip_hdr PACK_STRUCT_STRUCT |