mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-09 17:13:49 +08:00
PPP, added PPP_USE_PBUF_RAM compile time option
pbuf_type PPP is using for LCP, PAP, CHAP, EAP, IPCP and IP6CP packets. Memory allocated must be single buffered for PPP to works, it requires pbuf that are not going to be chained when allocated. This requires setting PBUF_POOL_BUFSIZE to at least 512 bytes, which is quite huge for small systems. Setting PPP_USE_PBUF_RAM to 1 makes PPP use memory from heap where continuous buffers are required, allowing you to use a smaller PBUF_POOL_BUFSIZE.
This commit is contained in:
@@ -1707,6 +1707,20 @@
|
||||
#define LWIP_PPP_API 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* pbuf_type PPP is using for LCP, PAP, CHAP, EAP, IPCP and IP6CP packets.
|
||||
*
|
||||
* Memory allocated must be single buffered for PPP to works, it requires pbuf
|
||||
* that are not going to be chained when allocated. This requires setting
|
||||
* PBUF_POOL_BUFSIZE to at least 512 bytes, which is quite huge for small systems.
|
||||
*
|
||||
* Setting PPP_USE_PBUF_RAM to 1 makes PPP use memory from heap where continuous
|
||||
* buffers are required, allowing you to use a smaller PBUF_POOL_BUFSIZE.
|
||||
*/
|
||||
#ifndef PPP_USE_PBUF_RAM
|
||||
#define PPP_USE_PBUF_RAM 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* PPP_FCS_TABLE: Keep a 256*2 byte table to speed up FCS calculation
|
||||
*/
|
||||
|
||||
@@ -58,6 +58,20 @@ typedef unsigned char u_char;
|
||||
#include "ppp.h"
|
||||
#include "pppdebug.h"
|
||||
|
||||
/*
|
||||
* Memory used for control packets.
|
||||
*
|
||||
* PPP_CTRL_PBUF_MAX_SIZE is the amount of memory we allocate when we
|
||||
* cannot figure out how much we are going to use before filling the buffer.
|
||||
*/
|
||||
#if PPP_USE_PBUF_RAM
|
||||
#define PPP_CTRL_PBUF_TYPE PBUF_RAM
|
||||
#define PPP_CTRL_PBUF_MAX_SIZE 512
|
||||
#else /* PPP_USE_PBUF_RAM */
|
||||
#define PPP_CTRL_PBUF_TYPE PBUF_POOL
|
||||
#define PPP_CTRL_PBUF_MAX_SIZE PBUF_POOL_BUFSIZE
|
||||
#endif /* PPP_USE_PBUF_RAM */
|
||||
|
||||
/*
|
||||
* Limits.
|
||||
*/
|
||||
@@ -66,7 +80,6 @@ typedef unsigned char u_char;
|
||||
#define MAXNAMELEN 256 /* max length of hostname or name for auth */
|
||||
#define MAXSECRETLEN 256 /* max length of password or secret */
|
||||
|
||||
|
||||
/*
|
||||
* The basic PPP frame.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user