PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
tcpip.h File Reference
#include <tamtypes.h>
+ Include dependency graph for tcpip.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pbuf
 
struct  ip4_addr
 
struct  ip6_addr
 
struct  netif
 
struct  in_addr
 
struct  in6_addr
 
struct  sockaddr_in
 
struct  sockaddr
 
struct  sockaddr_storage
 
struct  fd_set
 
struct  hostent
 
struct  addrinfo
 
struct  t_ip_info
 
union  in6_addr.un
 

Macros

#define PS2IP_DNS
 
#define PS2IP_DHCP   1
 
#define LWIP_IPV4   1
 
#define LWIP_IPV6   0
 
#define LWIP_IPV6_MLD   0
 
#define LWIP_CHECKSUM_CTRL_PER_NETIF   0
 
#define LWIP_NETIF_REMOVE_CALLBACK   0
 
#define LWIP_IPV6_AUTOCONFIG   0
 
#define LWIP_MULTICAST_TX_OPTIONS   0
 
#define LWIP_DHCP   1
 
#define LWIP_TCP   1
 
#define LWIP_UDP   1
 
#define LWIP_UDPLITE   0
 
#define MIB2_STATS   0
 
#define ENABLE_LOOPBACK   0
 
#define DNS_LOCAL_HOSTLIST   0
 
#define MEMP_NUM_UDP_PCB   4
 
#define MEMP_NUM_TCP_PCB   5
 
#define MEMP_NUM_NETCONN   (MEMP_NUM_TCP_PCB + MEMP_NUM_UDP_PCB)
 
#define LWIP_NETIF_STATUS_CALLBACK   0
 
#define LWIP_NETIF_LINK_CALLBACK   0
 
#define LWIP_AUTOIP   0
 
#define LWIP_NETIF_HOSTNAME   0
 
#define LWIP_SNMP   0
 
#define LWIP_IGMP   0
 
#define LWIP_NETIF_HWADDRHINT   0
 
#define LWIP_LOOPBACK_MAX_PBUFS   0
 
#define LWIP_NUM_NETIF_CLIENT_DATA   0
 
#define LWIP_SOCKET_OFFSET   0
 
#define LWIP_IPV6_SEND_ROUTER_SOLICIT   1
 
#define DNS_MAX_SERVERS   2
 
#define PBUF_TRANSPORT_HLEN   20
 
#define PBUF_IP_HLEN   20
 
#define IPADDR_NONE   ((u32)0xffffffffUL)
 
#define IPADDR_LOOPBACK   ((u32)0x7f000001UL)
 
#define IPADDR_ANY   ((u32)0x00000000UL)
 
#define IPADDR_BROADCAST   ((u32)0xffffffffUL)
 
#define IP_CLASSA(a)   ((((u32)(a)) & 0x80000000UL) == 0)
 
#define IP_CLASSA_NET   0xff000000
 
#define IP_CLASSA_NSHIFT   24
 
#define IP_CLASSA_HOST   (0xffffffff & ~IP_CLASSA_NET)
 
#define IP_CLASSA_MAX   128
 
#define IP_CLASSB(a)   ((((u32)(a)) & 0xc0000000UL) == 0x80000000UL)
 
#define IP_CLASSB_NET   0xffff0000
 
#define IP_CLASSB_NSHIFT   16
 
#define IP_CLASSB_HOST   (0xffffffff & ~IP_CLASSB_NET)
 
#define IP_CLASSB_MAX   65536
 
#define IP_CLASSC(a)   ((((u32)(a)) & 0xe0000000UL) == 0xc0000000UL)
 
#define IP_CLASSC_NET   0xffffff00
 
#define IP_CLASSC_NSHIFT   8
 
#define IP_CLASSC_HOST   (0xffffffff & ~IP_CLASSC_NET)
 
#define IP_CLASSD(a)   (((u32)(a)&0xf0000000UL) == 0xe0000000UL)
 
#define IP_CLASSD_NET   0xf0000000 /* These ones aren't really */
 
#define IP_CLASSD_NSHIFT   28 /* net and host fields, but */
 
#define IP_CLASSD_HOST   0x0fffffff /* routing needn't know. */
 
#define IP_MULTICAST(a)   IP_CLASSD(a)
 
#define IP_EXPERIMENTAL(a)   (((u32)(a)&0xf0000000UL) == 0xf0000000UL)
 
#define IP_BADCLASS(a)   (((u32)(a)&0xf0000000UL) == 0xf0000000UL)
 
#define IP_LOOPBACKNET   127 /* official! */
 
#define IP4_ADDR(ipaddr, a, b, c, d)
 
#define IPADDR2_COPY(dest, src)   memcpy(dest, src, sizeof(ip4_addr_t))
 
#define ip4_addr_copy(dest, src)   ((dest).addr = (src).addr)
 
#define ip4_addr_set(dest, src)
 
#define ip4_addr_set_zero(ipaddr)   ((ipaddr)->addr = 0)
 
#define ip4_addr_set_any(ipaddr)   ((ipaddr)->addr = IPADDR_ANY)
 
#define ip4_addr_set_loopback(ipaddr)   ((ipaddr)->addr = PP_HTONL(IPADDR_LOOPBACK))
 
#define ip4_addr_isloopback(ipaddr)   (((ipaddr)->addr & PP_HTONL(IP_CLASSA_NET)) == PP_HTONL(((u32)IP_LOOPBACKNET) << 24))
 
#define ip4_addr_set_hton(dest, src)
 
#define ip4_addr_set_u32(dest_ipaddr, src_u32)   ((dest_ipaddr)->addr = (src_u32))
 
#define ip4_addr_get_u32(src_ipaddr)   ((src_ipaddr)->addr)
 
#define ip4_addr_get_network(target, host, netmask)
 
#define ip4_addr_netcmp(addr1, addr2, mask)
 
#define ip4_addr_cmp(addr1, addr2)   ((addr1)->addr == (addr2)->addr)
 
#define ip4_addr_isany_val(addr1)   ((addr1).addr == IPADDR_ANY)
 
#define ip4_addr_isany(addr1)   ((addr1) == NULL || ip4_addr_isany_val(*(addr1)))
 
#define ip4_addr_isbroadcast(addr1, netif)   ip4_addr_isbroadcast_u32((addr1)->addr, netif)
 
#define ip_addr_netmask_valid(netmask)   ip4_addr_netmask_valid((netmask)->addr)
 
#define ip4_addr_ismulticast(addr1)   (((addr1)->addr & PP_HTONL(0xf0000000UL)) == PP_HTONL(0xe0000000UL))
 
#define ip4_addr_islinklocal(addr1)   (((addr1)->addr & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xa9fe0000UL))
 
#define ip4_addr_debug_print_parts(debug, a, b, c, d)    LWIP_DEBUGF(debug, ("%" U16_F ".%" U16_F ".%" U16_F ".%" U16_F, a, b, c, d))
 
#define ip4_addr_debug_print(debug, ipaddr)
 
#define ip4_addr_debug_print_val(debug, ipaddr)
 
#define ip4_addr1(ipaddr)   (((const u8 *)(&(ipaddr)->addr))[0])
 
#define ip4_addr2(ipaddr)   (((const u8 *)(&(ipaddr)->addr))[1])
 
#define ip4_addr3(ipaddr)   (((const u8 *)(&(ipaddr)->addr))[2])
 
#define ip4_addr4(ipaddr)   (((const u8 *)(&(ipaddr)->addr))[3])
 
#define ip4_addr1_16(ipaddr)   ((u16)ip4_addr1(ipaddr))
 
#define ip4_addr2_16(ipaddr)   ((u16)ip4_addr2(ipaddr))
 
#define ip4_addr3_16(ipaddr)   ((u16)ip4_addr3(ipaddr))
 
#define ip4_addr4_16(ipaddr)   ((u16)ip4_addr4(ipaddr))
 
#define IP4ADDR_STRLEN_MAX   16
 
#define IP6_ADDR_PART(ip6addr, index, a, b, c, d)
 
#define IP6_ADDR(ip6addr, idx0, idx1, idx2, idx3)
 
#define IP6_ADDR_BLOCK1(ip6addr)   ((u16)((lwip_htonl((ip6addr)->addr[0]) >> 16) & 0xffff))
 
#define IP6_ADDR_BLOCK2(ip6addr)   ((u16)((lwip_htonl((ip6addr)->addr[0])) & 0xffff))
 
#define IP6_ADDR_BLOCK3(ip6addr)   ((u16)((lwip_htonl((ip6addr)->addr[1]) >> 16) & 0xffff))
 
#define IP6_ADDR_BLOCK4(ip6addr)   ((u16)((lwip_htonl((ip6addr)->addr[1])) & 0xffff))
 
#define IP6_ADDR_BLOCK5(ip6addr)   ((u16)((lwip_htonl((ip6addr)->addr[2]) >> 16) & 0xffff))
 
#define IP6_ADDR_BLOCK6(ip6addr)   ((u16)((lwip_htonl((ip6addr)->addr[2])) & 0xffff))
 
#define IP6_ADDR_BLOCK7(ip6addr)   ((u16)((lwip_htonl((ip6addr)->addr[3]) >> 16) & 0xffff))
 
#define IP6_ADDR_BLOCK8(ip6addr)   ((u16)((lwip_htonl((ip6addr)->addr[3])) & 0xffff))
 
#define ip6_addr_copy(dest, src)
 
#define ip6_addr_set(dest, src)
 
#define ip6_addr_set_zero(ip6addr)
 
#define ip6_addr_set_any(ip6addr)   ip6_addr_set_zero(ip6addr)
 
#define ip6_addr_set_loopback(ip6addr)
 
#define ip6_addr_set_hton(dest, src)
 
#define ip6_addr_netcmp(addr1, addr2)
 
#define ip6_addr_cmp(addr1, addr2)
 
#define ip6_get_subnet_id(ip6addr)   (lwip_htonl((ip6addr)->addr[2]) & 0x0000ffffUL)
 
#define ip6_addr_isany_val(ip6addr)
 
#define ip6_addr_isany(ip6addr)   (((ip6addr) == NULL) || ip6_addr_isany_val(*(ip6addr)))
 
#define ip6_addr_isloopback(ip6addr)
 
#define ip6_addr_isglobal(ip6addr)   (((ip6addr)->addr[0] & PP_HTONL(0xe0000000UL)) == PP_HTONL(0x20000000UL))
 
#define ip6_addr_islinklocal(ip6addr)   (((ip6addr)->addr[0] & PP_HTONL(0xffc00000UL)) == PP_HTONL(0xfe800000UL))
 
#define ip6_addr_issitelocal(ip6addr)   (((ip6addr)->addr[0] & PP_HTONL(0xffc00000UL)) == PP_HTONL(0xfec00000UL))
 
#define ip6_addr_isuniquelocal(ip6addr)   (((ip6addr)->addr[0] & PP_HTONL(0xfe000000UL)) == PP_HTONL(0xfc000000UL))
 
#define ip6_addr_isipv6mappedipv4(ip6addr)   (((ip6addr)->addr[0] == 0) && ((ip6addr)->addr[1] == 0) && (((ip6addr)->addr[2]) == PP_HTONL(0x0000FFFFUL)))
 
#define ip6_addr_ismulticast(ip6addr)   (((ip6addr)->addr[0] & PP_HTONL(0xff000000UL)) == PP_HTONL(0xff000000UL))
 
#define ip6_addr_multicast_transient_flag(ip6addr)   ((ip6addr)->addr[0] & PP_HTONL(0x00100000UL))
 
#define ip6_addr_multicast_prefix_flag(ip6addr)   ((ip6addr)->addr[0] & PP_HTONL(0x00200000UL))
 
#define ip6_addr_multicast_rendezvous_flag(ip6addr)   ((ip6addr)->addr[0] & PP_HTONL(0x00400000UL))
 
#define ip6_addr_multicast_scope(ip6addr)   ((lwip_htonl((ip6addr)->addr[0]) >> 16) & 0xf)
 
#define IP6_MULTICAST_SCOPE_RESERVED   0x0
 
#define IP6_MULTICAST_SCOPE_RESERVED0   0x0
 
#define IP6_MULTICAST_SCOPE_INTERFACE_LOCAL   0x1
 
#define IP6_MULTICAST_SCOPE_LINK_LOCAL   0x2
 
#define IP6_MULTICAST_SCOPE_RESERVED3   0x3
 
#define IP6_MULTICAST_SCOPE_ADMIN_LOCAL   0x4
 
#define IP6_MULTICAST_SCOPE_SITE_LOCAL   0x5
 
#define IP6_MULTICAST_SCOPE_ORGANIZATION_LOCAL   0x8
 
#define IP6_MULTICAST_SCOPE_GLOBAL   0xe
 
#define IP6_MULTICAST_SCOPE_RESERVEDF   0xf
 
#define ip6_addr_ismulticast_iflocal(ip6addr)   (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff010000UL))
 
#define ip6_addr_ismulticast_linklocal(ip6addr)   (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff020000UL))
 
#define ip6_addr_ismulticast_adminlocal(ip6addr)   (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff040000UL))
 
#define ip6_addr_ismulticast_sitelocal(ip6addr)   (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff050000UL))
 
#define ip6_addr_ismulticast_orglocal(ip6addr)   (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff080000UL))
 
#define ip6_addr_ismulticast_global(ip6addr)   (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff0e0000UL))
 
#define ip6_addr_isallnodes_iflocal(ip6addr)
 
#define ip6_addr_isallnodes_linklocal(ip6addr)
 
#define ip6_addr_set_allnodes_linklocal(ip6addr)
 
#define ip6_addr_isallrouters_linklocal(ip6addr)
 
#define ip6_addr_set_allrouters_linklocal(ip6addr)
 
#define ip6_addr_issolicitednode(ip6addr)
 
#define ip6_addr_set_solicitednode(ip6addr, if_id)
 
#define ip6_addr_cmp_solicitednode(ip6addr, sn_addr)
 
#define IP6_ADDR_INVALID   0x00
 
#define IP6_ADDR_TENTATIVE   0x08
 
#define IP6_ADDR_TENTATIVE_1   0x09 /* 1 probe sent */
 
#define IP6_ADDR_TENTATIVE_2   0x0a /* 2 probes sent */
 
#define IP6_ADDR_TENTATIVE_3   0x0b /* 3 probes sent */
 
#define IP6_ADDR_TENTATIVE_4   0x0c /* 4 probes sent */
 
#define IP6_ADDR_TENTATIVE_5   0x0d /* 5 probes sent */
 
#define IP6_ADDR_TENTATIVE_6   0x0e /* 6 probes sent */
 
#define IP6_ADDR_TENTATIVE_7   0x0f /* 7 probes sent */
 
#define IP6_ADDR_VALID   0x10 /* This bit marks an address as valid (preferred or deprecated) */
 
#define IP6_ADDR_PREFERRED   0x30
 
#define IP6_ADDR_DEPRECATED   0x10 /* Same as VALID (valid but not preferred) */
 
#define IP6_ADDR_TENTATIVE_COUNT_MASK   0x07 /* 1-7 probes sent */
 
#define ip6_addr_isinvalid(addr_state)   (addr_state == IP6_ADDR_INVALID)
 
