39#include "lwip/ip_addr.h"
48#define IP_OPTIONS_SEND LWIP_IGMP
52#define IP_PROTO_ICMP 1
53#define IP_PROTO_IGMP 2
54#define IP_PROTO_UDP 17
55#define IP_PROTO_UDPLITE 136
64#define IP_HDRINCL NULL
66#if LWIP_NETIF_HWADDRHINT
67#define IP_PCB_ADDRHINT ;u8_t addr_hint
69#define IP_PCB_ADDRHINT
79 ip_addr_t remote_ip; \
98#define SOF_ACCEPTCONN 0x02U
99#define SOF_REUSEADDR 0x04U
100#define SOF_KEEPALIVE 0x08U
102#define SOF_BROADCAST 0x20U
104#define SOF_LINGER 0x80U
109#define SOF_INHERITED (SOF_REUSEADDR|SOF_KEEPALIVE|SOF_LINGER)
112#ifdef PACK_STRUCT_USE_INCLUDES
130#define IP_OFFMASK 0x1fffU
142#ifdef PACK_STRUCT_USE_INCLUDES
146#define IPH_V(hdr) ((hdr)->_v_hl >> 4)
147#define IPH_HL(hdr) ((hdr)->_v_hl & 0x0f)
148#define IPH_TOS(hdr) ((hdr)->_tos)
149#define IPH_LEN(hdr) ((hdr)->_len)
150#define IPH_ID(hdr) ((hdr)->_id)
151#define IPH_OFFSET(hdr) ((hdr)->_offset)
152#define IPH_TTL(hdr) ((hdr)->_ttl)
153#define IPH_PROTO(hdr) ((hdr)->_proto)
154#define IPH_CHKSUM(hdr) ((hdr)->_chksum)
156#define IPH_VHL_SET(hdr, v, hl) (hdr)->_v_hl = (((v) << 4) | (hl))
157#define IPH_TOS_SET(hdr, tos) (hdr)->_tos = (tos)
158#define IPH_LEN_SET(hdr, len) (hdr)->_len = (len)
159#define IPH_ID_SET(hdr, id) (hdr)->_id = (id)
160#define IPH_OFFSET_SET(hdr, off) (hdr)->_offset = (off)
161#define IPH_TTL_SET(hdr, ttl) (hdr)->_ttl = (u8_t)(ttl)
162#define IPH_PROTO_SET(hdr, proto) (hdr)->_proto = (u8_t)(proto)
163#define IPH_CHKSUM_SET(hdr, chksum) (hdr)->_chksum = (chksum)
182#if LWIP_NETIF_HWADDRHINT
194#define ip_current_netif() (current_netif)
198#define ip_current_header() (current_header)
200#define ip_current_src_addr() (¤t_iphdr_src)
202#define ip_current_dest_addr() (¤t_iphdr_dest)
205#define ip_get_option(pcb, opt) ((pcb)->so_options & (opt))
207#define ip_set_option(pcb, opt) ((pcb)->so_options |= (opt))
209#define ip_reset_option(pcb, opt) ((pcb)->so_options &= ~(opt))
214#define ip_debug_print(p)
#define PACK_STRUCT_BEGIN
const struct ip_hdr * current_header
ip_addr_t current_iphdr_src
err_t ip_input(struct pbuf *p, struct netif *inp)
err_t ip_output_if(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest, u8_t ttl, u8_t tos, u8_t proto, struct netif *netif)
ip_addr_t current_iphdr_dest
#define ip_debug_print(p)
struct netif * current_netif
err_t ip_output(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest, u8_t ttl, u8_t tos, u8_t proto)
PACK_STRUCT_BEGIN struct ip_hdr PACK_STRUCT_STRUCT
struct netif * ip_route(ip_addr_t *dest)
typedefPACK_STRUCT_END struct ip_addr ip_addr_t
PACK_STRUCT_FIELD(u8_t _ttl)
PACK_STRUCT_FIELD(u8_t _tos)
PACK_STRUCT_FIELD(u16_t _offset)
PACK_STRUCT_FIELD(u8_t _v_hl)
PACK_STRUCT_FIELD(u8_t _proto)
PACK_STRUCT_FIELD(ip_addr_p_t src)
PACK_STRUCT_FIELD(u16_t _chksum)
PACK_STRUCT_FIELD(u16_t _id)
PACK_STRUCT_FIELD(ip_addr_p_t dest)
PACK_STRUCT_FIELD(u16_t _len)