Microchip® Advanced Software Framework

ip.h File Reference
#include "lwip/opt.h"
#include "lwip/def.h"
#include "lwip/pbuf.h"
#include "lwip/ip_addr.h"
#include "lwip/err.h"
#include "lwip/netif.h"
#include "lwip/ip4.h"
#include "lwip/ip6.h"

Data Structures

struct  ip_globals
 
struct  ip_pcb
 

Macros

#define ip_current_dest_addr()   (&ip_data.current_iphdr_dest)
 Destination IP4 address of current_header. More...
 
#define ip_current_header()   (ip_data.current_ip4_header)
 Get the IP header of the current packet. More...
 
#define ip_current_header_proto()   IPH_PROTO(ip_current_header())
 Get the transport layer protocol. More...
 
#define ip_current_header_tot_len()   (ip_data.current_ip_header_tot_len)
 Total header length of ip(6)_current_header() (i.e. More...
 
#define ip_current_is_v6()   0
 Always returns FALSE when only supporting IPv4. More...
 
#define ip_current_netif()   (ip_data.current_netif)
 Get the interface that received the current packet. More...
 
#define ip_current_src_addr()   (&ip_data.current_iphdr_src)
 Source IP4 address of current_header. More...
 
#define ip_get_option(pcb, opt)   ((pcb)->so_options & (opt))
 Gets an IP pcb option (SOF_* flags) More...
 
#define IP_HDRINCL   NULL
 
#define IP_PCB
 
#define IP_PCB_ADDRHINT
 
#define IP_PCB_IPVER_EQ(pcb1, pcb2)   1
 
#define IP_PCB_IPVER_INPUT_MATCH(pcb)   1
 
#define IP_PCB_ISIPV6_MEMBER
 
#define ip_reset_option(pcb, opt)   ((pcb)->so_options &= ~(opt))
 Resets an IP pcb option (SOF_* flags) More...
 
#define ip_set_option(pcb, opt)   ((pcb)->so_options |= (opt))
 Sets an IP pcb option (SOF_* flags) More...
 
#define ipX_current_dest_addr()   (&ip_data.current_iphdr_dest)
 Destination IP address of current_header. More...
 
#define ipX_current_dest_addr()   (&ip_data.current_iphdr_dest)
 Destination IP address of current_header. More...
 
#define ipX_current_src_addr()   (&ip_data.current_iphdr_src)
 Source IP address of current_header. More...
 
#define ipX_current_src_addr()   (&ip_data.current_iphdr_src)
 Source IP address of current_header. More...
 
#define ipX_debug_print(is_ipv6, p)   ip_debug_print(p)
 
#define ipX_netif_get_local_ipX(isipv6, netif, dest)   ip_netif_get_local_ipX(netif)
 
#define ipX_next_header_ptr()   ((void*)((u8_t*)ip_current_header() + ip_current_header_tot_len()))
 Get the transport layer header. More...
 
#define ipX_output(isipv6, p, src, dest, ttl, tos, proto)   ip_output(p, src, dest, ttl, tos, proto)
 
#define ipX_output_hinted(isipv6, p, src, dest, ttl, tos, proto, addr_hint)   ip_output_hinted(p, src, dest, ttl, tos, proto, addr_hint)
 
#define ipX_output_if(isipv6, p, src, dest, ttl, tos, proto, netif)   ip_output_if(p, src, dest, ttl, tos, proto, netif)
 
#define ipX_output_if_src(isipv6, p, src, dest, ttl, tos, proto, netif)   ip_output_if_src(p, src, dest, ttl, tos, proto, netif)
 
#define ipX_route(isipv6, src, dest)   ip_route(ipX_2_ip(dest))
 
#define ipX_route_get_local_ipX(isipv6, src, dest, netif, ipXaddr)
 
#define LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX(p)   LWIP_ASSERT("p->ref == 1", (p)->ref == 1)
 pbufs passed to IP must have a ref-count of 1 as their payload pointer gets altered as the packet is passed down the stack More...
 
#define PCB_ISIPV6(pcb)   0
 
#define SOF_BROADCAST   0x20U /* permit to send and to receive broadcast messages (see IP_SOF_BROADCAST option) */
 
#define SOF_INHERITED   (SOF_REUSEADDR|SOF_KEEPALIVE)
 
#define SOF_KEEPALIVE   0x08U /* keep connections alive */
 
#define SOF_REUSEADDR   0x04U /* allow local address reuse */
 

Variables

struct ip_globals ip_data
 Global data for both IPv4 and IPv6. More...
 

#define ip_current_dest_addr ( )    (&ip_data.current_iphdr_dest)

Destination IP4 address of current_header.

Referenced by ip_input().

#define ip_current_header ( )    (ip_data.current_ip4_header)

Get the IP header of the current packet.

This function must only be called from a receive callback (udp_recv, raw_recv, tcp_accept). It will return NULL otherwise.

#define ip_current_header_proto ( )    IPH_PROTO(ip_current_header())

Get the transport layer protocol.

#define ip_current_header_tot_len ( )    (ip_data.current_ip_header_tot_len)

Total header length of ip(6)_current_header() (i.e.

after this, the UDP/TCP header starts)

#define ip_current_is_v6 ( )    0

Always returns FALSE when only supporting IPv4.

#define ip_current_netif ( )    (ip_data.current_netif)

Get the interface that received the current packet.

This function must only be called from a receive callback (udp_recv, raw_recv, tcp_accept). It will return NULL otherwise.

#define ip_current_src_addr ( )    (&ip_data.current_iphdr_src)

Source IP4 address of current_header.

Referenced by ip_input().

#define ip_get_option (   pcb,
  opt 
)    ((pcb)->so_options & (opt))