#define ip6_addr_istentative(addr_state)   (addr_state & IP6_ADDR_TENTATIVE)
 
#define ip6_addr_isvalid(addr_state)   (addr_state & IP6_ADDR_VALID) /* Include valid, preferred, and deprecated. */
 
#define ip6_addr_ispreferred(addr_state)   (addr_state == IP6_ADDR_PREFERRED)
 
#define ip6_addr_isdeprecated(addr_state)   (addr_state == IP6_ADDR_DEPRECATED)
 
#define ip6_addr_debug_print_parts(debug, a, b, c, d, e, f, g, h)
 
#define ip6_addr_debug_print(debug, ipaddr)
 
#define ip6_addr_debug_print_val(debug, ipaddr)
 
#define IP6ADDR_STRLEN_MAX   46
 
#define IP_ADDR_PCB_VERSION_MATCH(addr, pcb)   1
 
#define IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ipaddr)   1
 
#define IPADDR4_INIT(u32val)
 
#define IP_IS_V4_VAL(ipaddr)   1
 
#define IP_IS_V6_VAL(ipaddr)   0
 
#define IP_IS_V4(ipaddr)   1
 
#define IP_IS_V6(ipaddr)   0
 
#define IP_IS_ANY_TYPE_VAL(ipaddr)   0
 
#define IP_SET_TYPE_VAL(ipaddr, iptype)
 
#define IP_SET_TYPE(ipaddr, iptype)
 
#define IP_GET_TYPE(ipaddr)   IPADDR_TYPE_V4
 
#define ip_2_ip4(ipaddr)   (ipaddr)
 
#define IP_ADDR4(ipaddr, a, b, c, d)   IP4_ADDR(ipaddr, a, b, c, d)
 
#define ip_addr_copy(dest, src)   ip4_addr_copy(dest, src)
 
#define ip_addr_copy_from_ip4(dest, src)   ip4_addr_copy(dest, src)
 
#define ip_addr_set_ip4_u32(ipaddr, val)   ip4_addr_set_u32(ip_2_ip4(ipaddr), val)
 
#define ip_addr_get_ip4_u32(ipaddr)   ip4_addr_get_u32(ip_2_ip4(ipaddr))
 
#define ip_addr_set(dest, src)   ip4_addr_set(dest, src)
 
#define ip_addr_set_ipaddr(dest, src)   ip4_addr_set(dest, src)
 
#define ip_addr_set_zero(ipaddr)   ip4_addr_set_zero(ipaddr)
 
#define ip_addr_set_zero_ip4(ipaddr)   ip4_addr_set_zero(ipaddr)
 
#define ip_addr_set_any(is_ipv6, ipaddr)   ip4_addr_set_any(ipaddr)
 
#define ip_addr_set_loopback(is_ipv6, ipaddr)   ip4_addr_set_loopback(ipaddr)
 
#define ip_addr_set_hton(dest, src)   ip4_addr_set_hton(dest, src)
 
#define ip_addr_get_network(target, host, mask)   ip4_addr_get_network(target, host, mask)
 
#define ip_addr_netcmp(addr1, addr2, mask)   ip4_addr_netcmp(addr1, addr2, mask)
 
#define ip_addr_cmp(addr1, addr2)   ip4_addr_cmp(addr1, addr2)
 
#define ip_addr_isany(ipaddr)   ip4_addr_isany(ipaddr)
 
#define ip_addr_isany_val(ipaddr)   ip4_addr_isany_val(ipaddr)
 
#define ip_addr_isloopback(ipaddr)   ip4_addr_isloopback(ipaddr)
 
#define ip_addr_islinklocal(ipaddr)   ip4_addr_islinklocal(ipaddr)
 
#define ip_addr_isbroadcast(addr, netif)   ip4_addr_isbroadcast(addr, netif)
 
#define ip_addr_ismulticast(ipaddr)   ip4_addr_ismulticast(ipaddr)
 
#define ip_addr_debug_print(debug, ipaddr)   ip4_addr_debug_print(debug, ipaddr)
 
#define ip_addr_debug_print_val(debug, ipaddr)   ip4_addr_debug_print_val(debug, ipaddr)
 
#define ipaddr_ntoa(ipaddr)   ip4addr_ntoa(ipaddr)
 
#define ipaddr_ntoa_r(ipaddr, buf, buflen)   ip4addr_ntoa_r(ipaddr, buf, buflen)
 
#define ipaddr_aton(cp, addr)   ip4addr_aton(cp, addr)
 
#define IPADDR_STRLEN_MAX   IP4ADDR_STRLEN_MAX
 
#define IP_ADDR_ANY   IP4_ADDR_ANY
 
#define IP4_ADDR_ANY   (&ip_addr_any)
 
#define IP4_ADDR_ANY4   (ip_2_ip4(&ip_addr_any))
 
#define IP_ADDR_BROADCAST   (&ip_addr_broadcast)
 
#define IP4_ADDR_BROADCAST   (ip_2_ip4(&ip_addr_broadcast))
 
#define IP_ANY_TYPE   IP_ADDR_ANY
 
#define NETIF_MAX_HWADDR_LEN   6U
 
#define NETIF_FLAG_UP   0x01U
 
#define NETIF_FLAG_BROADCAST   0x02U
 
#define NETIF_FLAG_LINK_UP   0x04U
 
#define NETIF_FLAG_ETHARP   0x08U
 
#define NETIF_FLAG_ETHERNET   0x10U
 
#define NETIF_FLAG_IGMP   0x20U
 
#define NETIF_FLAG_MLD6   0x40U
 
#define netif_set_client_data(netif, id, data)   netif_get_client_data(netif, id) = (data)
 
#define netif_get_client_data(netif, id)   (netif)->client_data[(id)]
 
#define NETIF_SET_CHECKSUM_CTRL(netif, chksumflags)
 
#define IF__NETIF_CHECKSUM_ENABLED(netif, chksumflag)
 
#define netif_ip4_addr(netif)   ((const ip4_addr_t *)ip_2_ip4(&((netif)->ip_addr)))
 
#define netif_ip4_netmask(netif)   ((const ip4_addr_t *)ip_2_ip4(&((netif)->netmask)))
 
#define netif_ip4_gw(netif)   ((const ip4_addr_t *)ip_2_ip4(&((netif)->gw)))
 
#define netif_ip_addr4(netif)   ((const ip_addr_t *)&((netif)->ip_addr))
 
#define netif_ip_netmask4(netif)   ((const ip_addr_t *)&((netif)->netmask))
 
#define netif_ip_gw4(netif)   ((const ip_addr_t *)&((netif)->gw))
 
#define netif_is_up(netif)   (((netif)->flags & NETIF_FLAG_UP) ? (u8)1 : (u8)0)
 
#define netif_is_link_up(netif)   (((netif)->flags & NETIF_FLAG_LINK_UP) ? (u8)1 : (u8)0)
 
#define NETIF_SET_HWADDRHINT(netif, hint)
 
#define s6_addr   un.u8_addr
 
#define INADDR_NONE   IPADDR_NONE
 
#define INADDR_LOOPBACK   IPADDR_LOOPBACK
 
#define INADDR_ANY   IPADDR_ANY
 
#define INADDR_BROADCAST   IPADDR_BROADCAST
 
#define SIN_ZERO_LEN   8
 
#define SOCKLEN_T_DEFINED   1
 
#define SOCK_STREAM   1
 
#define SOCK_DGRAM   2
 
#define SOCK_RAW   3
 
#define SO_REUSEADDR   0x0004 /* Allow local address reuse */
 
#define SO_KEEPALIVE   0x0008 /* keep connections alive */
 
#define SO_BROADCAST   0x0020 /* permit to send and to receive broadcast messages (see IP_SOF_BROADCAST option) */
 
#define SO_DEBUG   0x0001 /* Unimplemented: turn on debugging info recording */
 
#define SO_ACCEPTCONN   0x0002 /* socket has had listen() */
 
#define SO_DONTROUTE   0x0010 /* Unimplemented: just use interface addresses */
 
#define SO_USELOOPBACK   0x0040 /* Unimplemented: bypass hardware when possible */
 
#define SO_LINGER   0x0080 /* linger on close if data present */
 
#define SO_DONTLINGER   ((int)(~SO_LINGER))
 
#define SO_OOBINLINE   0x0100 /* Unimplemented: leave received OOB data in line */
 
#define SO_REUSEPORT   0x0200 /* Unimplemented: allow local address & port reuse */
 
#define SO_SNDBUF   0x1001 /* Unimplemented: send buffer size */
 
#define SO_RCVBUF   0x1002 /* receive buffer size */
 
#define SO_SNDLOWAT   0x1003 /* Unimplemented: send low-water mark */
 
#define SO_RCVLOWAT   0x1004 /* Unimplemented: receive low-water mark */
 
#define SO_SNDTIMEO   0x1005 /* send timeout */
 
#define SO_RCVTIMEO   0x1006 /* receive timeout */
 
#define SO_ERROR   0x1007 /* get error status and clear */
 
#define SO_TYPE   0x1008 /* get socket type */
 
#define SO_CONTIMEO   0x1009 /* Unimplemented: connect timeout */
 
#define SO_NO_CHECK   0x100a /* don't create UDP checksum */
 
#define SOL_SOCKET   0xfff /* options for socket level */
 
#define AF_UNSPEC   0
 
#define AF_INET   2
 
#define AF_INET6   AF_UNSPEC
 
#define PF_INET   AF_INET
 
#define PF_INET6   AF_INET6
 
#define PF_UNSPEC   AF_UNSPEC
 
#define IPPROTO_IP   0
 
#define IPPROTO_ICMP   1
 
#define IPPROTO_TCP   6
 
#define IPPROTO_UDP   17
 
#define IPPROTO_UDPLITE   136
 
#define IPPROTO_RAW   255
 
#define MSG_PEEK   0x01 /* Peeks at an incoming message */
 
#define MSG_WAITALL   0x02 /* Unimplemented: Requests that the function block until the full amount of data requested can be returned */
 
#define MSG_OOB   0x04 /* Unimplemented: Requests out-of-band data. The significance and semantics of out-of-band data are protocol-specific */
 
#define MSG_DONTWAIT   0x08 /* Nonblocking i/o for this operation only */
 
#define MSG_MORE   0x10 /* Sender will send more */
 
#define IP_TOS   1
 
#define IP_TTL   2
 
#define TCP_NODELAY   0x01 /* don't delay send to coalesce packets */
 
#define TCP_KEEPALIVE   0x02 /* send KEEPALIVE probes when idle for pcb->keep_idle milliseconds */
 
#define TCP_KEEPIDLE   0x03 /* set pcb->keep_idle - Same as TCP_KEEPALIVE, but use seconds for get/setsockopt */
 
#define TCP_KEEPINTVL   0x04 /* set pcb->keep_intvl - Use seconds for get/setsockopt */
 
#define TCP_KEEPCNT   0x05 /* set pcb->keep_cnt - Use number of probes sent for get/setsockopt */
 
#define IPTOS_TOS_MASK   0x1E
 
#define IPTOS_TOS(tos)   ((tos)&IPTOS_TOS_MASK)
 
#define IPTOS_LOWDELAY   0x10
 
#define IPTOS_THROUGHPUT   0x08
 
#define IPTOS_RELIABILITY   0x04
 
#define IPTOS_LOWCOST   0x02
 
#define IPTOS_MINCOST   IPTOS_LOWCOST
 
#define IPTOS_PREC_MASK   0xe0
 
#define IPTOS_PREC(tos)   ((tos)&IPTOS_PREC_MASK)
 
#define IPTOS_PREC_NETCONTROL   0xe0
 
#define IPTOS_PREC_INTERNETCONTROL   0xc0
 
#define IPTOS_PREC_CRITIC_ECP   0xa0
 
#define IPTOS_PREC_FLASHOVERRIDE   0x80
 
#define IPTOS_PREC_FLASH   0x60
 
#define IPTOS_PREC_IMMEDIATE   0x40
 
#define IPTOS_PREC_PRIORITY   0x20
 
#define IPTOS_PREC_ROUTINE   0x00
 
#define IOCPARM_MASK   0x7fU /* parameters must be < 128 bytes */
 
#define IOC_VOID   0x20000000UL /* no parameters */
 
#define IOC_OUT   0x40000000UL /* copy out parameters */
 
#define IOC_IN   0x80000000UL /* copy in parameters */
 
#define IOC_INOUT   (IOC_IN | IOC_OUT)
 
#define _IO(x, y)   (IOC_VOID | ((x) << 8) | (y))
 
#define _IOR(x, y, t)   (IOC_OUT | (((long)sizeof(t) & IOCPARM_MASK) << 16) | ((x) << 8) | (y))
 
#define _IOW(x, y, t)   (IOC_IN | (((long)sizeof(t) & IOCPARM_MASK) << 16) | ((x) << 8) | (y))
 
#define FIONREAD   _IOR('f', 127, unsigned long) /* get # bytes to read */
 
#define FIONBIO   _IOW('f', 126, unsigned long) /* set/clear non-blocking i/o */
 
#define SIOCSHIWAT   _IOW('s', 0, unsigned long) /* set high watermark */
 
#define SIOCGHIWAT   _IOR('s', 1, unsigned long) /* get high watermark */
 
#define SIOCSLOWAT   _IOW('s', 2, unsigned long) /* set low watermark */
 
#define SIOCGLOWAT   _IOR('s', 3, unsigned long) /* get low watermark */
 
#define SIOCATMARK   _IOR('s', 7, unsigned long) /* at oob mark? */
 
#define F_GETFL   3
 
#define F_SETFL   4
 
#define O_NONBLOCK   1 /* nonblocking I/O */
 
#define O_NDELAY   1 /* same as O_NONBLOCK, for compatibility */
 
#define SHUT_RD   0
 
#define SHUT_WR   1
 
#define SHUT_RDWR   2
 
#define FD_SETSIZE   MEMP_NUM_NETCONN
 
#define FDSETSAFESET(n, code)
 
#define FDSETSAFEGET(n, code)
 
#define FD_SET(n, p)   FDSETSAFESET(n, (p)->fd_bits[((n)-LWIP_SOCKET_OFFSET) / 8] |= (1 << (((n)-LWIP_SOCKET_OFFSET) & 7)))
 
#define FD_CLR(n, p)   FDSETSAFESET(n, (p)->fd_bits[((n)-LWIP_SOCKET_OFFSET) / 8] &= ~(1 << (((n)-LWIP_SOCKET_OFFSET) & 7)))
 
#define FD_ISSET(n, p)   FDSETSAFEGET(n, (p)->fd_bits[((n)-LWIP_SOCKET_OFFSET) / 8] & (1 << (((n)-LWIP_SOCKET_OFFSET) & 7)))
 
#define FD_ZERO(p)   memset((void *)(p), 0, sizeof(*(p)))
 
#define DNS_TMR_INTERVAL   1000
 
#define LWIP_DNS_ADDRTYPE_IPV4   0
 
#define LWIP_DNS_ADDRTYPE_IPV6   1
 
#define LWIP_DNS_ADDRTYPE_IPV4_IPV6   2 /* try to resolve IPv4 first, try IPv6 if IPv4 fails only */
 
