32 #ifndef LWIP_HDR_IP4_H 33 #define LWIP_HDR_IP4_H 50 #ifdef LWIP_HOOK_IP4_ROUTE_SRC 51 #define LWIP_IPV4_SRC_ROUTING 1 53 #define LWIP_IPV4_SRC_ROUTING 0 57 #define IP_OPTIONS_SEND (LWIP_IPV4 && LWIP_IGMP) 62 #ifdef PACK_STRUCT_USE_INCLUDES 80 #define IP_OFFMASK 0x1fffU 92 #ifdef PACK_STRUCT_USE_INCLUDES 96 #define IPH_V(hdr) ((hdr)->_v_hl >> 4) 97 #define IPH_HL(hdr) ((hdr)->_v_hl & 0x0f) 98 #define IPH_TOS(hdr) ((hdr)->_tos) 99 #define IPH_LEN(hdr) ((hdr)->_len) 100 #define IPH_ID(hdr) ((hdr)->_id) 101 #define IPH_OFFSET(hdr) ((hdr)->_offset) 102 #define IPH_TTL(hdr) ((hdr)->_ttl) 103 #define IPH_PROTO(hdr) ((hdr)->_proto) 104 #define IPH_CHKSUM(hdr) ((hdr)->_chksum) 106 #define IPH_VHL_SET(hdr, v, hl) (hdr)->_v_hl = (u8_t)((((v) << 4) | (hl))) 107 #define IPH_TOS_SET(hdr, tos) (hdr)->_tos = (tos) 108 #define IPH_LEN_SET(hdr, len) (hdr)->_len = (len) 109 #define IPH_ID_SET(hdr, id) (hdr)->_id = (id) 110 #define IPH_OFFSET_SET(hdr, off) (hdr)->_offset = (off) 111 #define IPH_TTL_SET(hdr, ttl) (hdr)->_ttl = (u8_t)(ttl) 112 #define IPH_PROTO_SET(hdr, proto) (hdr)->_proto = (u8_t)(proto) 113 #define IPH_CHKSUM_SET(hdr, chksum) (hdr)->_chksum = (chksum) 116 struct netif *ip4_route(
const ip4_addr_t *dest);
117 #if LWIP_IPV4_SRC_ROUTING 118 struct netif *ip4_route_src(
const ip4_addr_t *dest,
const ip4_addr_t *src);
120 #define ip4_route_src(dest, src) ip4_route(dest) 123 err_t ip4_output(
struct pbuf *p,
const ip4_addr_t *src,
const ip4_addr_t *dest,
125 err_t ip4_output_if(
struct pbuf *p,
const ip4_addr_t *src,
const ip4_addr_t *dest,
127 err_t ip4_output_if_src(
struct pbuf *p,
const ip4_addr_t *src,
const ip4_addr_t *dest,
129 #if LWIP_NETIF_HWADDRHINT 130 err_t ip4_output_hinted(
struct pbuf *p,
const ip4_addr_t *src,
const ip4_addr_t *dest,
134 err_t ip4_output_if_opt(
struct pbuf *p,
const ip4_addr_t *src,
const ip4_addr_t *dest,
137 err_t ip4_output_if_opt_src(
struct pbuf *p,
const ip4_addr_t *src,
const ip4_addr_t *dest,
142 #if LWIP_MULTICAST_TX_OPTIONS 143 void ip4_set_default_multicast_netif(
struct netif* default_multicast_netif);
146 #define ip4_netif_get_local_ip(netif) (((netif) != NULL) ? netif_ip_addr4(netif) : NULL) 149 void ip4_debug_print(
struct pbuf *p);
151 #define ip4_debug_print(p) #define PACK_STRUCT_STRUCT
#define PACK_STRUCT_FLD_8(x)
#define PACK_STRUCT_FIELD(x)
#define PACK_STRUCT_FLD_S(x)
#define PACK_STRUCT_BEGIN