Gets an IP pcb option (SOF_* flags)

#define IP_HDRINCL   NULL
#define IP_PCB
Value:
/* ip addresses in network byte order */ \
ipX_addr_t remote_ip; \
/* Socket options */ \
u8_t so_options; \
/* Type Of Service */ \
u8_t tos; \
/* Time To Live */ \
u8_t ttl \
/* link layer address resolution hint */ \
uint32_t local_ip
Definition: application.c:75
uint8_t u8_t
Definition: sam/include/arch/cc.h:44
ip_addr_t ipX_addr_t
Definition: ip_addr.h:108
#define IP_PCB_ISIPV6_MEMBER
Definition: ip.h:77
#define IP_PCB_ADDRHINT
Definition: ip.h:66
#define IP_PCB_ADDRHINT
#define IP_PCB_IPVER_EQ (   pcb1,
  pcb2 
)    1
#define IP_PCB_IPVER_INPUT_MATCH (   pcb)    1
#define IP_PCB_ISIPV6_MEMBER
#define ip_reset_option (   pcb,
  opt 
)    ((pcb)->so_options &= ~(opt))

Resets an IP pcb option (SOF_* flags)

#define ip_set_option (   pcb,
  opt 
)    ((pcb)->so_options |= (opt))

Sets an IP pcb option (SOF_* flags)

#define ipX_current_dest_addr ( )    (&ip_data.current_iphdr_dest)

Destination IP address of current_header.

Union destination address of current_header.

#define ipX_current_dest_addr ( )    (&ip_data.current_iphdr_dest)

Destination IP address of current_header.

Union destination address of current_header.

#define ipX_current_src_addr ( )    (&ip_data.current_iphdr_src)

Source IP address of current_header.

Union source address of current_header.

#define ipX_current_src_addr ( )    (&ip_data.current_iphdr_src)

Source IP address of current_header.

Union source address of current_header.

#define ipX_debug_print (   is_ipv6,
 
)    ip_debug_print(p)
#define ipX_netif_get_local_ipX (   isipv6,
  netif,
  dest 
)    ip_netif_get_local_ipX(netif)
#define ipX_next_header_ptr ( )    ((void*)((u8_t*)ip_current_header() + ip_current_header_tot_len()))

Get the transport layer header.

#define ipX_output (   isipv6,
  p,
  src,
  dest,
  ttl,
  tos,
  proto 
)    ip_output(p, src, dest, ttl, tos, proto)
#define ipX_output_hinted (   isipv6,
  p,
  src,
  dest,
  ttl,
  tos,
  proto,
  addr_hint 
)    ip_output_hinted(p, src, dest, ttl, tos, proto, addr_hint)
#define ipX_output_if (   isipv6,
  p,
  src,
  dest,
  ttl,
  tos,
  proto,
  netif 
)    ip_output_if(p, src, dest, ttl, tos, proto, netif)
#define ipX_output_if_src (   isipv6,
  p,
  src,
  dest,
  ttl,
  tos,
  proto,
  netif 
)    ip_output_if_src(p, src, dest, ttl, tos, proto, netif)
#define ipX_route (   isipv6,
  src,
  dest 
)    ip_route(ipX_2_ip(dest))
#define ipX_route_get_local_ipX (   isipv6,
  src,
  dest,
  netif,
  ipXaddr 
)
Value:
do { \
(netif) = ipX_route(isipv6, src, dest); \
(ipXaddr) = ipX_netif_get_local_ipX(isipv6, netif, dest); \
}while(0)
#define ipX_netif_get_local_ipX(isipv6, netif, dest)
Definition: ip.h:243
Generic data structure used for all lwIP network interfaces.
Definition: src/include/lwip/netif.h:136
#define ipX_route(isipv6, src, dest)
Definition: ip.h:241
#define LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX (   p)    LWIP_ASSERT("p->ref == 1", (p)->ref == 1)

pbufs passed to IP must have a ref-count of 1 as their payload pointer gets altered as the packet is passed down the stack

Referenced by ip_output().

#define PCB_ISIPV6 (   pcb)    0
#define SOF_BROADCAST   0x20U /* permit to send and to receive broadcast messages (see IP_SOF_BROADCAST option) */
#define SOF_INHERITED   (SOF_REUSEADDR|SOF_KEEPALIVE)
#define SOF_KEEPALIVE   0x08U /* keep connections alive */
#define SOF_REUSEADDR   0x04U /* allow local address reuse */

struct ip_globals ip_data

Global data for both IPv4 and IPv6.

Referenced by ip_input().