#define LWIP_DNS_ADDRTYPE_IPV6_IPV4   3 /* try to resolve IPv6 first, try IPv4 if IPv6 fails only */
 
#define LWIP_DNS_ADDRTYPE_DEFAULT   LWIP_DNS_ADDRTYPE_IPV4
 
#define LWIP_DNS_API_DECLARE_H_ERRNO   1
 
#define LWIP_DNS_API_DEFINE_ERRORS   1
 
#define LWIP_DNS_API_DEFINE_FLAGS   1
 
#define LWIP_DNS_API_DECLARE_STRUCTS   1
 
#define EAI_NONAME   200
 
#define EAI_SERVICE   201
 
#define EAI_FAIL   202
 
#define EAI_MEMORY   203
 
#define EAI_FAMILY   204
 
#define HOST_NOT_FOUND   210
 
#define NO_DATA   211
 
#define NO_RECOVERY   212
 
#define TRY_AGAIN   213
 
#define AI_PASSIVE   0x01
 
#define AI_CANONNAME   0x02
 
#define AI_NUMERICHOST   0x04
 
#define AI_NUMERICSERV   0x08
 
#define AI_V4MAPPED   0x10
 
#define AI_ALL   0x20
 
#define AI_ADDRCONFIG   0x40
 
#define h_addr   h_addr_list[0] /* for backward compatibility */
 
#define NETDB_ELEM_SIZE   (sizeof(struct addrinfo) + sizeof(struct sockaddr_storage) + DNS_MAX_NAME_LENGTH + 1)
 
#define htons(x)   lwip_htons(x)
 
#define ntohs(x)   lwip_ntohs(x)
 
#define htonl(x)   lwip_htonl(x)
 
#define ntohl(x)   lwip_ntohl(x)
 
#define lwip_htons(x)   PP_HTONS(x)
 
#define lwip_ntohs(x)   PP_NTOHS(x)
 
#define lwip_htonl(x)   PP_HTONL(x)
 
#define lwip_ntohl(x)   PP_NTOHL(x)
 
#define PP_HTONS(x)   ((((x)&0xff) << 8) | (((x)&0xff00) >> 8))
 
#define PP_NTOHS(x)   PP_HTONS(x)
 
#define PP_HTONL(x)
 
#define PP_NTOHL(x)   PP_HTONL(x)
 

Typedefs

typedef signed char err_t
 
typedef struct ip4_addr ip4_addr_t
 
typedef struct ip4_addr_packed ip4_addr_p_t
 
typedef struct ip6_addr ip6_addr_t
 
typedef struct ip6_addr_packed ip6_addr_p_t
 
typedef ip4_addr_t ip_addr_t
 
typedef err_t(* netif_init_fn) (struct netif *netif)
 
typedef err_t(* netif_input_fn) (struct pbuf *p, struct netif *inp)
 
typedef err_t(* netif_output_fn) (struct netif *netif, struct pbuf *p, const ip4_addr_t *ipaddr)
 
typedef err_t(* netif_linkoutput_fn) (struct netif *netif, struct pbuf *p)
 
typedef void(* netif_status_callback_fn) (struct netif *netif)
 
typedef u8 sa_family_t
 
typedef u16 in_port_t
 
typedef int socklen_t
 
typedef struct fd_set fd_set
 
typedef void(* dns_found_callback) (const char *name, const ip_addr_t *ipaddr, void *callback_arg)
 

Enumerations

enum  pbuf_layer {
  PBUF_TRANSPORT , PBUF_IP , PBUF_LINK , PBUF_RAW_TX ,
  PBUF_RAW
}
 
enum  pbuf_type { PBUF_RAM , PBUF_ROM , PBUF_REF , PBUF_POOL }
 
enum  lwip_ip_addr_type { IPADDR_TYPE_V4 = 0U , IPADDR_TYPE_V6 = 6U , IPADDR_TYPE_ANY = 46U }
 
enum  lwip_internal_netif_client_data_index { LWIP_NETIF_CLIENT_DATA_INDEX_DHCP , LWIP_NETIF_CLIENT_DATA_INDEX_MAX }
 
enum  netif_mac_filter_action { NETIF_DEL_MAC_FILTER = 0 , NETIF_ADD_MAC_FILTER = 1 }
 
enum  dhcp_state_enum_t {
  DHCP_STATE_OFF = 0 , DHCP_STATE_REQUESTING = 1 , DHCP_STATE_INIT = 2 , DHCP_STATE_REBOOTING = 3 ,
  DHCP_STATE_REBINDING = 4 , DHCP_STATE_RENEWING = 5 , DHCP_STATE_SELECTING = 6 , DHCP_STATE_INFORMING = 7 ,
  DHCP_STATE_CHECKING = 8 , DHCP_STATE_PERMANENT = 9 , DHCP_STATE_BOUND = 10 , DHCP_STATE_RELEASING = 11 ,
  DHCP_STATE_BACKING_OFF = 12
}
 

Functions

u8 netif_alloc_client_data_id (void)
 

Variables

const ip_addr_t ip_addr_any
 
const ip_addr_t ip_addr_broadcast
 
struct netifnetif_list
 
struct netifnetif_default
 

Detailed Description

Common definitions file for the LWIP v2.0.0 port.

Definition in file tcpip.h.


Data Structure Documentation

◆ pbuf

struct pbuf

Main packet buffer struct

Definition at line 199 of file tcpip.h.

+ Collaboration diagram for pbuf:
Data Fields
struct pbuf * next

next pbuf in singly linked pbuf chain

void * payload

pointer to the actual data in the buffer

u16 tot_len

total length of this buffer and all next buffers in chain belonging to the same packet.

For non-queue packet chains this is the invariant: p->tot_len == p->len + (p->next? p->next->tot_len: 0)

u16 len

length of this buffer

u8 type

pbuf_type as u8 instead of enum to save space

u8 flags

misc flags

u16 ref

the reference count always equals the number of pointers that refer to this pbuf. This can be pointers from an application, the stack itself, or pbuf->next pointers from a chain.

◆ ip4_addr

struct ip4_addr

This is the aligned version of ip4_addr_t, used as local variable, on the stack, etc.

Definition at line 236 of file tcpip.h.

Data Fields
u32 addr

◆ ip6_addr

struct ip6_addr

This is the aligned version of ip6_addr_t, used as local variable, on the stack, etc.

Definition at line 390 of file tcpip.h.

Data Fields
u32 addr[4]

◆ netif

struct netif

Generic data structure used for all lwIP network interfaces. The following fields should be filled in by the initialization function for the device driver: hwaddr_len, hwaddr[], mtu, flags

Definition at line 1232 of file tcpip.h.

+ Collaboration diagram for netif:
Data Fields
struct netif * next

pointer to next in linked list

ip_addr_t ip_addr

IP address configuration in network byte order

ip_addr_t netmask
ip_addr_t gw
netif_input_fn input

This function is called by the network device driver to pass a packet up the TCP/IP stack.

netif_output_fn output

This function is called by the IP module when it wants to send a packet on the interface. This function typically first resolves the hardware address, then sends the packet. For ethernet physical layer, this is usually etharp_output()

netif_linkoutput_fn linkoutput

This function is called by ethernet_output() when it wants to send a packet on the interface. This function outputs the pbuf as-is on the link medium.

void * state

This field can be set by the device driver and could point to state information for the device.

void * client_data[LWIP_NETIF_CLIENT_DATA_INDEX_MAX+LWIP_NUM_NETIF_CLIENT_DATA]
u8 rs_count

Number of Router Solicitation messages that remain to be sent.

u16 mtu

maximum transfer unit (in bytes)

u8 hwaddr_len

number of bytes used in hwaddr

u8 hwaddr[NETIF_MAX_HWADDR_LEN]

link level hardware address of this interface

u8 flags

flags (

See also
Flags)
char name[2]

descriptive abbreviation

u8 num

number of this interface

◆ in_addr

struct in_addr

Definition at line 1472 of file tcpip.h.

Data Fields
u32 s_addr

◆ in6_addr

struct in6_addr

Definition at line 1477 of file tcpip.h.

Data Fields
union in6_addr.un un

◆ sockaddr_in

struct sockaddr_in

Definition at line 1509 of file tcpip.h.

+ Collaboration diagram for sockaddr_in:
Data Fields
u8 sin_len
sa_family_t sin_family
in_port_t sin_port
struct in_addr sin_addr
char sin_zero[SIN_ZERO_LEN]

◆ sockaddr

struct sockaddr

Definition at line 1532 of file tcpip.h.

Data Fields
u8 sa_len
sa_family_t sa_family
char sa_data[14]

◆ sockaddr_storage

struct sockaddr_storage

Definition at line 1539 of file tcpip.h.

Data Fields
u8 s2_len
sa_family_t ss_family
char s2_data1[2]
u32 s2_data2[3]

◆ fd_set

struct fd_set

Definition at line 1808 of file tcpip.h.

Data Fields
unsigned char fd_bits[(FD_SETSIZE+7)/8]

◆ hostent

struct hostent

Definition at line 1910 of file tcpip.h.

Data Fields
char * h_name
char ** h_aliases
int h_addrtype
int h_length
char ** h_addr_list

◆ addrinfo

struct addrinfo

Definition at line 1922 of file tcpip.h.

+ Collaboration diagram for addrinfo:
Data Fields
int ai_flags
int ai_family
int ai_socktype
int ai_protocol
socklen_t ai_addrlen
struct sockaddr * ai_addr
char * ai_canonname
struct addrinfo * ai_next

◆ in6_addr.un

union in6_addr.un

Definition at line 1479 of file tcpip.h.

Data Fields
u32 u32_addr[4]
u8 u8_addr[16]

Macro Definition Documentation

◆ PS2IP_DNS

#define PS2IP_DNS

Definition at line 31 of file tcpip.h.

◆ PS2IP_DHCP

#define PS2IP_DHCP   1

Definition at line 34 of file tcpip.h.

◆ LWIP_IPV4

#define LWIP_IPV4   1

Definition at line 37 of file tcpip.h.

◆ LWIP_IPV6

#define LWIP_IPV6   0

Definition at line 40 of file tcpip.h.

◆ LWIP_IPV6_MLD

#define LWIP_IPV6_MLD   0

Definition at line 43 of file tcpip.h.

◆ LWIP_CHECKSUM_CTRL_PER_NETIF

#define LWIP_CHECKSUM_CTRL_PER_NETIF   0

Definition at line 46 of file tcpip.h.

◆ LWIP_NETIF_REMOVE_CALLBACK

#define LWIP_NETIF_REMOVE_CALLBACK   0

Definition at line 49 of file tcpip.h.

◆ LWIP_IPV6_AUTOCONFIG

#define LWIP_IPV6_AUTOCONFIG   0

Definition at line 52 of file tcpip.h.

◆ LWIP_MULTICAST_TX_OPTIONS

#define LWIP_MULTICAST_TX_OPTIONS   0

Definition at line 55 of file tcpip.h.

◆ LWIP_DHCP

#define LWIP_DHCP   1

Definition at line 58 of file tcpip.h.

◆ LWIP_TCP

#define LWIP_TCP   1

Definition at line 61 of file tcpip.h.

◆ LWIP_UDP

#define LWIP_UDP   1

Definition at line 64 of file tcpip.h.

◆ LWIP_UDPLITE

#define LWIP_UDPLITE   0

Definition at line 67 of file tcpip.h.

◆ MIB2_STATS

#define MIB2_STATS   0

Definition at line 70 of file tcpip.h.

◆ ENABLE_LOOPBACK

#define ENABLE_LOOPBACK   0

Definition at line 73 of file tcpip.h.

◆ DNS_LOCAL_HOSTLIST

#define DNS_LOCAL_HOSTLIST   0

Definition at line 76 of file tcpip.h.

◆ MEMP_NUM_UDP_PCB

#define MEMP_NUM_UDP_PCB   4

Definition at line 81 of file tcpip.h.

◆ MEMP_NUM_TCP_PCB

#define MEMP_NUM_TCP_PCB   5

Definition at line 82 of file tcpip.h.

◆ MEMP_NUM_NETCONN

#define MEMP_NUM_NETCONN   (MEMP_NUM_TCP_PCB + MEMP_NUM_UDP_PCB)

Definition at line 83 of file tcpip.h.

◆ LWIP_NETIF_STATUS_CALLBACK

#define LWIP_NETIF_STATUS_CALLBACK   0

Definition at line 84 of file tcpip.h.

◆ LWIP_NETIF_LINK_CALLBACK

#define LWIP_NETIF_LINK_CALLBACK   0

Definition at line 85 of file tcpip.h.

◆ LWIP_AUTOIP

#define LWIP_AUTOIP   0

Definition at line 86 of file tcpip.h.

◆ LWIP_NETIF_HOSTNAME

#define LWIP_NETIF_HOSTNAME   0

Definition at line 87 of file tcpip.h.

◆ LWIP_SNMP

#define LWIP_SNMP   0

Definition at line 88 of file tcpip.h.

◆ LWIP_IGMP

#define LWIP_IGMP   0

Definition at line 89 of file tcpip.h.

◆ LWIP_NETIF_HWADDRHINT

#define LWIP_NETIF_HWADDRHINT   0

Definition at line 90 of file tcpip.h.

◆ LWIP_LOOPBACK_MAX_PBUFS

#define LWIP_LOOPBACK_MAX_PBUFS   0

Definition at line 91 of file tcpip.h.

◆ LWIP_NUM_NETIF_CLIENT_DATA

#define LWIP_NUM_NETIF_CLIENT_DATA   0

Definition at line 92 of file tcpip.h.

◆ LWIP_SOCKET_OFFSET

#define LWIP_SOCKET_OFFSET   0

Definition at line 93 of file tcpip.h.

◆ LWIP_IPV6_SEND_ROUTER_SOLICIT

#define LWIP_IPV6_SEND_ROUTER_SOLICIT   1

Definition at line 94 of file tcpip.h.

◆ DNS_MAX_SERVERS

#define DNS_MAX_SERVERS   2

Definition at line 95 of file tcpip.h.

◆ PBUF_TRANSPORT_HLEN

#define PBUF_TRANSPORT_HLEN   20

Definition at line 133 of file tcpip.h.

◆ PBUF_IP_HLEN

#define PBUF_IP_HLEN   20

Definition at line 137 of file tcpip.h.

◆ IPADDR_NONE

#define IPADDR_NONE   ((u32)0xffffffffUL)

255.255.255.255

Definition at line 247 of file tcpip.h.

◆ IPADDR_LOOPBACK

#define IPADDR_LOOPBACK   ((u32)0x7f000001UL)

127.0.0.1

Definition at line 249 of file tcpip.h.

◆ IPADDR_ANY

#define IPADDR_ANY   ((u32)0x00000000UL)

0.0.0.0

Definition at line 251 of file tcpip.h.

◆ IPADDR_BROADCAST

#define IPADDR_BROADCAST   ((u32)0xffffffffUL)

255.255.255.255

Definition at line 253 of file tcpip.h.

◆ IP_CLASSA

#define IP_CLASSA (   a)    ((((u32)(a)) & 0x80000000UL) == 0)

Definition at line 259 of file tcpip.h.

◆ IP_CLASSA_NET

