sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
ip4.h File Reference
#include "lwip/arch.h"
#include "lwip/ip4_addr.h"

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
#define IP_DF   0x4000U
#define IP_MF   0x2000U
#define IP_OFFMASK   0x1fffU
#define IPH_V(hdr)
#define IPH_HL(hdr)
#define IPH_HL_BYTES(hdr)
#define IPH_TOS(hdr)
#define IPH_LEN(hdr)
#define IPH_ID(hdr)
#define IPH_OFFSET(hdr)
#define IPH_OFFSET_BYTES(hdr)
#define IPH_TTL(hdr)
#define IPH_PROTO(hdr)
#define IPH_CHKSUM(hdr)
#define IPH_VHL_SET(hdr, v, hl)
#define IPH_TOS_SET(hdr, tos)
#define IPH_LEN_SET(hdr, len)
#define IPH_ID_SET(hdr, id)
#define IPH_OFFSET_SET(hdr, off)
#define IPH_TTL_SET(hdr, ttl)
#define IPH_PROTO_SET(hdr, proto)
#define IPH_CHKSUM_SET(hdr, 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

Definition at line 86 of file ip4.h.

◆ IP_HLEN

#define IP_HLEN   20

Definition at line 65 of file ip4.h.

◆ IP_HLEN_MAX

#define IP_HLEN_MAX   60

Definition at line 67 of file ip4.h.

◆ IP_MF

#define IP_MF   0x2000U

Definition at line 87 of file ip4.h.

◆ IP_OFFMASK

#define IP_OFFMASK   0x1fffU

Definition at line 88 of file ip4.h.

◆ IP_RF

#define IP_RF   0x8000U

Definition at line 85 of file ip4.h.

◆ IPH_CHKSUM

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

Definition at line 115 of file ip4.h.

◆ IPH_CHKSUM_SET

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

Definition at line 125 of file ip4.h.

◆ IPH_HL

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

Definition at line 106 of file ip4.h.

◆ IPH_HL_BYTES

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

Definition at line 107 of file ip4.h.

◆ IPH_ID

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

Definition at line 110 of file ip4.h.

◆ IPH_ID_SET

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

Definition at line 121 of file ip4.h.

◆ IPH_LEN

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

Definition at line 109 of file ip4.h.

◆ IPH_LEN_SET

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

Definition at line 120 of file ip4.h.

◆ IPH_OFFSET

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

Definition at line 111 of file ip4.h.

◆ IPH_OFFSET_BYTES

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

Definition at line 112 of file ip4.h.

◆ IPH_OFFSET_SET

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

Definition at line 122 of file ip4.h.

◆ IPH_PROTO

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

Definition at line 114 of file ip4.h.

◆ IPH_PROTO_SET

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

Definition at line 124 of file ip4.h.

◆ IPH_TOS

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

Definition at line 108 of file ip4.h.

◆ IPH_TOS_SET

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

Definition at line 119 of file ip4.h.

◆ IPH_TTL

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

Definition at line 113 of file ip4.h.

◆ IPH_TTL_SET

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

Definition at line 123 of file ip4.h.

◆ IPH_V

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

Definition at line 105 of file ip4.h.

◆ IPH_VHL_SET

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

Definition at line 118 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 62 of file ip4.h.