uc-sdk
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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"

Go to the source code of this file.

Classes

struct  ip_hdr
 

Macros

#define IP_HLEN   40
 
#define IP_PROTO_ICMP   58
 
#define IP_PROTO_UDP   17
 
#define IP_PROTO_UDPLITE   136
 
#define IP_PROTO_TCP   6
 
#define IP_HDRINCL   NULL
 
#define IP_PCB_ADDRHINT
 
#define IP_PCB
 
#define IPH_PROTO(hdr)   (iphdr->nexthdr)
 
#define ip_current_netif()   NULL
 
#define ip_current_header()   NULL
 

Functions

void ip_init (void)
 
struct netifip_route (struct ip_addr *dest)
 
void ip_input (struct pbuf *p, struct netif *inp)
 
err_t ip_output (struct pbuf *p, struct ip_addr *src, struct ip_addr *dest, u8_t ttl, u8_t proto)
 
err_t ip_output_if (struct pbuf *p, struct ip_addr *src, struct ip_addr *dest, u8_t ttl, u8_t proto, struct netif *netif)
 

Macro Definition Documentation

#define ip_current_header ( )    NULL

Definition at line 118 of file ip.h.

#define ip_current_netif ( )    NULL

Definition at line 117 of file ip.h.

#define IP_HDRINCL   NULL

Definition at line 59 of file ip.h.

#define IP_HLEN   40

Definition at line 46 of file ip.h.

#define IP_PCB
Value:
struct ip_addr local_ip; \
struct ip_addr remote_ip; \
/* Socket options */ \
u16_t so_options; \
/* Type Of Service */ \
u8_t tos; \
/* Time To Live */ \
u8_t ttl; \
/* link layer address resolution hint */ \
IP_PCB_ADDRHINT

Definition at line 71 of file ip.h.

#define IP_PCB_ADDRHINT

Definition at line 64 of file ip.h.

#define IP_PROTO_ICMP   58

Definition at line 48 of file ip.h.

#define IP_PROTO_TCP   6

Definition at line 51 of file ip.h.

#define IP_PROTO_UDP   17

Definition at line 49 of file ip.h.

#define IP_PROTO_UDPLITE   136

Definition at line 50 of file ip.h.

#define IPH_PROTO (   hdr)    (iphdr->nexthdr)

Definition at line 99 of file ip.h.

Function Documentation

void ip_init ( void  )

Definition at line 63 of file ip6.c.

void ip_input ( struct pbuf p,
struct netif inp 
)

This function is called by the network interface device driver when an IP packet is received. The function does the basic checks of the IP header such as packet size being at least larger than the header size etc. If the packet was not destined for us, the packet is forwarded (using ip_forward). The IP checksum is always checked.

Finally, the packet is sent to the upper layer protocol input function.

Parameters
pthe received IP packet (p->payload points to IP header)
inpthe netif on which this packet was received
Returns
ERR_OK if the packet was processed (could return ERR_* if it wasn't processed, but currently always returns ERR_OK)

Definition at line 242 of file ip.c.

err_t ip_output ( struct pbuf p,
struct ip_addr src,
struct ip_addr dest,
u8_t  ttl,
u8_t  proto 
)

Definition at line 317 of file ip6.c.

err_t ip_output_if ( struct pbuf p,
struct ip_addr src,
struct ip_addr dest,
u8_t  ttl,
u8_t  proto,
struct netif netif 
)

Definition at line 260 of file ip6.c.

struct netif* ip_route ( struct ip_addr dest)

Definition at line 75 of file ip6.c.