#define IP_CLASSA_NET   0xff000000

Definition at line 260 of file tcpip.h.

◆ IP_CLASSA_NSHIFT

#define IP_CLASSA_NSHIFT   24

Definition at line 261 of file tcpip.h.

◆ IP_CLASSA_HOST

#define IP_CLASSA_HOST   (0xffffffff & ~IP_CLASSA_NET)

Definition at line 262 of file tcpip.h.

◆ IP_CLASSA_MAX

#define IP_CLASSA_MAX   128

Definition at line 263 of file tcpip.h.

◆ IP_CLASSB

#define IP_CLASSB (   a)    ((((u32)(a)) & 0xc0000000UL) == 0x80000000UL)

Definition at line 265 of file tcpip.h.

◆ IP_CLASSB_NET

#define IP_CLASSB_NET   0xffff0000

Definition at line 266 of file tcpip.h.

◆ IP_CLASSB_NSHIFT

#define IP_CLASSB_NSHIFT   16

Definition at line 267 of file tcpip.h.

◆ IP_CLASSB_HOST

#define IP_CLASSB_HOST   (0xffffffff & ~IP_CLASSB_NET)

Definition at line 268 of file tcpip.h.

◆ IP_CLASSB_MAX

#define IP_CLASSB_MAX   65536

Definition at line 269 of file tcpip.h.

◆ IP_CLASSC

#define IP_CLASSC (   a)    ((((u32)(a)) & 0xe0000000UL) == 0xc0000000UL)

Definition at line 271 of file tcpip.h.

◆ IP_CLASSC_NET

#define IP_CLASSC_NET   0xffffff00

Definition at line 272 of file tcpip.h.

◆ IP_CLASSC_NSHIFT

#define IP_CLASSC_NSHIFT   8

Definition at line 273 of file tcpip.h.

◆ IP_CLASSC_HOST

#define IP_CLASSC_HOST   (0xffffffff & ~IP_CLASSC_NET)

Definition at line 274 of file tcpip.h.

◆ IP_CLASSD

#define IP_CLASSD (   a)    (((u32)(a)&0xf0000000UL) == 0xe0000000UL)

Definition at line 276 of file tcpip.h.

◆ IP_CLASSD_NET

#define IP_CLASSD_NET   0xf0000000 /* These ones aren't really */

Definition at line 277 of file tcpip.h.

◆ IP_CLASSD_NSHIFT

#define IP_CLASSD_NSHIFT   28 /* net and host fields, but */

Definition at line 278 of file tcpip.h.

◆ IP_CLASSD_HOST

#define IP_CLASSD_HOST   0x0fffffff /* routing needn't know. */

Definition at line 279 of file tcpip.h.

◆ IP_MULTICAST

#define IP_MULTICAST (   a)    IP_CLASSD(a)

Definition at line 280 of file tcpip.h.

◆ IP_EXPERIMENTAL

#define IP_EXPERIMENTAL (   a)    (((u32)(a)&0xf0000000UL) == 0xf0000000UL)

Definition at line 282 of file tcpip.h.

◆ IP_BADCLASS

#define IP_BADCLASS (   a)    (((u32)(a)&0xf0000000UL) == 0xf0000000UL)

Definition at line 283 of file tcpip.h.

◆ IP_LOOPBACKNET

#define IP_LOOPBACKNET   127 /* official! */

Definition at line 285 of file tcpip.h.

◆ IP4_ADDR

#define IP4_ADDR (   ipaddr,
  a,
  b,
  c,
 
)
Value:
(ipaddr)->addr = ((u32)((d)&0xff) << 24) | \
((u32)((c)&0xff) << 16) | \
((u32)((b)&0xff) << 8) | \
(u32)((a)&0xff)

Set an IP address given by the four byte-parts. Little-endian version that prevents the use of lwip_htonl.

Definition at line 290 of file tcpip.h.

◆ IPADDR2_COPY

#define IPADDR2_COPY (   dest,
  src 
)    memcpy(dest, src, sizeof(ip4_addr_t))

MEMCPY-like copying of IP addresses where addresses are known to be 16-bit-aligned if the port is correctly configured (so a port could define this to copying 2 u16's) - no NULL-pointer-checking needed.

Definition at line 300 of file tcpip.h.

◆ ip4_addr_copy

#define ip4_addr_copy (   dest,
  src 
)    ((dest).addr = (src).addr)

Copy IP address - faster than ip4_addr_set: no NULL check

Definition at line 304 of file tcpip.h.

◆ ip4_addr_set

#define ip4_addr_set (   dest,
  src 
)
Value:
((dest)->addr = \
((src) == NULL ? 0 : \
(src)->addr))

Safely copy one IP address to another (src may be NULL)

Definition at line 306 of file tcpip.h.

◆ ip4_addr_set_zero

#define ip4_addr_set_zero (   ipaddr)    ((ipaddr)->addr = 0)

Set complete address to zero

Definition at line 310 of file tcpip.h.

◆ ip4_addr_set_any

#define ip4_addr_set_any (   ipaddr)    ((ipaddr)->addr = IPADDR_ANY)

Set address to IPADDR_ANY (no need for lwip_htonl())

Definition at line 312 of file tcpip.h.

◆ ip4_addr_set_loopback

#define ip4_addr_set_loopback (   ipaddr)    ((ipaddr)->addr = PP_HTONL(IPADDR_LOOPBACK))

Set address to loopback address

Definition at line 314 of file tcpip.h.

◆ ip4_addr_isloopback

#define ip4_addr_isloopback (   ipaddr)    (((ipaddr)->addr & PP_HTONL(IP_CLASSA_NET)) == PP_HTONL(((u32)IP_LOOPBACKNET) << 24))

Check if an address is in the loopback region

Definition at line 316 of file tcpip.h.

◆ ip4_addr_set_hton

#define ip4_addr_set_hton (   dest,
  src 
)
Value:
((dest)->addr = \
((src) == NULL ? 0 : \
lwip_htonl((src)->addr)))

Safely copy one IP address to another and change byte order from host- to network-order.

Definition at line 319 of file tcpip.h.

◆ ip4_addr_set_u32

#define ip4_addr_set_u32 (   dest_ipaddr,
  src_u32 
)    ((dest_ipaddr)->addr = (src_u32))

IPv4 only: set the IP address given as an u32

Definition at line 323 of file tcpip.h.

◆ ip4_addr_get_u32

#define ip4_addr_get_u32 (   src_ipaddr)    ((src_ipaddr)->addr)

IPv4 only: get the IP address as an u32

Definition at line 325 of file tcpip.h.

◆ ip4_addr_get_network

#define ip4_addr_get_network (   target,
  host,
  netmask 
)
Value:
do { \
((target)->addr = ((host)->addr) & ((netmask)->addr)); \
} while (0)

Get the network address by combining host address with netmask

Definition at line 328 of file tcpip.h.

◆ ip4_addr_netcmp

#define ip4_addr_netcmp (   addr1,
  addr2,
  mask 
)
Value:
(((addr1)->addr & \
(mask)->addr) == \
((addr2)->addr & \
(mask)->addr))

Determine if two address are on the same network.

  • addr1 IP address 1
  • addr2 IP address 2
  • mask network identifier mask
    Returns
    !0 if the network identifiers of both address match

Definition at line 341 of file tcpip.h.

◆ ip4_addr_cmp

#define ip4_addr_cmp (   addr1,
  addr2 
)    ((addr1)->addr == (addr2)->addr)

Definition at line 345 of file tcpip.h.

◆ ip4_addr_isany_val

#define ip4_addr_isany_val (   addr1)    ((addr1).addr == IPADDR_ANY)

Definition at line 347 of file tcpip.h.

◆ ip4_addr_isany

#define ip4_addr_isany (   addr1)    ((addr1) == NULL || ip4_addr_isany_val(*(addr1)))

Definition at line 348 of file tcpip.h.

◆ ip4_addr_isbroadcast

#define ip4_addr_isbroadcast (   addr1,
  netif 
)    ip4_addr_isbroadcast_u32((addr1)->addr, netif)

Definition at line 350 of file tcpip.h.

◆ ip_addr_netmask_valid

#define ip_addr_netmask_valid (   netmask)    ip4_addr_netmask_valid((netmask)->addr)

Definition at line 352 of file tcpip.h.

◆ ip4_addr_ismulticast

#define ip4_addr_ismulticast (   addr1)    (((addr1)->addr & PP_HTONL(0xf0000000UL)) == PP_HTONL(0xe0000000UL))

Definition at line 354 of file tcpip.h.

◆ ip4_addr_islinklocal

#define ip4_addr_islinklocal (   addr1)    (((addr1)->addr & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xa9fe0000UL))

Definition at line 356 of file tcpip.h.

◆ ip4_addr_debug_print_parts

#define ip4_addr_debug_print_parts (   debug,
  a,
  b,
  c,
 
)     LWIP_DEBUGF(debug, ("%" U16_F ".%" U16_F ".%" U16_F ".%" U16_F, a, b, c, d))

Definition at line 358 of file tcpip.h.

◆ ip4_addr_debug_print

#define ip4_addr_debug_print (   debug,
  ipaddr 
)
Value:
ip4_addr_debug_print_parts(debug, \
(u16)((ipaddr) != NULL ? ip4_addr1_16(ipaddr) : 0), \
(u16)((ipaddr) != NULL ? ip4_addr2_16(ipaddr) : 0), \
(u16)((ipaddr) != NULL ? ip4_addr3_16(ipaddr) : 0), \
(u16)((ipaddr) != NULL ? ip4_addr4_16(ipaddr) : 0))

Definition at line 360 of file tcpip.h.

◆ ip4_addr_debug_print_val

#define ip4_addr_debug_print_val (   debug,
  ipaddr 
)
Value:
ip4_addr_debug_print_parts(debug, \
ip4_addr1_16(&(ipaddr)), \
ip4_addr2_16(&(ipaddr)), \
ip4_addr3_16(&(ipaddr)), \
ip4_addr4_16(&(ipaddr)))

Definition at line 366 of file tcpip.h.

◆ ip4_addr1

#define ip4_addr1 (   ipaddr)    (((const u8 *)(&(ipaddr)->addr))[0])

Definition at line 374 of file tcpip.h.

◆ ip4_addr2

#define ip4_addr2 (   ipaddr)    (((const u8 *)(&(ipaddr)->addr))[1])

Definition at line 375 of file tcpip.h.

◆ ip4_addr3

#define ip4_addr3 (   ipaddr)    (((const u8 *)(&(ipaddr)->addr))[2])

Definition at line 376 of file tcpip.h.

◆ ip4_addr4

#define ip4_addr4 (   ipaddr)    (((const u8 *)(&(ipaddr)->addr))[3])

Definition at line 377 of file tcpip.h.

◆ ip4_addr1_16

#define ip4_addr1_16 (   ipaddr)    ((u16)ip4_addr1(ipaddr))

Definition at line 380 of file tcpip.h.

◆ ip4_addr2_16

#define ip4_addr2_16 (   ipaddr)    ((u16)ip4_addr2(ipaddr))

Definition at line 381 of file tcpip.h.

◆ ip4_addr3_16

#define ip4_addr3_16 (   ipaddr)    ((u16)ip4_addr3(ipaddr))

Definition at line 382 of file tcpip.h.

◆ ip4_addr4_16

#define ip4_addr4_16 (   ipaddr)    ((u16)ip4_addr4(ipaddr))

Definition at line 383 of file tcpip.h.

◆ IP4ADDR_STRLEN_MAX

#define IP4ADDR_STRLEN_MAX   16

Definition at line 385 of file tcpip.h.

◆ IP6_ADDR_PART

#define IP6_ADDR_PART (   ip6addr,
  index,
  a,
  b,
  c,
 
)
Value:
(ip6addr)->addr[index] = ((u32)((d)&0xff) << 24) | \
((u32)((c)&0xff) << 16) | \
((u32)((b)&0xff) << 8) | \
(u32)((a)&0xff)

Set an IPv6 partial address given by byte-parts. Little-endian version, stored in network order (no lwip_htonl).

Definition at line 401 of file tcpip.h.

◆ IP6_ADDR

#define IP6_ADDR (   ip6addr,
  idx0,
  idx1,
  idx2,
  idx3 
)
Value:
do { \
(ip6addr)->addr[0] = idx0; \
(ip6addr)->addr[1] = idx1; \
(ip6addr)->addr[2] = idx2; \
(ip6addr)->addr[3] = idx3; \
} while (0)

Set a full IPv6 address by passing the 4 u32 indices in network byte order (use PP_HTONL() for constants)

Definition at line 409 of file tcpip.h.

◆ IP6_ADDR_BLOCK1

#define IP6_ADDR_BLOCK1 (   ip6addr)    ((u16)((lwip_htonl((ip6addr)->addr[0]) >> 16) & 0xffff))

Access address in 16-bit block

Definition at line 418 of file tcpip.h.

◆ IP6_ADDR_BLOCK2

#define IP6_ADDR_BLOCK2 (   ip6addr)    ((u16)((lwip_htonl((ip6addr)->addr[0])) & 0xffff))

Access address in 16-bit block

Definition at line 420 of file tcpip.h.

◆ IP6_ADDR_BLOCK3

#define IP6_ADDR_BLOCK3 (   ip6addr)    ((u16)((lwip_htonl((ip6addr)->addr[1]) >> 16) & 0xffff))

Access address in 16-bit block

Definition at line 422 of file tcpip.h.

◆ IP6_ADDR_BLOCK4

#define IP6_ADDR_BLOCK4 (   ip6addr)    ((u16)((lwip_htonl((ip6addr)->addr[1])) & 0xffff))

Access address in 16-bit block

Definition at line 424 of file tcpip.h.

◆ IP6_ADDR_BLOCK5

#define IP6_ADDR_BLOCK5 (   ip6addr)    ((u16)((lwip_htonl((ip6addr)->addr[2]) >> 16) & 0xffff))

Access address in 16-bit block

Definition at line 426 of file tcpip.h.

◆ IP6_ADDR_BLOCK6

#define IP6_ADDR_BLOCK6 (   ip6addr)    ((u16)((lwip_htonl((ip6addr)->addr[2])) & 0xffff))

Access address in 16-bit block

Definition at line 428 of file tcpip.h.

◆ IP6_ADDR_BLOCK7

#define IP6_ADDR_BLOCK7 (   ip6addr)    ((u16)((lwip_htonl((ip6addr)->addr[3]) >> 16) & 0xffff))

Access address in 16-bit block

Definition at line 430 of file tcpip.h.

◆ IP6_ADDR_BLOCK8

#define IP6_ADDR_BLOCK8 (   ip6addr)    ((u16)((lwip_htonl((ip6addr)->addr[3])) & 0xffff))

Access address in 16-bit block

Definition at line 432 of file tcpip.h.

◆ ip6_addr_copy

#define ip6_addr_copy (   dest,
  src 
)
Value:
do { \
(dest).addr[0] = (src).addr[0]; \
(dest).addr[1] = (src).addr[1]; \
(dest).addr[2] = (src).addr[2]; \
(dest).addr[3] = (src).addr[3]; \
} while (0)

Copy IPv6 address - faster than ip6_addr_set: no NULL check

