#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 |
struct | pbuf_custom_ref |
Macros | |
#define | IP_TMR_INTERVAL 1000 |
#define | LWIP_PBUF_CUSTOM_REF_DEFINED |
A custom pbuf that holds a reference to another pbuf, which is freed when this custom pbuf is freed. More... | |
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 pbuf * | ip_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 |
Referenced by ip_reass_timer(), and sys_timeouts_init().
#define LWIP_PBUF_CUSTOM_REF_DEFINED |
A custom pbuf that holds a reference to another pbuf, which is freed when this custom pbuf is freed.
This is used to create a custom PBUF_REF that points into the original pbuf.
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).
p | ip packet to send |
netif | the netif on which to send |
dest | destination ip address to which to send |
References pbuf_custom::custom_free_function, ERR_MEM, ERR_OK, htons, if(), inet_chksum(), ip_frag(), ip_frag_alloc_pbuf_custom_ref(), ip_frag_free_pbuf_custom_ref(), IP_HLEN, IP_MF, IP_OFFMASK, IP_REASS_DEBUG, ipfrag_free_pbuf_custom(), IPFRAG_STATS_INC, IPH_CHKSUM_SET, IPH_LEN_SET, IPH_OFFSET, IPH_OFFSET_SET, pbuf::len, LWIP_ASSERT, LWIP_DEBUGF, LWIP_MEM_ALIGN, netif::mtu, pbuf::next, ntohs, NULL, pbuf_custom_ref::original, netif::output, pbuf::payload, pbuf_alloc(), pbuf_alloced_custom(), 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(), pbuf_custom_ref::pc, snmp_inc_ipfragcreates, snmp_inc_ipfragoks, and pbuf::tot_len.
Referenced by ip_frag(), ip_reass(), and ip_reass_enqueue_new_datagram().
Reassembles incoming IP fragments into an IP datagram.
p | points to a pbuf chain of the fragment |
References ip_reassdata::datagram_len, ip_reassdata::flags, htons, if(), inet_chksum(), IP_ADDRESSES_AND_ID_MATCH, ip_frag(), IP_HLEN, IP_MF, IP_OFFMASK, ip_reass_chain_frag_into_datagram_and_validate(), IP_REASS_DEBUG, ip_reass_dequeue_datagram(), ip_reass_enqueue_new_datagram(), IP_REASS_FLAG_LASTFRAG, ip_reass_pbufcount, ip_reass_remove_oldest_datagram(), IPFRAG_STATS_INC, IPH_CHKSUM_SET, IPH_HL, IPH_ID, IPH_LEN, IPH_LEN_SET, IPH_OFFSET, IPH_OFFSET_SET, ip_reassdata::iphdr, LWIP_DEBUGF, ip_reassdata::next, ntohs, NULL, ip_reassdata::p, pbuf::payload, pbuf_cat(), pbuf_clen(), pbuf_free(), pbuf_header(), PP_NTOHS, S16_F, snmp_inc_ipreasmreqds, and X16_F.
Referenced by ip_input().
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().