Go to the documentation of this file.
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
56 #define IP_PROTO_TCP 6
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 (u8_t)0x02U
99 #define SOF_REUSEADDR (u8_t)0x04U
100 #define SOF_KEEPALIVE (u8_t)0x08U
102 #define SOF_BROADCAST (u8_t)0x20U
104 #define SOF_LINGER (u8_t)0x80U
109 #define SOF_INHERITED (SOF_REUSEADDR|SOF_KEEPALIVE|SOF_LINGER)
112 #ifdef PACK_STRUCT_USE_INCLUDES
113 # include "arch/bpstruct.h"
128 #define IP_OFFMASK 0x1fff
140 #ifdef PACK_STRUCT_USE_INCLUDES
141 # include "arch/epstruct.h"
144 #define IPH_V(hdr) (ntohs((hdr)->_v_hl_tos) >> 12)
145 #define IPH_HL(hdr) ((ntohs((hdr)->_v_hl_tos) >> 8) & 0x0f)
146 #define IPH_TOS(hdr) (ntohs((hdr)->_v_hl_tos) & 0xff)
147 #define IPH_LEN(hdr) ((hdr)->_len)
148 #define IPH_ID(hdr) ((hdr)->_id)
149 #define IPH_OFFSET(hdr) ((hdr)->_offset)
150 #define IPH_TTL(hdr) ((hdr)->_ttl)
151 #define IPH_PROTO(hdr) ((hdr)->_proto)
152 #define IPH_CHKSUM(hdr) ((hdr)->_chksum)
154 #define IPH_VHLTOS_SET(hdr, v, hl, tos) (hdr)->_v_hl_tos = (htons(((v) << 12) | ((hl) << 8) | (tos)))
155 #define IPH_LEN_SET(hdr, len) (hdr)->_len = (len)
156 #define IPH_ID_SET(hdr, id) (hdr)->_id = (id)
157 #define IPH_OFFSET_SET(hdr, off) (hdr)->_offset = (off)
158 #define IPH_TTL_SET(hdr, ttl) (hdr)->_ttl = (u8_t)(ttl)
159 #define IPH_PROTO_SET(hdr, proto) (hdr)->_proto = (u8_t)(proto)
160 #define IPH_CHKSUM_SET(hdr, chksum) (hdr)->_chksum = (chksum)
179 #if LWIP_NETIF_HWADDRHINT
191 #define ip_current_netif() (current_netif)
195 #define ip_current_header() (current_header)
197 #define ip_current_src_addr() (¤t_iphdr_src)
199 #define ip_current_dest_addr() (¤t_iphdr_dest)
204 #define ip_debug_print(p)