Definition at line 435 of file tcpip.h.

◆ ip6_addr_set

#define ip6_addr_set (   dest,
  src 
)
Value:
do { \
(dest)->addr[0] = (src) == NULL ? 0 : (src)->addr[0]; \
(dest)->addr[1] = (src) == NULL ? 0 : (src)->addr[1]; \
(dest)->addr[2] = (src) == NULL ? 0 : (src)->addr[2]; \
(dest)->addr[3] = (src) == NULL ? 0 : (src)->addr[3]; \
} while (0)

Safely copy one IPv6 address to another (src may be NULL)

Definition at line 443 of file tcpip.h.

◆ ip6_addr_set_zero

#define ip6_addr_set_zero (   ip6addr)
Value:
do { \
(ip6addr)->addr[0] = 0; \
(ip6addr)->addr[1] = 0; \
(ip6addr)->addr[2] = 0; \
(ip6addr)->addr[3] = 0; \
} while (0)

Set complete address to zero

Definition at line 452 of file tcpip.h.

◆ ip6_addr_set_any

#define ip6_addr_set_any (   ip6addr)    ip6_addr_set_zero(ip6addr)

Set address to ipv6 'any' (no need for lwip_htonl())

Definition at line 461 of file tcpip.h.

◆ ip6_addr_set_loopback

#define ip6_addr_set_loopback (   ip6addr)
Value:
do { \
(ip6addr)->addr[0] = 0; \
(ip6addr)->addr[1] = 0; \
(ip6addr)->addr[2] = 0; \
(ip6addr)->addr[3] = PP_HTONL(0x00000001UL); \
} while (0)

Set address to ipv6 loopback address

Definition at line 463 of file tcpip.h.

◆ ip6_addr_set_hton

#define ip6_addr_set_hton (   dest,
  src 
)
Value:
do { \
(dest)->addr[0] = (src) == NULL ? 0 : lwip_htonl((src)->addr[0]); \
(dest)->addr[1] = (src) == NULL ? 0 : lwip_htonl((src)->addr[1]); \
(dest)->addr[2] = (src) == NULL ? 0 : lwip_htonl((src)->addr[2]); \
(dest)->addr[3] = (src) == NULL ? 0 : lwip_htonl((src)->addr[3]); \
} while (0)

Safely copy one IPv6 address to another and change byte order from host- to network-order.

Definition at line 472 of file tcpip.h.

◆ ip6_addr_netcmp

#define ip6_addr_netcmp (   addr1,
  addr2 
)
Value:
(((addr1)->addr[0] == (addr2)->addr[0]) && \
((addr1)->addr[1] == (addr2)->addr[1]))

Determine if two IPv6 address are on the same network.

  • addr1 IPv6 address 1
  • addr2 IPv6 address 2
    Returns
    !0 if the network identifiers of both address match

Definition at line 488 of file tcpip.h.

◆ ip6_addr_cmp

#define ip6_addr_cmp (   addr1,
  addr2 
)
Value:
(((addr1)->addr[0] == (addr2)->addr[0]) && \
((addr1)->addr[1] == (addr2)->addr[1]) && \
((addr1)->addr[2] == (addr2)->addr[2]) && \
((addr1)->addr[3] == (addr2)->addr[3]))

Definition at line 491 of file tcpip.h.

◆ ip6_get_subnet_id

#define ip6_get_subnet_id (   ip6addr)    (lwip_htonl((ip6addr)->addr[2]) & 0x0000ffffUL)

Definition at line 496 of file tcpip.h.

◆ ip6_addr_isany_val

#define ip6_addr_isany_val (   ip6addr)
Value:
(((ip6addr).addr[0] == 0) && \
((ip6addr).addr[1] == 0) && \
((ip6addr).addr[2] == 0) && \
((ip6addr).addr[3] == 0))

Definition at line 498 of file tcpip.h.

◆ ip6_addr_isany

#define ip6_addr_isany (   ip6addr)    (((ip6addr) == NULL) || ip6_addr_isany_val(*(ip6addr)))

Definition at line 502 of file tcpip.h.

◆ ip6_addr_isloopback

#define ip6_addr_isloopback (   ip6addr)
Value:
(((ip6addr)->addr[0] == 0UL) && \
((ip6addr)->addr[1] == 0UL) && \
((ip6addr)->addr[2] == 0UL) && \
((ip6addr)->addr[3] == PP_HTONL(0x00000001UL)))

Definition at line 504 of file tcpip.h.

◆ ip6_addr_isglobal

#define ip6_addr_isglobal (   ip6addr)    (((ip6addr)->addr[0] & PP_HTONL(0xe0000000UL)) == PP_HTONL(0x20000000UL))

Definition at line 509 of file tcpip.h.

◆ ip6_addr_islinklocal

#define ip6_addr_islinklocal (   ip6addr)    (((ip6addr)->addr[0] & PP_HTONL(0xffc00000UL)) == PP_HTONL(0xfe800000UL))

Definition at line 511 of file tcpip.h.

◆ ip6_addr_issitelocal

#define ip6_addr_issitelocal (   ip6addr)    (((ip6addr)->addr[0] & PP_HTONL(0xffc00000UL)) == PP_HTONL(0xfec00000UL))

Definition at line 513 of file tcpip.h.

◆ ip6_addr_isuniquelocal

#define ip6_addr_isuniquelocal (   ip6addr)    (((ip6addr)->addr[0] & PP_HTONL(0xfe000000UL)) == PP_HTONL(0xfc000000UL))

Definition at line 515 of file tcpip.h.

◆ ip6_addr_isipv6mappedipv4

#define ip6_addr_isipv6mappedipv4 (   ip6addr)    (((ip6addr)->addr[0] == 0) && ((ip6addr)->addr[1] == 0) && (((ip6addr)->addr[2]) == PP_HTONL(0x0000FFFFUL)))

Definition at line 517 of file tcpip.h.

◆ ip6_addr_ismulticast

#define ip6_addr_ismulticast (   ip6addr)    (((ip6addr)->addr[0] & PP_HTONL(0xff000000UL)) == PP_HTONL(0xff000000UL))

Definition at line 519 of file tcpip.h.

◆ ip6_addr_multicast_transient_flag

#define ip6_addr_multicast_transient_flag (   ip6addr)    ((ip6addr)->addr[0] & PP_HTONL(0x00100000UL))

Definition at line 520 of file tcpip.h.

◆ ip6_addr_multicast_prefix_flag

#define ip6_addr_multicast_prefix_flag (   ip6addr)    ((ip6addr)->addr[0] & PP_HTONL(0x00200000UL))

Definition at line 521 of file tcpip.h.

◆ ip6_addr_multicast_rendezvous_flag

#define ip6_addr_multicast_rendezvous_flag (   ip6addr)    ((ip6addr)->addr[0] & PP_HTONL(0x00400000UL))

Definition at line 522 of file tcpip.h.

◆ ip6_addr_multicast_scope

#define ip6_addr_multicast_scope (   ip6addr)    ((lwip_htonl((ip6addr)->addr[0]) >> 16) & 0xf)

Definition at line 523 of file tcpip.h.

◆ IP6_MULTICAST_SCOPE_RESERVED

#define IP6_MULTICAST_SCOPE_RESERVED   0x0

Definition at line 524 of file tcpip.h.

◆ IP6_MULTICAST_SCOPE_RESERVED0

#define IP6_MULTICAST_SCOPE_RESERVED0   0x0

Definition at line 525 of file tcpip.h.

◆ IP6_MULTICAST_SCOPE_INTERFACE_LOCAL

#define IP6_MULTICAST_SCOPE_INTERFACE_LOCAL   0x1

Definition at line 526 of file tcpip.h.

◆ IP6_MULTICAST_SCOPE_LINK_LOCAL

#define IP6_MULTICAST_SCOPE_LINK_LOCAL   0x2

Definition at line 527 of file tcpip.h.

◆ IP6_MULTICAST_SCOPE_RESERVED3

#define IP6_MULTICAST_SCOPE_RESERVED3   0x3

Definition at line 528 of file tcpip.h.

◆ IP6_MULTICAST_SCOPE_ADMIN_LOCAL

#define IP6_MULTICAST_SCOPE_ADMIN_LOCAL   0x4

Definition at line 529 of file tcpip.h.

◆ IP6_MULTICAST_SCOPE_SITE_LOCAL

#define IP6_MULTICAST_SCOPE_SITE_LOCAL   0x5

Definition at line 530 of file tcpip.h.

◆ IP6_MULTICAST_SCOPE_ORGANIZATION_LOCAL

#define IP6_MULTICAST_SCOPE_ORGANIZATION_LOCAL   0x8

Definition at line 531 of file tcpip.h.

◆ IP6_MULTICAST_SCOPE_GLOBAL

#define IP6_MULTICAST_SCOPE_GLOBAL   0xe

Definition at line 532 of file tcpip.h.

◆ IP6_MULTICAST_SCOPE_RESERVEDF

#define IP6_MULTICAST_SCOPE_RESERVEDF   0xf

Definition at line 533 of file tcpip.h.

◆ ip6_addr_ismulticast_iflocal

#define ip6_addr_ismulticast_iflocal (   ip6addr)    (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff010000UL))

Definition at line 534 of file tcpip.h.

◆ ip6_addr_ismulticast_linklocal

#define ip6_addr_ismulticast_linklocal (   ip6addr)    (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff020000UL))

Definition at line 535 of file tcpip.h.

◆ ip6_addr_ismulticast_adminlocal

#define ip6_addr_ismulticast_adminlocal (   ip6addr)    (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff040000UL))

Definition at line 536 of file tcpip.h.

◆ ip6_addr_ismulticast_sitelocal

#define ip6_addr_ismulticast_sitelocal (   ip6addr)    (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff050000UL))

Definition at line 537 of file tcpip.h.

◆ ip6_addr_ismulticast_orglocal

#define ip6_addr_ismulticast_orglocal (   ip6addr)    (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff080000UL))

Definition at line 538 of file tcpip.h.

◆ ip6_addr_ismulticast_global

#define ip6_addr_ismulticast_global (   ip6addr)    (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff0e0000UL))

Definition at line 539 of file tcpip.h.

◆ ip6_addr_isallnodes_iflocal

#define ip6_addr_isallnodes_iflocal (   ip6addr)
Value:
(((ip6addr)->addr[0] == PP_HTONL(0xff010000UL)) && \
((ip6addr)->addr[1] == 0UL) && \
((ip6addr)->addr[2] == 0UL) && \
((ip6addr)->addr[3] == PP_HTONL(0x00000001UL)))

Definition at line 542 of file tcpip.h.

◆ ip6_addr_isallnodes_linklocal

#define ip6_addr_isallnodes_linklocal (   ip6addr)
Value:
(((ip6addr)->addr[0] == PP_HTONL(0xff020000UL)) && \
((ip6addr)->addr[1] == 0UL) && \
((ip6addr)->addr[2] == 0UL) && \
((ip6addr)->addr[3] == PP_HTONL(0x00000001UL)))

Definition at line 547 of file tcpip.h.

◆ ip6_addr_set_allnodes_linklocal

#define ip6_addr_set_allnodes_linklocal (   ip6addr)
Value:
do { \
(ip6addr)->addr[0] = PP_HTONL(0xff020000UL); \
(ip6addr)->addr[1] = 0; \
(ip6addr)->addr[2] = 0; \
(ip6addr)->addr[3] = PP_HTONL(0x00000001UL); \
} while (0)

Definition at line 551 of file tcpip.h.

◆ ip6_addr_isallrouters_linklocal

#define ip6_addr_isallrouters_linklocal (   ip6addr)
Value:
(((ip6addr)->addr[0] == PP_HTONL(0xff020000UL)) && \
((ip6addr)->addr[1] == 0UL) && \
((ip6addr)->addr[2] == 0UL) && \
((ip6addr)->addr[3] == PP_HTONL(0x00000002UL)))

Definition at line 559 of file tcpip.h.

◆ ip6_addr_set_allrouters_linklocal

#define ip6_addr_set_allrouters_linklocal (   ip6addr)
Value:
do { \
(ip6addr)->addr[0] = PP_HTONL(0xff020000UL); \
(ip6addr)->addr[1] = 0; \
(ip6addr)->addr[2] = 0; \
(ip6addr)->addr[3] = PP_HTONL(0x00000002UL); \
} while (0)

Definition at line 563 of file tcpip.h.

◆ ip6_addr_issolicitednode

#define ip6_addr_issolicitednode (   ip6addr)
Value:
(((ip6addr)->addr[0] == PP_HTONL(0xff020000UL)) && \
((ip6addr)->addr[2] == PP_HTONL(0x00000001UL)) && \
(((ip6addr)->addr[3] & PP_HTONL(0xff000000UL)) == PP_HTONL(0xff000000UL)))

Definition at line 571 of file tcpip.h.

◆ ip6_addr_set_solicitednode

#define ip6_addr_set_solicitednode (   ip6addr,
  if_id 
)
Value:
do { \
(ip6addr)->addr[0] = PP_HTONL(0xff020000UL); \
(ip6addr)->addr[1] = 0; \
(ip6addr)->addr[2] = PP_HTONL(0x00000001UL); \
(ip6addr)->addr[3] = (PP_HTONL(0xff000000UL) | (if_id)); \
} while (0)

Definition at line 575 of file tcpip.h.

◆ ip6_addr_cmp_solicitednode

#define ip6_addr_cmp_solicitednode (   ip6addr,
  sn_addr 
)
Value:
(((ip6addr)->addr[0] == PP_HTONL(0xff020000UL)) && \
((ip6addr)->addr[1] == 0) && \
((ip6addr)->addr[2] == PP_HTONL(0x00000001UL)) && \
((ip6addr)->addr[3] == (PP_HTONL(0xff000000UL) | (sn_addr)->addr[3])))

Definition at line 583 of file tcpip.h.

◆ IP6_ADDR_INVALID

#define IP6_ADDR_INVALID   0x00

Definition at line 589 of file tcpip.h.

◆ IP6_ADDR_TENTATIVE

#define IP6_ADDR_TENTATIVE   0x08

Definition at line 590 of file tcpip.h.

◆ IP6_ADDR_TENTATIVE_1

#define IP6_ADDR_TENTATIVE_1   0x09 /* 1 probe sent */

Definition at line 591 of file tcpip.h.

◆ IP6_ADDR_TENTATIVE_2

#define IP6_ADDR_TENTATIVE_2   0x0a /* 2 probes sent */

Definition at line 592 of file tcpip.h.

◆ IP6_ADDR_TENTATIVE_3

#define IP6_ADDR_TENTATIVE_3   0x0b /* 3 probes sent */

Definition at line 593 of file tcpip.h.

◆ IP6_ADDR_TENTATIVE_4

#define IP6_ADDR_TENTATIVE_4   0x0c /* 4 probes sent */

Definition at line 594 of file tcpip.h.

◆ IP6_ADDR_TENTATIVE_5

#define IP6_ADDR_TENTATIVE_5   0x0d /* 5 probes sent */

Definition at line 595 of file tcpip.h.

◆ IP6_ADDR_TENTATIVE_6

#define IP6_ADDR_TENTATIVE_6   0x0e /* 6 probes sent */

