lwIP 2.2.1
Lightweight IP stack
Loading...
Searching...
No Matches
ip6_frag.c File Reference
#include "lwip/opt.h"
#include "lwip/ip6_frag.h"
#include "lwip/ip6.h"
#include "lwip/icmp6.h"
#include "lwip/nd6.h"
#include "lwip/ip.h"
#include "lwip/pbuf.h"
#include "lwip/memp.h"
#include "lwip/stats.h"
#include <string.h>
#include "arch/bpstruct.h"
#include "arch/epstruct.h"

Data Structures

struct  ip6_reass_helper

Macros

#define IP_REASS_CHECK_OVERLAP   1
#define IP_REASS_FREE_OLDEST   1

Functions

struct pbufip6_reass (struct pbuf *p)
err_t ip6_frag (struct pbuf *p, struct netif *netif, const ip6_addr_t *dest)

Detailed Description

IPv6 fragmentation and reassembly.

Macro Definition Documentation

◆ IP_REASS_CHECK_OVERLAP

#define IP_REASS_CHECK_OVERLAP   1

Setting this to 0, you can turn off checking the fragments for overlapping regions. The code gets a little smaller. Only use this if you know that overlapping won't occur on your network!

◆ IP_REASS_FREE_OLDEST

#define IP_REASS_FREE_OLDEST   1

Set to 0 to prevent freeing the oldest datagram when the reassembly buffer is full (IP_REASS_MAX_PBUFS pbufs are enqueued). The code gets a little smaller. Datagrams will be freed by timeout only. Especially useful when MEMP_NUM_REASSDATA is set to 1, so one datagram can be reassembled at a time, only.

Function Documentation

◆ ip6_frag()

err_t ip6_frag ( struct pbuf * p,
struct netif * netif,
const ip6_addr_t * dest )

Fragment an IPv6 datagram if too large for the netif or path MTU.

Chop the datagram in MTU sized chunks and send them in order by pointing PBUF_REFs into p

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

◆ ip6_reass()

struct pbuf * ip6_reass ( struct pbuf * p)

Reassembles incoming IPv6 fragments into an IPv6 datagram.

Parameters
ppoints to the IPv6 Fragment Header
Returns
NULL if reassembly is incomplete, pbuf pointing to IPv6 Header if reassembly is complete