Microchip® Advanced Software Framework

ip_frag.h File Reference
#include "lwip/opt.h"
#include "lwip/err.h"
#include "lwip/pbuf.h"
#include "lwip/netif.h"
#include "lwip/ip_addr.h"
#include "lwip/ip.h"

Data Structures

struct  ip_reassdata
 

Macros

#define IP_TMR_INTERVAL   1000
 

Functions

err_t ip_frag (struct pbuf *p, struct netif *netif, ip_addr_t *dest)
 Fragment an IP datagram if too large for the netif. More...
 
struct pbufip_reass (struct pbuf *p)
 Reassembles incoming IP fragments into an IP datagram. More...
 
void ip_reass_init (void)
 
void ip_reass_tmr (void)
 Reassembly timer base function for both NO_SYS == 0 and 1 (!). More...
 

#define IP_TMR_INTERVAL   1000

err_t ip_frag ( struct pbuf p,
struct netif netif,
ip_addr_t dest 
)

Fragment an IP datagram if too large for the netif.

Chop the datagram in MTU sized chunks and send them in order by using a fixed size static memory buffer (PBUF_REF) or point PBUF_REFs into p (depending on IP_FRAG_USES_STATIC_BUF).

Parameters
pip packet to send
netifthe netif on which to send
destdestination ip address to which to send
Returns
ERR_OK if sent successfully, err_t otherwise

References ERR_MEM, ERR_OK, htons, if(), inet_chksum(), ip_frag(), IP_HLEN, IP_MF, IP_OFFMASK, IP_REASS_DEBUG, IPFRAG_STATS_INC, IPH_CHKSUM_SET, IPH_LEN_SET, IPH_OFFSET, IPH_OFFSET_SET, iphdr, pbuf::len, LWIP_ASSERT, LWIP_DEBUGF, LWIP_MEM_ALIGN, netif::mtu, pbuf::next, ntohs, NULL, netif::output, pbuf::payload, pbuf_alloc(), pbuf_cat(), pbuf_chain(), pbuf_copy_partial(), pbuf_free(), pbuf_header(), PBUF_IP, PBUF_LINK, PBUF_RAM, PBUF_RAW, pbuf_realloc(), PBUF_REF, pbuf_ref(), snmp_inc_ipfragcreates, snmp_inc_ipfragoks, and pbuf::tot_len.

Referenced by ip_frag(), ip_reass(), and ip_reass_enqueue_new_datagram().

void ip_reass_init ( void  )
void ip_reass_tmr ( void  )

Reassembly timer base function for both NO_SYS == 0 and 1 (!).

Should be called every 1000 msec (defined by IP_TMR_INTERVAL).

References IP_REASS_DEBUG, ip_reass_free_complete_datagram(), LWIP_DEBUGF, ip_reassdata::next, NULL, reassdatagrams, ip_reassdata::timer, and U16_F.

Referenced by ip_reass_timer().