Definition at line 596 of file tcpip.h.

◆ IP6_ADDR_TENTATIVE_7

#define IP6_ADDR_TENTATIVE_7   0x0f /* 7 probes sent */

Definition at line 597 of file tcpip.h.

◆ IP6_ADDR_VALID

#define IP6_ADDR_VALID   0x10 /* This bit marks an address as valid (preferred or deprecated) */

Definition at line 598 of file tcpip.h.

◆ IP6_ADDR_PREFERRED

#define IP6_ADDR_PREFERRED   0x30

Definition at line 599 of file tcpip.h.

◆ IP6_ADDR_DEPRECATED

#define IP6_ADDR_DEPRECATED   0x10 /* Same as VALID (valid but not preferred) */

Definition at line 600 of file tcpip.h.

◆ IP6_ADDR_TENTATIVE_COUNT_MASK

#define IP6_ADDR_TENTATIVE_COUNT_MASK   0x07 /* 1-7 probes sent */

Definition at line 602 of file tcpip.h.

◆ ip6_addr_isinvalid

#define ip6_addr_isinvalid (   addr_state)    (addr_state == IP6_ADDR_INVALID)

Definition at line 604 of file tcpip.h.

◆ ip6_addr_istentative

#define ip6_addr_istentative (   addr_state)    (addr_state & IP6_ADDR_TENTATIVE)

Definition at line 605 of file tcpip.h.

◆ ip6_addr_isvalid

#define ip6_addr_isvalid (   addr_state)    (addr_state & IP6_ADDR_VALID) /* Include valid, preferred, and deprecated. */

Definition at line 606 of file tcpip.h.

◆ ip6_addr_ispreferred

#define ip6_addr_ispreferred (   addr_state)    (addr_state == IP6_ADDR_PREFERRED)

Definition at line 607 of file tcpip.h.

◆ ip6_addr_isdeprecated

#define ip6_addr_isdeprecated (   addr_state)    (addr_state == IP6_ADDR_DEPRECATED)

Definition at line 608 of file tcpip.h.

◆ ip6_addr_debug_print_parts

#define ip6_addr_debug_print_parts (   debug,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
 
)
Value:
LWIP_DEBUGF(debug, ("%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F, \
a, b, c, d, e, f, g, h))

Definition at line 610 of file tcpip.h.

◆ ip6_addr_debug_print

#define ip6_addr_debug_print (   debug,
  ipaddr 
)
Value:
ip6_addr_debug_print_parts(debug, \
(u16)((ipaddr) != NULL ? IP6_ADDR_BLOCK1(ipaddr) : 0), \
(u16)((ipaddr) != NULL ? IP6_ADDR_BLOCK2(ipaddr) : 0), \
(u16)((ipaddr) != NULL ? IP6_ADDR_BLOCK3(ipaddr) : 0), \
(u16)((ipaddr) != NULL ? IP6_ADDR_BLOCK4(ipaddr) : 0), \
(u16)((ipaddr) != NULL ? IP6_ADDR_BLOCK5(ipaddr) : 0), \
(u16)((ipaddr) != NULL ? IP6_ADDR_BLOCK6(ipaddr) : 0), \
(u16)((ipaddr) != NULL ? IP6_ADDR_BLOCK7(ipaddr) : 0), \
(u16)((ipaddr) != NULL ? IP6_ADDR_BLOCK8(ipaddr) : 0))
#define IP6_ADDR_BLOCK6(ip6addr)
Definition tcpip.h:428
#define IP6_ADDR_BLOCK4(ip6addr)
Definition tcpip.h:424
#define IP6_ADDR_BLOCK5(ip6addr)
Definition tcpip.h:426
#define IP6_ADDR_BLOCK3(ip6addr)
Definition tcpip.h:422
#define IP6_ADDR_BLOCK2(ip6addr)
Definition tcpip.h:420
#define IP6_ADDR_BLOCK7(ip6addr)
Definition tcpip.h:430
#define IP6_ADDR_BLOCK1(ip6addr)
Definition tcpip.h:418
#define IP6_ADDR_BLOCK8(ip6addr)
Definition tcpip.h:432

Definition at line 613 of file tcpip.h.

◆ ip6_addr_debug_print_val

#define ip6_addr_debug_print_val (   debug,
  ipaddr 
)
Value:
ip6_addr_debug_print_parts(debug, \
IP6_ADDR_BLOCK1(&(ipaddr)), \
IP6_ADDR_BLOCK2(&(ipaddr)), \
IP6_ADDR_BLOCK3(&(ipaddr)), \
IP6_ADDR_BLOCK4(&(ipaddr)), \
IP6_ADDR_BLOCK5(&(ipaddr)), \
IP6_ADDR_BLOCK6(&(ipaddr)), \
IP6_ADDR_BLOCK7(&(ipaddr)), \
IP6_ADDR_BLOCK8(&(ipaddr)))

Definition at line 623 of file tcpip.h.

◆ IP6ADDR_STRLEN_MAX

#define IP6ADDR_STRLEN_MAX   46

Definition at line 634 of file tcpip.h.

◆ IP_ADDR_PCB_VERSION_MATCH

#define IP_ADDR_PCB_VERSION_MATCH (   addr,
  pcb 
)    1

Definition at line 902 of file tcpip.h.

◆ IP_ADDR_PCB_VERSION_MATCH_EXACT

#define IP_ADDR_PCB_VERSION_MATCH_EXACT (   pcb,
  ipaddr 
)    1

Definition at line 903 of file tcpip.h.

◆ IPADDR4_INIT

#define IPADDR4_INIT (   u32val)
Value:
{ \
u32val \
}

Definition at line 908 of file tcpip.h.

◆ IP_IS_V4_VAL

#define IP_IS_V4_VAL (   ipaddr)    1

Definition at line 912 of file tcpip.h.

◆ IP_IS_V6_VAL

#define IP_IS_V6_VAL (   ipaddr)    0

Definition at line 913 of file tcpip.h.

◆ IP_IS_V4

#define IP_IS_V4 (   ipaddr)    1

Definition at line 914 of file tcpip.h.

◆ IP_IS_V6

#define IP_IS_V6 (   ipaddr)    0

Definition at line 915 of file tcpip.h.

◆ IP_IS_ANY_TYPE_VAL

#define IP_IS_ANY_TYPE_VAL (   ipaddr)    0

Definition at line 916 of file tcpip.h.

◆ IP_SET_TYPE_VAL

#define IP_SET_TYPE_VAL (   ipaddr,
  iptype 
)

Definition at line 917 of file tcpip.h.

◆ IP_SET_TYPE

#define IP_SET_TYPE (   ipaddr,
  iptype 
)

Definition at line 918 of file tcpip.h.

◆ IP_GET_TYPE

#define IP_GET_TYPE (   ipaddr)    IPADDR_TYPE_V4

Definition at line 919 of file tcpip.h.

◆ ip_2_ip4

#define ip_2_ip4 (   ipaddr)    (ipaddr)

Definition at line 920 of file tcpip.h.

◆ IP_ADDR4

#define IP_ADDR4 (   ipaddr,
  a,
  b,
  c,
 
)    IP4_ADDR(ipaddr, a, b, c, d)

Definition at line 921 of file tcpip.h.

◆ ip_addr_copy

#define ip_addr_copy (   dest,
  src 
)    ip4_addr_copy(dest, src)

Definition at line 923 of file tcpip.h.

◆ ip_addr_copy_from_ip4

#define ip_addr_copy_from_ip4 (   dest,
  src 
)    ip4_addr_copy(dest, src)

Definition at line 924 of file tcpip.h.

◆ ip_addr_set_ip4_u32

#define ip_addr_set_ip4_u32 (   ipaddr,
  val 
)    ip4_addr_set_u32(ip_2_ip4(ipaddr), val)

Definition at line 925 of file tcpip.h.

◆ ip_addr_get_ip4_u32

#define ip_addr_get_ip4_u32 (   ipaddr)    ip4_addr_get_u32(ip_2_ip4(ipaddr))

Definition at line 926 of file tcpip.h.

◆ ip_addr_set

#define ip_addr_set (   dest,
  src 
)    ip4_addr_set(dest, src)

Definition at line 927 of file tcpip.h.

◆ ip_addr_set_ipaddr

#define ip_addr_set_ipaddr (   dest,
  src 
)    ip4_addr_set(dest, src)

Definition at line 928 of file tcpip.h.

◆ ip_addr_set_zero

#define ip_addr_set_zero (   ipaddr)    ip4_addr_set_zero(ipaddr)

Definition at line 929 of file tcpip.h.

◆ ip_addr_set_zero_ip4

#define ip_addr_set_zero_ip4 (   ipaddr)    ip4_addr_set_zero(ipaddr)

Definition at line 930 of file tcpip.h.

◆ ip_addr_set_any

#define ip_addr_set_any (   is_ipv6,
  ipaddr 
)    ip4_addr_set_any(ipaddr)

Definition at line 931 of file tcpip.h.

◆ ip_addr_set_loopback

#define ip_addr_set_loopback (   is_ipv6,
  ipaddr 
)    ip4_addr_set_loopback(ipaddr)

Definition at line 932 of file tcpip.h.

◆ ip_addr_set_hton

#define ip_addr_set_hton (   dest,
  src 
)    ip4_addr_set_hton(dest, src)

Definition at line 933 of file tcpip.h.

◆ ip_addr_get_network

#define ip_addr_get_network (   target,
  host,
  mask 
)    ip4_addr_get_network(target, host, mask)

Definition at line 934 of file tcpip.h.

◆ ip_addr_netcmp

#define ip_addr_netcmp (   addr1,
  addr2,
  mask 
)    ip4_addr_netcmp(addr1, addr2, mask)

Definition at line 935 of file tcpip.h.

◆ ip_addr_cmp

#define ip_addr_cmp (   addr1,
  addr2 
)    ip4_addr_cmp(addr1, addr2)

Definition at line 936 of file tcpip.h.

◆ ip_addr_isany

#define ip_addr_isany (   ipaddr)    ip4_addr_isany(ipaddr)

Definition at line 937 of file tcpip.h.

◆ ip_addr_isany_val

#define ip_addr_isany_val (   ipaddr)    ip4_addr_isany_val(ipaddr)

Definition at line 938 of file tcpip.h.

◆ ip_addr_isloopback

#define ip_addr_isloopback (   ipaddr)    ip4_addr_isloopback(ipaddr)

Definition at line 939 of file tcpip.h.

◆ ip_addr_islinklocal

#define ip_addr_islinklocal (   ipaddr)    ip4_addr_islinklocal(ipaddr)

Definition at line 940 of file tcpip.h.

◆ ip_addr_isbroadcast

#define ip_addr_isbroadcast (   addr,
  netif 
)    ip4_addr_isbroadcast(addr, netif)

Definition at line 941 of file tcpip.h.

◆ ip_addr_ismulticast

#define ip_addr_ismulticast (   ipaddr)    ip4_addr_ismulticast(ipaddr)

Definition at line 942 of file tcpip.h.

◆ ip_addr_debug_print

#define ip_addr_debug_print (   debug,
  ipaddr 
)    ip4_addr_debug_print(debug, ipaddr)

Definition at line 943 of file tcpip.h.

◆ ip_addr_debug_print_val

#define ip_addr_debug_print_val (   debug,
  ipaddr 
)    ip4_addr_debug_print_val(debug, ipaddr)

Definition at line 944 of file tcpip.h.

◆ ipaddr_ntoa

#define ipaddr_ntoa (   ipaddr)    ip4addr_ntoa(ipaddr)

Definition at line 945 of file tcpip.h.

◆ ipaddr_ntoa_r

#define ipaddr_ntoa_r (   ipaddr,
  buf,
  buflen 
)    ip4addr_ntoa_r(ipaddr, buf, buflen)

Definition at line 946 of file tcpip.h.

◆ ipaddr_aton

#define ipaddr_aton (   cp,
  addr 
)    ip4addr_aton(cp, addr)

Definition at line 947 of file tcpip.h.

◆ IPADDR_STRLEN_MAX

#define IPADDR_STRLEN_MAX   IP4ADDR_STRLEN_MAX

Definition at line 949 of file tcpip.h.

◆ IP_ADDR_ANY

#define IP_ADDR_ANY   IP4_ADDR_ANY

Provided for compatibility. Use IP4_ADDR_ANY for better readability.

Definition at line 1009 of file tcpip.h.

◆ IP4_ADDR_ANY

#define IP4_ADDR_ANY   (&ip_addr_any)

Can be used as a fixed/const ip_addr_t for the IPv4 wildcard and the broadcast address

Definition at line 1015 of file tcpip.h.

◆ IP4_ADDR_ANY4

#define IP4_ADDR_ANY4   (ip_2_ip4(&ip_addr_any))

Can be used as a fixed/const ip4_addr_t for the wildcard and the broadcast address

Definition at line 1021 of file tcpip.h.

◆ IP_ADDR_BROADCAST

#define IP_ADDR_BROADCAST   (&ip_addr_broadcast)

Definition at line 1024 of file tcpip.h.

◆ IP4_ADDR_BROADCAST

#define IP4_ADDR_BROADCAST   (ip_2_ip4(&ip_addr_broadcast))

Definition at line 1026 of file tcpip.h.

◆ IP_ANY_TYPE

#define IP_ANY_TYPE   IP_ADDR_ANY

Definition at line 1058 of file tcpip.h.

◆ NETIF_MAX_HWADDR_LEN

#define NETIF_MAX_HWADDR_LEN   6U

Must be the maximum of all used hardware address lengths across all types of interfaces in use. This does not have to be changed, normally.

Definition at line 1071 of file tcpip.h.

◆ netif_set_client_data

#define netif_set_client_data (   netif,
  id,
  data 
)    netif_get_client_data(netif, id) = (data)

Set client data. Obtain ID from netif_alloc_client_data_id().

Definition at line 1222 of file tcpip.h.

◆ netif_get_client_data

#define netif_get_client_data (   netif,
  id 
)    (netif)->client_data[(id)]

Get client data. Obtain ID from netif_alloc_client_data_id().

Definition at line 1226 of file tcpip.h.

◆ NETIF_SET_CHECKSUM_CTRL

#define NETIF_SET_CHECKSUM_CTRL (   netif,
  chksumflags 
)

Definition at line 1358 of file tcpip.h.

◆ IF__NETIF_CHECKSUM_ENABLED

#define IF__NETIF_CHECKSUM_ENABLED (   netif,
  chksumflag 
)

Definition at line 1359 of file tcpip.h.

◆ netif_ip4_addr

#define netif_ip4_addr (   netif)    ((const ip4_addr_t *)ip_2_ip4(&((netif)->ip_addr)))

Definition at line 1369 of file tcpip.h.

◆ netif_ip4_netmask

#define netif_ip4_netmask (   netif)    ((const ip4_addr_t *)ip_2_ip4(&((netif)->netmask)))

Definition at line 1371 of file tcpip.h.

◆ netif_ip4_gw

#define netif_ip4_gw (   netif)    ((const ip4_addr_t *)ip_2_ip4(&((netif)->gw)))

Definition at line 1373 of file tcpip.h.

◆ netif_ip_addr4

#define netif_ip_addr4 (   netif)    ((const ip_addr_t *)&((netif)->ip_addr))

Definition at line 1375 of file tcpip.h.

◆ netif_ip_netmask4

#define netif_ip_netmask4 (   netif)    ((const ip_addr_t *)&((netif)->netmask))

Definition at line 1377 of file tcpip.h.

◆ netif_ip_gw4

#define netif_ip_gw4 (   netif)    ((const ip_addr_t *)&((netif)->gw))

Definition at line 1379 of file tcpip.h.

◆ netif_is_up

#define netif_is_up (   netif)    (((netif)->flags & NETIF_FLAG_UP) ? (u8)1 : (u8)0)

Ask if an interface is up

Definition at line 1385 of file tcpip.h.

◆ netif_is_link_up

#define netif_is_link_up (   netif)    (((netif)->flags & NETIF_FLAG_LINK_UP) ? (u8)1 : (u8)0)

Ask if a link is up

Definition at line 1388 of file tcpip.h.

◆ NETIF_SET_HWADDRHINT

#define NETIF_SET_HWADDRHINT (   netif,
  hint 
)

Definition at line 1449 of file tcpip.h.

◆ s6_addr

#define s6_addr   un.u8_addr

Definition at line 1484 of file tcpip.h.

◆ INADDR_NONE

#define INADDR_NONE   IPADDR_NONE

255.255.255.255

Definition at line 1488 of file tcpip.h.

◆ INADDR_LOOPBACK

#define INADDR_LOOPBACK   IPADDR_LOOPBACK

127.0.0.1

Definition at line 1490 of file tcpip.h.

◆ INADDR_ANY

#define INADDR_ANY   IPADDR_ANY

0.0.0.0

Definition at line 1492 of file tcpip.h.

◆ INADDR_BROADCAST

#define INADDR_BROADCAST   IPADDR_BROADCAST

255.255.255.255

Definition at line 1494 of file tcpip.h.

◆ SIN_ZERO_LEN

#define SIN_ZERO_LEN   8

Definition at line 1515 of file tcpip.h.

◆ SOCKLEN_T_DEFINED

#define SOCKLEN_T_DEFINED   1

Definition at line 1551 of file tcpip.h.

◆ SOCK_STREAM

#define SOCK_STREAM   1

Definition at line 1555 of file tcpip.h.

◆ SOCK_DGRAM

#define SOCK_DGRAM   2

Definition at line 1556 of file tcpip.h.

◆ SOCK_RAW

#define SOCK_RAW   3

Definition at line 1557 of file tcpip.h.

◆ SO_REUSEADDR

#define SO_REUSEADDR   0x0004 /* Allow local address reuse */

Definition at line 1562 of file tcpip.h.

◆ SO_KEEPALIVE

#define SO_KEEPALIVE   0x0008 /* keep connections alive */

Definition at line 1563 of file tcpip.h.

◆ SO_BROADCAST

#define SO_BROADCAST   0x0020 /* permit to send and to receive broadcast messages (see IP_SOF_BROADCAST option) */

Definition at line 1564 of file tcpip.h.

◆ SO_DEBUG

#define SO_DEBUG   0x0001 /* Unimplemented: turn on debugging info recording */

Definition at line 1570 of file tcpip.h.

◆ SO_ACCEPTCONN

#define SO_ACCEPTCONN   0x0002 /* socket has had listen() */

Definition at line 1571 of file tcpip.h.

◆ SO_DONTROUTE

#define SO_DONTROUTE   0x0010 /* Unimplemented: just use interface addresses */

Definition at line 1572 of file tcpip.h.

◆ SO_USELOOPBACK

#define SO_USELOOPBACK   0x0040 /* Unimplemented: bypass hardware when possible */

Definition at line 1573 of file tcpip.h.

◆ SO_LINGER

#define SO_LINGER   0x0080 /* linger on close if data present */

Definition at line 1574 of file tcpip.h.

◆ SO_DONTLINGER

#define SO_DONTLINGER   ((int)(~SO_LINGER))

Definition at line 1575 of file tcpip.h.

◆ SO_OOBINLINE

#define SO_OOBINLINE   0x0100 /* Unimplemented: leave received OOB data in line */

Definition at line 1576 of file tcpip.h.

◆ SO_REUSEPORT

#define SO_REUSEPORT   0x0200 /* Unimplemented: allow local address & port reuse */

Definition at line 1577 of file tcpip.h.

◆ SO_SNDBUF

#define SO_SNDBUF   0x1001 /* Unimplemented: send buffer size */

Definition at line 1578 of file tcpip.h.

◆ SO_RCVBUF

#define SO_RCVBUF   0x1002 /* receive buffer size */

Definition at line 1579 of file tcpip.h.

◆ SO_SNDLOWAT

#define SO_SNDLOWAT   0x1003 /* Unimplemented: send low-water mark */

Definition at line 1580 of file tcpip.h.

◆ SO_RCVLOWAT

#define SO_RCVLOWAT   0x1004 /* Unimplemented: receive low-water mark */

Definition at line 1581 of file tcpip.h.

◆ SO_SNDTIMEO

#define SO_SNDTIMEO   0x1005 /* send timeout */

Definition at line 1582 of file tcpip.h.

◆ SO_RCVTIMEO

#define SO_RCVTIMEO   0x1006 /* receive timeout */

Definition at line 1583 of file tcpip.h.

◆ SO_ERROR

#define SO_ERROR   0x1007 /* get error status and clear */

Definition at line 1584 of file tcpip.h.

◆ SO_TYPE

#define SO_TYPE   0x1008 /* get socket type */

Definition at line 1585 of file tcpip.h.

◆ SO_CONTIMEO

#define SO_CONTIMEO   0x1009 /* Unimplemented: connect timeout */

Definition at line 1586 of file tcpip.h.

◆ SO_NO_CHECK

#define SO_NO_CHECK   0x100a /* don't create UDP checksum */

Definition at line 1587 of file tcpip.h.

◆ SOL_SOCKET

#define SOL_SOCKET   0xfff /* options for socket level */

Definition at line 1592 of file tcpip.h.

◆ AF_UNSPEC

#define AF_UNSPEC   0

Definition at line 1594 of file tcpip.h.

◆ AF_INET

#define AF_INET   2

Definition at line 1595 of file tcpip.h.

◆ AF_INET6

#define AF_INET6   AF_UNSPEC

Definition at line 1599 of file tcpip.h.

◆ PF_INET

#define PF_INET   AF_INET

Definition at line 1601 of file tcpip.h.

◆ PF_INET6

#define PF_INET6   AF_INET6

Definition at line 1602 of file tcpip.h.

◆ PF_UNSPEC

#define PF_UNSPEC   AF_UNSPEC

Definition at line 1603 of file tcpip.h.

◆ IPPROTO_IP

#define IPPROTO_IP   0

Definition at line 1605 of file tcpip.h.

◆ IPPROTO_ICMP

#define IPPROTO_ICMP   1

Definition at line 1606 of file tcpip.h.

◆ IPPROTO_TCP

#define IPPROTO_TCP   6

Definition at line 1607 of file tcpip.h.

◆ IPPROTO_UDP

#define IPPROTO_UDP   17

Definition at line 1608 of file tcpip.h.

◆ IPPROTO_UDPLITE

#define IPPROTO_UDPLITE   136

Definition at line 1613 of file tcpip.h.

◆ IPPROTO_RAW

#define IPPROTO_RAW   255

Definition at line 1614 of file tcpip.h.

◆ MSG_PEEK

#define MSG_PEEK   0x01 /* Peeks at an incoming message */

Definition at line 1617 of file tcpip.h.

◆ MSG_WAITALL

#define MSG_WAITALL   0x02 /* Unimplemented: Requests that the function block until the full amount of data requested can be returned */

Definition at line 1618 of file tcpip.h.

◆ MSG_OOB

#define MSG_OOB   0x04 /* Unimplemented: Requests out-of-band data. The significance and semantics of out-of-band data are protocol-specific */

Definition at line 1619 of file tcpip.h.

◆ MSG_DONTWAIT

#define MSG_DONTWAIT   0x08 /* Nonblocking i/o for this operation only */

Definition at line 1620 of file tcpip.h.

◆ MSG_MORE

#define MSG_MORE   0x10 /* Sender will send more */

Definition at line 1621 of file tcpip.h.

◆ IP_TOS

#define IP_TOS   1

Definition at line 1626 of file tcpip.h.

◆ IP_TTL

#define IP_TTL   2

Definition at line 1627 of file tcpip.h.

◆ TCP_NODELAY

#define TCP_NODELAY   0x01 /* don't delay send to coalesce packets */

Definition at line 1633 of file tcpip.h.

◆ TCP_KEEPALIVE

#define TCP_KEEPALIVE   0x02 /* send KEEPALIVE probes when idle for pcb->keep_idle milliseconds */

Definition at line 1634 of file tcpip.h.

◆ TCP_KEEPIDLE

#define TCP_KEEPIDLE   0x03 /* set pcb->keep_idle - Same as TCP_KEEPALIVE, but use seconds for get/setsockopt */

Definition at line 1635 of file tcpip.h.

◆ TCP_KEEPINTVL

#define TCP_KEEPINTVL   0x04 /* set pcb->keep_intvl - Use seconds for get/setsockopt */

Definition at line 1636 of file tcpip.h.

◆ TCP_KEEPCNT

#define TCP_KEEPCNT   0x05 /* set pcb->keep_cnt - Use number of probes sent for get/setsockopt */

Definition at line 1637 of file tcpip.h.

◆ IPTOS_TOS_MASK

#define IPTOS_TOS_MASK   0x1E

Definition at line 1696 of file tcpip.h.

◆ IPTOS_TOS

#define IPTOS_TOS (   tos)    ((tos)&IPTOS_TOS_MASK)

Definition at line 1697 of file tcpip.h.

◆ IPTOS_LOWDELAY

#define IPTOS_LOWDELAY   0x10

Definition at line 1698 of file tcpip.h.

◆ IPTOS_THROUGHPUT

#define IPTOS_THROUGHPUT   0x08

Definition at line 1699 of file tcpip.h.

◆ IPTOS_RELIABILITY

#define IPTOS_RELIABILITY   0x04

Definition at line 1700 of file tcpip.h.

◆ IPTOS_LOWCOST

#define IPTOS_LOWCOST   0x02

Definition at line 1701 of file tcpip.h.

◆ IPTOS_MINCOST

#define IPTOS_MINCOST   IPTOS_LOWCOST

Definition at line 1702 of file tcpip.h.

◆ IPTOS_PREC_MASK

#define IPTOS_PREC_MASK   0xe0

Definition at line 1713 of file tcpip.h.

◆ IPTOS_PREC

#define IPTOS_PREC (   tos)    ((tos)&IPTOS_PREC_MASK)

Definition at line 1714 of file tcpip.h.

◆ IPTOS_PREC_NETCONTROL

#define IPTOS_PREC_NETCONTROL   0xe0

Definition at line 1715 of file tcpip.h.

◆ IPTOS_PREC_INTERNETCONTROL

#define IPTOS_PREC_INTERNETCONTROL   0xc0

Definition at line 1716 of file tcpip.h.

◆ IPTOS_PREC_CRITIC_ECP

#define IPTOS_PREC_CRITIC_ECP   0xa0

Definition at line 1717 of file tcpip.h.

◆ IPTOS_PREC_FLASHOVERRIDE

#define IPTOS_PREC_FLASHOVERRIDE   0x80

Definition at line 1718 of file tcpip.h.

◆ IPTOS_PREC_FLASH

#define IPTOS_PREC_FLASH   0x60

Definition at line 1719 of file tcpip.h.

◆ IPTOS_PREC_IMMEDIATE

#define IPTOS_PREC_IMMEDIATE   0x40

Definition at line 1720 of file tcpip.h.

◆ IPTOS_PREC_PRIORITY

#define IPTOS_PREC_PRIORITY   0x20

Definition at line 1721 of file tcpip.h.

◆ IPTOS_PREC_ROUTINE

#define IPTOS_PREC_ROUTINE   0x00

Definition at line 1722 of file tcpip.h.

◆ IOCPARM_MASK

#define IOCPARM_MASK   0x7fU /* parameters must be < 128 bytes */

Definition at line 1736 of file tcpip.h.

◆ IOC_VOID

#define IOC_VOID   0x20000000UL /* no parameters */

Definition at line 1737 of file tcpip.h.

◆ IOC_OUT

#define IOC_OUT   0x40000000UL /* copy out parameters */

Definition at line 1738 of file tcpip.h.

◆ IOC_IN

#define IOC_IN   0x80000000UL /* copy in parameters */

Definition at line 1739 of file tcpip.h.

◆ IOC_INOUT

#define IOC_INOUT   (IOC_IN | IOC_OUT)

Definition at line 1740 of file tcpip.h.

◆ _IO

#define _IO (   x,
 
)    (IOC_VOID | ((x) << 8) | (y))

Definition at line 1743 of file tcpip.h.

◆ _IOR

#define _IOR (   x,
  y,
 
)    (IOC_OUT | (((long)sizeof(t) & IOCPARM_MASK) << 16) | ((x) << 8) | (y))

Definition at line 1745 of file tcpip.h.

◆ _IOW

#define _IOW (   x,
  y,
 
)    (IOC_IN | (((long)sizeof(t) & IOCPARM_MASK) << 16) | ((x) << 8) | (y))

Definition at line 1747 of file tcpip.h.

◆ FIONREAD

#define FIONREAD   _IOR('f', 127, unsigned long) /* get # bytes to read */

Definition at line 1751 of file tcpip.h.

◆ FIONBIO

#define FIONBIO   _IOW('f', 126, unsigned long) /* set/clear non-blocking i/o */

Definition at line 1754 of file tcpip.h.

◆ SIOCSHIWAT

#define SIOCSHIWAT   _IOW('s', 0, unsigned long) /* set high watermark */

Definition at line 1759 of file tcpip.h.

◆ SIOCGHIWAT

#define SIOCGHIWAT   _IOR('s', 1, unsigned long) /* get high watermark */

Definition at line 1760 of file tcpip.h.

◆ SIOCSLOWAT

#define SIOCSLOWAT   _IOW('s', 2, unsigned long) /* set low watermark */

Definition at line 1761 of file tcpip.h.

◆ SIOCGLOWAT

#define SIOCGLOWAT   _IOR('s', 3, unsigned long) /* get low watermark */

Definition at line 1762 of file tcpip.h.

◆ SIOCATMARK

#define SIOCATMARK   _IOR('s', 7, unsigned long) /* at oob mark? */

Definition at line 1763 of file tcpip.h.

◆ F_GETFL

#define F_GETFL   3

Definition at line 1768 of file tcpip.h.

◆ F_SETFL

#define F_SETFL   4

Definition at line 1771 of file tcpip.h.

◆ O_NONBLOCK

#define O_NONBLOCK   1 /* nonblocking I/O */

Definition at line 1777 of file tcpip.h.

◆ O_NDELAY

#define O_NDELAY   1 /* same as O_NONBLOCK, for compatibility */

Definition at line 1780 of file tcpip.h.

◆ SHUT_RD

#define SHUT_RD   0

Definition at line 1784 of file tcpip.h.

◆ SHUT_WR

#define SHUT_WR   1

Definition at line 1785 of file tcpip.h.

◆ SHUT_RDWR

#define SHUT_RDWR   2

Definition at line 1786 of file tcpip.h.

◆ FD_SETSIZE

#define FD_SETSIZE   MEMP_NUM_NETCONN

Definition at line 1793 of file tcpip.h.

◆ FDSETSAFESET

#define FDSETSAFESET (   n,
  code 
)
Value:
do { \
if (((n)-LWIP_SOCKET_OFFSET < MEMP_NUM_NETCONN) && (((int)(n)-LWIP_SOCKET_OFFSET) >= 0)) { \
code; \
} \
} while (0)

Definition at line 1794 of file tcpip.h.

◆ FDSETSAFEGET

#define FDSETSAFEGET (   n,
  code 
)
Value:
(((n)-LWIP_SOCKET_OFFSET < MEMP_NUM_NETCONN) && (((int)(n)-LWIP_SOCKET_OFFSET) >= 0) ? \
(code) : \
0)

Definition at line 1800 of file tcpip.h.

◆ FD_SET

#define FD_SET (   n,
 
)    FDSETSAFESET(n, (p)->fd_bits[((n)-LWIP_SOCKET_OFFSET) / 8] |= (1 << (((n)-LWIP_SOCKET_OFFSET) & 7)))

Definition at line 1803 of file tcpip.h.

◆ FD_CLR

#define FD_CLR (   n,
 
)    FDSETSAFESET(n, (p)->fd_bits[((n)-LWIP_SOCKET_OFFSET) / 8] &= ~(1 << (((n)-LWIP_SOCKET_OFFSET) & 7)))

Definition at line 1804 of file tcpip.h.

◆ FD_ISSET

#define FD_ISSET (   n,
 
)    FDSETSAFEGET(n, (p)->fd_bits[((n)-LWIP_SOCKET_OFFSET) / 8] & (1 << (((n)-LWIP_SOCKET_OFFSET) & 7)))

Definition at line 1805 of file tcpip.h.

◆ FD_ZERO

#define FD_ZERO (   p)    memset((void *)(p), 0, sizeof(*(p)))

Definition at line 1806 of file tcpip.h.

◆ DNS_TMR_INTERVAL

#define DNS_TMR_INTERVAL   1000

DNS timer period

Definition at line 1821 of file tcpip.h.

◆ LWIP_DNS_ADDRTYPE_IPV4

#define LWIP_DNS_ADDRTYPE_IPV4   0

Definition at line 1824 of file tcpip.h.

◆ LWIP_DNS_ADDRTYPE_IPV6

#define LWIP_DNS_ADDRTYPE_IPV6   1

Definition at line 1825 of file tcpip.h.

◆ LWIP_DNS_ADDRTYPE_IPV4_IPV6

#define LWIP_DNS_ADDRTYPE_IPV4_IPV6   2 /* try to resolve IPv4 first, try IPv6 if IPv4 fails only */

Definition at line 1826 of file tcpip.h.

◆ LWIP_DNS_ADDRTYPE_IPV6_IPV4

#define LWIP_DNS_ADDRTYPE_IPV6_IPV4   3 /* try to resolve IPv6 first, try IPv4 if IPv6 fails only */

Definition at line 1827 of file tcpip.h.

◆ LWIP_DNS_ADDRTYPE_DEFAULT

#define LWIP_DNS_ADDRTYPE_DEFAULT   LWIP_DNS_ADDRTYPE_IPV4

Definition at line 1833 of file tcpip.h.

◆ LWIP_DNS_API_DECLARE_H_ERRNO

#define LWIP_DNS_API_DECLARE_H_ERRNO   1

Definition at line 1869 of file tcpip.h.

◆ LWIP_DNS_API_DEFINE_ERRORS

#define LWIP_DNS_API_DEFINE_ERRORS   1

Definition at line 1873 of file tcpip.h.

◆ LWIP_DNS_API_DEFINE_FLAGS

#define LWIP_DNS_API_DEFINE_FLAGS   1

Definition at line 1877 of file tcpip.h.

◆ LWIP_DNS_API_DECLARE_STRUCTS

#define LWIP_DNS_API_DECLARE_STRUCTS   1

Definition at line 1881 of file tcpip.h.

◆ EAI_NONAME

#define EAI_NONAME   200

Errors used by the DNS API functions, h_errno can be one of them

Definition at line 1886 of file tcpip.h.

◆ EAI_SERVICE

#define EAI_SERVICE   201

Definition at line 1887 of file tcpip.h.

◆ EAI_FAIL

#define EAI_FAIL   202

Definition at line 1888 of file tcpip.h.

◆ EAI_MEMORY

#define EAI_MEMORY   203

Definition at line 1889 of file tcpip.h.

◆ EAI_FAMILY

#define EAI_FAMILY   204

Definition at line 1890 of file tcpip.h.

◆ HOST_NOT_FOUND

#define HOST_NOT_FOUND   210

Definition at line 1892 of file tcpip.h.

◆ NO_DATA

#define NO_DATA   211

Definition at line 1893 of file tcpip.h.

◆ NO_RECOVERY

#define NO_RECOVERY   212

Definition at line 1894 of file tcpip.h.

◆ TRY_AGAIN

#define TRY_AGAIN   213

Definition at line 1895 of file tcpip.h.

◆ AI_PASSIVE

#define AI_PASSIVE   0x01

Definition at line 1900 of file tcpip.h.

◆ AI_CANONNAME

#define AI_CANONNAME   0x02

Definition at line 1901 of file tcpip.h.

◆ AI_NUMERICHOST

#define AI_NUMERICHOST   0x04

Definition at line 1902 of file tcpip.h.

◆ AI_NUMERICSERV

#define AI_NUMERICSERV   0x08

Definition at line 1903 of file tcpip.h.

◆ AI_V4MAPPED

#define AI_V4MAPPED   0x10

Definition at line 1904 of file tcpip.h.

◆ AI_ALL

#define AI_ALL   0x20

Definition at line 1905 of file tcpip.h.

◆ AI_ADDRCONFIG

#define AI_ADDRCONFIG   0x40

Definition at line 1906 of file tcpip.h.

◆ h_addr

#define h_addr   h_addr_list[0] /* for backward compatibility */

Definition at line 1919 of file tcpip.h.

◆ NETDB_ELEM_SIZE

#define NETDB_ELEM_SIZE   (sizeof(struct addrinfo) + sizeof(struct sockaddr_storage) + DNS_MAX_NAME_LENGTH + 1)

Definition at line 1935 of file tcpip.h.

◆ htons

#define htons (   x)    lwip_htons(x)

Definition at line 1938 of file tcpip.h.

◆ ntohs

#define ntohs (   x)    lwip_ntohs(x)

Definition at line 1939 of file tcpip.h.

◆ htonl

#define htonl (   x)    lwip_htonl(x)

Definition at line 1940 of file tcpip.h.

◆ ntohl

#define ntohl (   x)    lwip_ntohl(x)

Definition at line 1941 of file tcpip.h.

◆ lwip_htons

#define lwip_htons (   x)    PP_HTONS(x)

Definition at line 1943 of file tcpip.h.

◆ lwip_ntohs

#define lwip_ntohs (   x)    PP_NTOHS(x)

Definition at line 1944 of file tcpip.h.

◆ lwip_htonl

#define lwip_htonl (   x)    PP_HTONL(x)

Definition at line 1945 of file tcpip.h.

◆ lwip_ntohl

#define lwip_ntohl (   x)    PP_NTOHL(x)

Definition at line 1946 of file tcpip.h.

◆ PP_HTONS

#define PP_HTONS (   x)    ((((x)&0xff) << 8) | (((x)&0xff00) >> 8))

Definition at line 1951 of file tcpip.h.

◆ PP_NTOHS

#define PP_NTOHS (   x)    PP_HTONS(x)

Definition at line 1952 of file tcpip.h.

◆ PP_HTONL

#define PP_HTONL (   x)
Value:
((((x)&0xff) << 24) | \
(((x)&0xff00) << 8) | \
(((x)&0xff0000UL) >> 8) | \
(((x)&0xff000000UL) >> 24))

Definition at line 1953 of file tcpip.h.

◆ PP_NTOHL

#define PP_NTOHL (   x)    PP_HTONL(x)

Definition at line 1957 of file tcpip.h.

Typedef Documentation

◆ err_t

typedef signed char err_t

Definition at line 129 of file tcpip.h.

◆ ip4_addr_t

typedef struct ip4_addr ip4_addr_t

ip4_addr_t uses a struct for convenience only, so that the same defines can operate both on ip4_addr_t as well as on ip4_addr_p_t.

Definition at line 243 of file tcpip.h.

◆ ip4_addr_p_t

typedef struct ip4_addr_packed ip4_addr_p_t

Definition at line 244 of file tcpip.h.

◆ ip6_addr_t

typedef struct ip6_addr ip6_addr_t

IPv6 address

Definition at line 396 of file tcpip.h.

◆ ip6_addr_p_t

typedef struct ip6_addr_packed ip6_addr_p_t

Definition at line 397 of file tcpip.h.

◆ ip_addr_t

Definition at line 907 of file tcpip.h.

◆ netif_init_fn

typedef err_t(* netif_init_fn) (struct netif *netif)

Function prototype for netif init functions. Set up flags and output/linkoutput callback functions in this function.

Parameters
netifThe netif to initialize

Definition at line 1162 of file tcpip.h.

◆ netif_input_fn

typedef err_t(* netif_input_fn) (struct pbuf *p, struct netif *inp)

Function prototype for netif->input functions. This function is saved as 'input' callback function in the netif struct. Call it when a packet has been received.

Parameters
pThe received packet, copied into a pbuf
inpThe netif which received the packet

Definition at line 1169 of file tcpip.h.

◆ netif_output_fn

typedef err_t(* netif_output_fn) (struct netif *netif, struct pbuf *p, const ip4_addr_t *ipaddr)

Function prototype for netif->output functions. Called by lwIP when a packet shall be sent. For ethernet netif, set this to 'etharp_output' and set 'linkoutput'.

Parameters
netifThe netif which shall send a packet
pThe packet to send (p->payload points to IP header)
ipaddrThe IP address to which the packet shall be sent

Definition at line 1180 of file tcpip.h.

◆ netif_linkoutput_fn

typedef err_t(* netif_linkoutput_fn) (struct netif *netif, struct pbuf *p)

Function prototype for netif->linkoutput functions. Only used for ethernet netifs. This function is called by ARP when a packet shall be sent.

Parameters
netifThe netif which shall send a packet
pThe packet to send (raw ethernet packet)

Definition at line 1203 of file tcpip.h.

◆ netif_status_callback_fn

typedef void(* netif_status_callback_fn) (struct netif *netif)

Function prototype for netif status- or link-callback functions.

Definition at line 1205 of file tcpip.h.

◆ sa_family_t

typedef u8 sa_family_t

Definition at line 1499 of file tcpip.h.

◆ in_port_t

typedef u16 in_port_t

Definition at line 1504 of file tcpip.h.

◆ socklen_t

typedef int socklen_t

Definition at line 1552 of file tcpip.h.

◆ dns_found_callback

typedef void(* dns_found_callback) (const char *name, const ip_addr_t *ipaddr, void *callback_arg)

Callback which is invoked when a hostname is found. A function of this type must be implemented by the application using the DNS resolver.

Parameters
namepointer to the name that was looked up.
ipaddrpointer to an ip_addr_t containing the IP address of the hostname, or NULL if the name could not be found (or on any other error).
callback_arga user-specified callback argument passed to dns_gethostbyname

Definition at line 1863 of file tcpip.h.

Enumeration Type Documentation

◆ pbuf_layer

enum pbuf_layer

Enumeration of pbuf layers

Enumerator
PBUF_TRANSPORT 

Includes spare room for transport layer header, e.g. UDP header. Use this if you intend to pass the pbuf to functions like udp_send().

PBUF_IP 

Includes spare room for IP header. Use this if you intend to pass the pbuf to functions like raw_send().

PBUF_LINK 

Includes spare room for link layer header (ethernet header). Use this if you intend to pass the pbuf to functions like ethernet_output().

See also
PBUF_LINK_HLEN
PBUF_RAW_TX 

Includes spare room for additional encapsulation header before ethernet headers (e.g. 802.11). Use this if you intend to pass the pbuf to functions like netif->linkoutput().

See also
PBUF_LINK_ENCAPSULATION_HLEN
PBUF_RAW 

Use this for input packets in a netif driver when calling netif->input() in the most common case - ethernet-layer netif driver.

Definition at line 144 of file tcpip.h.

◆ pbuf_type

enum pbuf_type

Enumeration of pbuf types

Enumerator
PBUF_RAM 

pbuf data is stored in RAM, used for TX mostly, struct pbuf and its payload are allocated in one piece of contiguous memory (so the first payload byte can be calculated from struct pbuf). pbuf_alloc() allocates PBUF_RAM pbufs as unchained pbufs (although that might change in future versions). This should be used for all OUTGOING packets (TX).

PBUF_ROM 

pbuf data is stored in ROM, i.e. struct pbuf and its payload are located in totally different memory areas. Since it points to ROM, payload does not have to be copied when queued for transmission.

PBUF_REF 

pbuf comes from the pbuf pool. Much like PBUF_ROM but payload might change so it has to be duplicated when queued before transmitting, depending on who has a 'ref' to it.

PBUF_POOL 

pbuf payload refers to RAM. This one comes from a pool and should be used for RX. Payload can be chained (scatter-gather RX) but like PBUF_RAM, struct pbuf and its payload are allocated in one piece of contiguous memory (so the first payload byte can be calculated from struct pbuf). Don't use this for TX, if the pool becomes empty e.g. because of TCP queuing, you are unable to receive TCP acks!

Definition at line 173 of file tcpip.h.

◆ lwip_ip_addr_type

IP address types for use in ip_addr_t.type member.

See also
tcp_new_ip_type(), udp_new_ip_type(), raw_new_ip_type().
Enumerator
IPADDR_TYPE_V4 

IPv4

IPADDR_TYPE_V6 

IPv6

IPADDR_TYPE_ANY 

IPv4+IPv6 ("dual-stack")

Definition at line 642 of file tcpip.h.

◆ lwip_internal_netif_client_data_index

enum lwip_internal_netif_client_data_index

Definition at line 1115 of file tcpip.h.

◆ netif_mac_filter_action

MAC Filter Actions, these are passed to a netif's igmp_mac_filter or mld_mac_filter callback function.

Enumerator
NETIF_DEL_MAC_FILTER 

Delete a filter entry

NETIF_ADD_MAC_FILTER 

Add a filter entry

Definition at line 1150 of file tcpip.h.

◆ dhcp_state_enum_t

enum dhcp_state_enum_t

Definition at line 1454 of file tcpip.h.

Variable Documentation

◆ ip_addr_any

const ip_addr_t ip_addr_any
extern

Definition at line 58 of file ps2ipc.c.

◆ netif_list

struct netif* netif_list
extern

The list of network interfaces.

◆ netif_default

struct netif* netif_default
extern

The default network interface.