New code from lwip project

lwip repo:
7fe7e1e Merge branch 'ppp-new'
33b4287 Merge branch 'master' into ppp-new
d9e2edd Merge branch 'master' into ppp-new
a7745e9 PPP, PPPoE, fixed bug #42138, pppoe_destroy() called with wrong pointer, PPPoE control block was never freed
3fd7bc8 PPP, updated pppd followup
25e398a PPP, from PPPD upstream, accept IPCP ConfAck packets containing MS-WINS options
c31b033 PPP, from PPPD upstream, Don't crash if NULL pointer passed to vslprintf for %q or %v
f6d56e2 PPP, from PPPD upstream, take out unused %r conversion completely,
ca7769e Merge branch 'master' into ppp-new
c0aef7d PPP, VJ compression enabled, fixed IP forward from PPP to Ethernet by allocating a PBUF_LINK instead of a PBUF_RAW if IP forwarding is enabled
4283ecf PPP, PPPoS, fixed IP forward from PPP to Ethernet by allocating PBUF_LINK instead of PBUF_RAW if IP forwarding is enabled
08dd32d PPP, most PPP headers are using u_long, u_int, u_short and u_char types, moved typedef of those types before we include any PPP header
b495844 Merge branch 'master' into ppp-new
a38e5a4 Merge branch 'master' into ppp-new
58d0e8b Merge branch 'master' into ppp-new
75ef127 Merge branch 'master' into ppp-new
d7ba4bb Merge branch 'master' into ppp-new
406da49 Merge branch 'master' into ppp-new
9502cd7 Merge branch 'master' into ppp-new
03a3412 Merge branch 'master' into ppp-new
87cfd93 Merge branch 'master' into ppp-new
357b28f PPP, fixed VJ compression/decompression output IP path
bf37afd Merge branch 'master' into ppp-new
ee2ba4e Merge branch 'master' into ppp-new
4fda366 PPP, added PPP notify phase support
2ceae60 PPP, reduced by one buffer PPPoS RX requirements in multithreaded context
cf3162c PPP, moved PPP_INPROC_MULTITHREADED compile time option from ppp.h to opt.h
2350d94 PPP, added PPP_USE_PBUF_RAM compile time option
25f9f55 PPP, removed PPP_INPROC_OWNTHREAD feature, which almost only make things harder
07540f3 Merge branch 'master' into ppp-new
434daf8 Merge branch 'master' into ppp-new
f47a93b PPP, cleared compilation warning about unused variable 'pcb' in ppp_drop() if neither VJ nor SNMP support are enabled
3fe5a99 Merge branch 'master' into ppp-new
a1555e0 PPP, added ppp_free()
44b5274 PPP, slight API change, great code factorisation
ed294c5 PPP, removed ppposapi_input(), unnecessary because pppos_input() is already thread-safe
bd3ade3 PPP, added define for u_long, u_int, u_short, u_char for compilers or toolchains which don't have them
d03d2e6 PPP, added ppp_addrs() macro to get the pointer of the ppp->addrs struct
58ffa8d PPP, free input pbuf left in ppp_delete()
bfe8c15 PPP, fixed return code coherency for ppp_netif_output_*() callbacks (using ERR_* as expected by lwIP core instead of PPPERR_*)
2fa7e00 PPP, fixed LCP delayed up feature
ba94866 Merge branch 'master' into ppp-new
69b15c8 Merge branch 'master' into ppp-new
de13752 PPP, "try" variable used in LCP might conflict with some buggy C++ compiler
13ba881 PPP, fixed one more IAR warnings
bdfbac2 PPP, added missing semicolon (dammit)
6bd0bd2 Merge branch 'master' into ppp-new
211a889 PPP, fixed some IAR warnings
78d52ad Merge branch 'master' into ppp-new
6751ac4 PPP, moved FSM configuration to ppp_settings struct
6764957 PPP, moved EAP configuration to ppp_settings struct
c719ba7 PPP, moved PAP configuration to ppp_settings struct
31d7293 PPP, moved EAP timeouts and max requests default values to opt.h
defef22 PPP, improved PAP and CHAP timeout/request/maxrequests configuration values
63459f6 PPP, moved DEFLOOPBACKFAIL from ppp/lcp.h to lwip/opt.h
c68e1ce PPP, using timeouts values defined in opt.h instead of values defined in PPP headers or statically assigned values
07e72d2 PPP, correctly cast int to u8_t in PPPCTLS_ERRCODE in ppp_ioctl()
7f97e35 PPP, switched chap_digests linked list to a const table in .rodata/flash, saving about 100 bytes in .data segment if chap(md5) and mschap is enabled
e5a554f PPP, adding const pragma to FSM callbacks, saving about 350 bytes in .data segment
9e4aa79 PPP, adding const pragma to struct protent, saving about 200 bytes in .data segment
a029872 PPP, disable persist mode by default, so the default behavior does not look like a buggy behavior. Fixes bug #37279.
0eb83f6 PPP, IAR EWARM won't compile ppp-new due to keyword clash
e81f092 PPP, changed all the code enclosed between PPP_SERVER #if macro to our PPP PCB structure, making it easier to support PPP server in the future
7fb874a Merge branch 'master' into ppp-new
af56eeb PPP, cleaned MTU,MRU variables
387c778 PPP, added PPPoS reopen support
fbbde12 PPP, removed unnecessary ethif from ppp_pcb
dbaefd6 PPP, cleaned persist and holdoff features
a1c87f7 PPP, improved fsm_sconfreq() allocated buffer size
045ee53 PPP, using PBUF_POOL instead of PBUF_RAM pbufs for PPP negociation packets
b84ab71 PPP, ppp_input() code cleaning, removed dead code, fixed indentation
6144deb PPP, moved out PPPoS code into their own functions, improved ppp.c readability
19864a4 PPP L2TP, only skip HDLC header if necessary
7920b6e PPP, don't allocate twice struct eth_hdr per PPPoE pbuf
4928166 Merge branch 'master' into ppp-new
ad5f520 PPP, updated pppapi_reopen() to follow ppp_reopen() prototype change
4f8198b Added ChangeLog entry reporting all the work done in the ppp-new branch.
076f177 Added PPPd follow-up file, so that we can track what is happening on pppd.
3b93948 PPP, added missing entry in pppapi.h
773a276 PPP, added missing pppapi_delete() thread safe function
e9b2918 PPP, renamed all functions using common names in utils.c that can conflict with lwIP user code during link operation
0d02b8d added <stdlib.h> to ppp_impl.h, some PPP modules are using strtol()
98c0fcc Added <string.h> header to ppp_impl.h, this appears to be required, found out by Ivan Delamer.
1ddebcc Moved PPP headers into include/netif/ppp/, fixing bug #37040.
1adb900 Moved the include of lwip_md5.h or md5.h into the #if PPP_MD5_RANDM block, as suggested by Ivan Delamer
c5c1012 removed some compiler warnings in pppoe_disconnect()
519f817 Merge remote-tracking branch 'origin/master' into ppp-new
48d364e Merge remote-tracking branch 'origin/master' into ppp-new
c58c27e removed time-based PPP phase state machine hacks from PPPoE dans PPPoL2TP
59567b4 pcb->link_status_cb must be set, we don't need to check each time we use it if not NULL
e067e84 switch to phase dead if PPPoE or PPPoL2TP failed to connect
35c6705 fixed some more PPP phase state machine issues
8ec92b6 don't call ppp_hup() and ppp_stop() if PPPoE or PPPoL2TP failed to connect
5552f08 handle cases when ppp_close() is called while session is in dead or holdoff phase
3c12211 improved PPP API, added ppp_reopen()
a467d21 ppp_close() PPPoL2TP support added
bc724ea Do not destroy the PPP control block automatically anymore, added ppp_delete() API function.
4ea5c1d improved persist mode, we now clear everything we can in the PPP control block structure, ensuring we start a new session from a clean state
c65883a UCHAR_MAX is defined in limits.h, I do not want to add any system include, replaced to 0xff
a4f6146 removed some FIXME that are not relevant anymore
936c6c0 reduced call stack by one when receiving a PPPoE disc packet
91af887 saved some bytes from PPPoE control block, improved PADI retries
d2b2ae0 saving 14 bytes per PPPoE pbuf; not allocating struct eth_hdr two times per packet
94c3518 replaced PPPoL2TP printf() used to debug to PPPDEBUG a/o deletion
9e021cd improved PPP default interface management, added ppp_set_default() API call
7856502 L2TP output netif is now selectable, making it useful to select a default route for the L2TP tunnel, in case the default interface is set to the L2TP PPP interface
de6be74 added holdoff support for PPPoE and PPPoL2TP when persist mode is used
f534e80 added L2TPv2 (PPP over L2TP, a.k.a. UDP tunnels) support
0797ab6 some buggy compiler get confused with duplicated labels used in enum tcp_state and fsm.h, prepending PPP's ones
b4df26a some buggy compiler get confused with duplicated labels used in enum tcp_state and fsm.h, prepending PPP's ones
d92c462 added PPP Sequential API module, based from the Network Interface Sequential API module
f31b905 initialize PPP in the lwip_init() function
572e457 improved PPP API header documentation
be9b23a fixed LCP Echo Request/Reply feature
c9e7531 Merge branch 'master' into ppp-new
90faecd replaced u_int{8,16,32}_t to lwIP u{8,16,32}_t types
2e06942 removed bool type, replaced by u8_t
11a3057 PPP: Add option to skip FCS table
ba0c619 clarified PPP_INPROC_OWNTHREAD documentation
a83fb30 fixed PPPoS multithread support
dc09265 now displaying sent packet before PPPoS add its escaping, trailing flags, ...
25c6278 fixed some endianess issues with PPPoS
5033e0e display IPV6CP packets
295eeef "ISO C forbids conversion of function pointer to object pointer type" - removed callback function pointer display in debug messages. Anyway, this is quite a meaningless information.
f63b87e setting tot_len before using it, oops
1f780e8 PPP timeouts required depend on the number of allowed PPP sessions
408a56f phase must be set to initalize each time we try to reconnect
a84f5d5 added ppp_pcb to ppp callback
fb6eed0 set LL addresses before bringing the interface up for IPv6
dc242a0 don't build ppp_netif_output_ip6() if PPP IPV6 support is disabled
074d3dd moved ipv6cp global variables to ppp_pcb
807afbc improved FSM structure size
8f1eeb1 improved ipv6cp_options struct size
dd288f7 fixed sent PPPoE dump packet and copy everything we need after pppoe_xmit() free'd the pbuf
6a11134 fixed PPPoS suppport compilation
9b60b55 SNMP prefers tot_len
77aa06d improved ppp_write_over_ethernet(), don't MEMCPY the entire packet into a new pbuf
9b7860d merged ppp_write and ppp_write_pbuf
bda73b1 replaced call from ppp_write to ppp_write_pbuf
8576ee0 randomized seed when using MD5 random support and PPPoE
8093b55 don't destroy and create the PPP interface each time sifup() is called (it is actually called twice with IPv4 + IPv6 enabled)
b6db4a0 PPP IPv6 local link support added
cd7894d added compilation macro to eui64.[ch] and cleaned unix-dependant code
c36d73f added raw IPv6 PPP files
9871c4f improved IPCP control structure size
e330983 improved lcp_options structure size
4bbf443 improved CHAP structure size, however there is not much we can do
0234c62 improved PAP control structure size
0bdc271 some more improvements to ppp_pcb
c51c55b LCP and IPCP variable size improved
26250f1 removed pcb->chap_mdtype_all
7ecfe63 reduced MTU/MRU variables
b7be038 improved much more ppp_pcb entry size
b21cb8a removed pcb->num if PPP debug is not compiled
eadd56a replaced exit code (pcb->status) with ppp_ioctl()
2aa9a66 don't duplicate user and password anymore, anyway, the PPP user will have them already allocated as static strings or from configuration flash/file
8e9c07d more idle time limit macros
1d392f0 removed useless flags from ppp_settings
08cbc1b idle time limit and connect time limit are now compile time options
f744d7a reduced ppp_settings types size
ff2a737 ppp_settings.remote_name is now a compile time option
111a1ce moved ppp_settings.lax_recv and ppp_settings.noendpoint bool types (so char) to the ppp_settings bitfield
a44b56d pcb->nak_buffer replaced with a pbuf
1b586b6 do not allocated pbuf of more than pcb->peer_mru instead of PPP_MRU, to save some memory
4a7f2ff pcb->outpacket_buf replaced by pbuf everywhere it was used
503162e CHAP is now using pbuf instead of pcb->outpacket_buf
22fad86 PAP is now using pbuf instead of pcb->outpacket_buf
8641b8a PPP_PCB are now allocated using memp_alloc()
be2d3b5 moved back temporarily moved structure definitions from various headers to ppp.h during unit to ppp_pcb transition
3120487 cleanified old style C function declaration from utils.c
4404ef0 prevent conflict with existing (md4|md5|sha1|des) object file if polarssl is already used elsewhere in the project
0c68fc4 fixed pppoe_find_softc_by_session() when we have the same PPPoE session id on 2 ethif
ea7bf19 fixed most "unit 0" used instead of pcb pointer
99bf977 NUM_PPP is defined is opt.h, clearing from ppp_impl.h
0e2d5f9 removed unused inpacket_buf in ppp_pcb
3065b9f no more pcb->unit, new user selectable pcb->num for debugging purpose (like netif does)
cce5fbc fixed PPPoS xmit_accm ppp_pcb variable access
82a4d4e LCP global variables moved to ppp_pcb as well as input/output buffers
7081476 FSM global variables moved to ppp_pcb
93559a5 IPCP global variables moved to ppp_pcb
f10ddea removed fsm->unit
4a8ff6d protent prototype switched from unit to ppp_pcb
4b7e3af IPCP and LCP structures moved to ppp_pcb
19238a9 global variables removed from chap support
2deb13d EAP is now using ppp_pcb as well
1ece33e PAP and CHAP are now using ppp_pcb*
844f5e5 moved auth.c global variables to ppp_pcb
51bfac7 auth.c functions now use ppp_pcb* as first argument
81a0fd7 removed unit from ppp_ioctl()
3a30e5b removed ppp_input_header, replaced using 2 chained pbuf the only area we need it
a87096c fixed PPPoS support, improved ppp_input()
527d99f removed all PPP unit in ppp.c except pih->unit and unit used in debugging output
6e2722a started the unit to ppp_pcb replacement
8694dea don't add ppp_pcb_rx to ppp_pcb struct if PPPOS support is disabled
a226099 ppp_close() on PPPoE actually works,
336ba8f pppoe now have access to the ppp_pcb structure, removed "persist" option copy
5abdc99 no more PPP unit number in PPPoE, now using ppp_pcb
f7ef988 improved ppp_set_auth() mschap support
fed76f2 added missing EAP_SUPPORT macro
a3cfbfc ppp_set_auth() modified to handle new handled authtype (mschap + eap)
444646b renamed ppp_control to ppp_pcb, replaced unit number to ppp_pcb in all ppp.h declared functions
8bd508a moved ppp_settings to ppp_control, improved PPP API to really allow multiple PPP sessions
1cceb4e moved hide_password global variable to ppp_options
c2d2034 PPPoE persist is working, removing FIXME comments about that
f94ed92 moved exit status global variable to ppp_control
7a57d28 moved listen_time global variable to ppp_settings
ce5121e removed unused "unsuccess" global variable
a7d7158 removed useless error_count global variable from ppp.c
6b8c78b moved remote_name and explicit_remote global variable to ppp_settings
2da930b removed some useless extern
772cac7 removed useless error_count global variable
42f672d phase global variable moved to ppp_control structure
945f291 using PPP_DEBUG instead of debug global variable
1ccf516 options.c is now empty, removed
fb396b8 moved debug option from options.c to ppp.c
6db3026 using our_name from ppp_settings (only used in server mode and disabled by default)
becc306 using idle_time_limit from ppp_settings
4e7ce11 removed holdoff support, can be handled without persist mode outside lwIP
6589cf9 removed useless options
552589f removed multilink option when multilink support is not compiled
2ec79c0 unused ifunit global variable removed
21653f0 pr_log is unused, don't even try to build it
b922eaa print packet is working back, at least for PPPoE
d27da93 now using maxconnect from ppp_settings
2e6fa7f dns server support is done, clearing FIXME entries
3021849 removed malloc() from ms chap
e5355cc PPP server support is now optional (disabled by default, not working until PPP have a "listen" support)
2fe7785 fixed randm if random MD5 support is not enabled
4077422 fixed pbuf leaks in ppp_input() in case of packets not expected
a9ac45c added PPPoE persist support (don't timeout sending PADI packets)
7ef99ee added a persist option (enabled by default for now until we add a way for users to pass a ppp_settings structure)
e44aada improved PPPoE callback with state values, so that PPP know exactly what is happening on the PPPoE side
ac0a864 fixed typos s/parms/params/g
3c3331d fixed some debug strings
6f21f48 added MTU support (using MRU from the peer)
2e227f8 PPPoE is now guessing its MTU from the underlying netif MTU (in most cases 1500 minus 8 = 1492, which is the most common PPPoE MTU)
7d7513c re-enabled DNS support
d95f1e9 added missing initialisation in ppp_init.c
1013b49 disabled ppp_over_ethernet_close(), which is not exported and probably bogus, until we fix it
dc0e15a we should reduce nak_buffer[] size
d6e5ca7 setting default route by default
cd3ba00 get_mask now returns "255.255.255.255" by default, which is what we want in almost all cases on a PPP link
c549dba re-enabled LCP echo interval / echo fail
ca1ad99 PPPoE reauth bug fixed
2c7bd7e fixed print_string() prototype
bea45b3 cleared IDE warnings
093c7b4 cleaned depreacted __P() and __V() macros, removed the legacy varargs.h header
8332a5a disabled all plugins hooks
eb02065 disabled all plugins hooks
31456a6 removed CamelCase in ppp.c and ppp_impl.h, added compat macro in ppp.h (but disabled for now)
03fda0f removed CamelCase for all ppp.h declared functions
c09f03f VJ support is back!
3bad9ff ppp_impl.h is back!
0663421 re-added PPPoS code from the previous port, it builds, maybe it works
10175ca fixed MD5 Random enabling conditions
103ad75 automatically enable MD5 Random support if CHAP or EAP is enabled
2f5f86d don't build any PPP file if PPP support is disabled
89d2c29 more ppp.[ch] cleaning
05817aa LQR (Link Quality Report) support is now optional
5464ed6 removed all useless header files, merged ppp_defs.h to ppp.h
05c84a1 added ECP_SUPPORT in opt.h (disabled by default); renamed MD5_SUPPORT to PPP_MD5_RANDM, which is more meaningful
9c35403 clarified a bit more ppp.[ch]
b5b075e demystified a bit the PPP impl, renamed output() to ppp_output() to prevent conflict
e1261c9 removed all system headers except the strict minimum
5531bca make it build with avr32-gcc
28b9dd5 build PolarSSL MD5 if MD5_SUPPORT is enabled (for randm)
44c2a0a fixed most PPP compilation warnings with -pedantic
d143acf fixed all PPP compilation warnings with -Wall
b4d59fd removed headers that were initially copied but not used (yet)
2ee2a1b removed sys-linux.c
86ebc8e removed pppd.h and ppp.c, renamed pppmy.c to ppp.c and pppmy.h to ppp.h
29c5ee6 pppd.h disabled, renamed MAX() to LWIP_MAX()
323aebf cleaning unused stuff in pppd.h, syslog() is no more used
a5dd1cc ppp.c disabled, everything required for lwIP moved to our impl
4dd297c protent table moved to our PPP impl
7f9fea1 added pppmy.h in all .c files to easily find conflicts
adb8b88 resolve conflit, ipcp.c defines ip_ntoa() which is already defined by lwIP, disabled ipcp.c::ip_ntoa() and using lwIP one
d3d1b69 more ppp.c cleaning
922d371 PPP statistics optional (non working) compile time option added
4158222 moved new_phase() to our own implementation, re-enabled new_phase() support
6727c43 PPP notifier support is now a compile time option
55c1ec2 re-enabled auth notifiers
0f1c18e PPP interval timeout support disabled (using lwIP timeout support), protocol_name() moved to our PPP impl and disabled by default
0de1293 clarifying what is actually the "datainput" entry in protent
89ab390 added necessary pppSingleBuf() call before passing the packet to the appropriate PPP subsystem
88ef3ff POSIX signal support removed
668d5d9 removed set/getenv functions
6c908ac removed more protent fields only used by print packets functions
2c4bd71 print packet functions are now optional
cf18e07 removed demand prototypes if not compiled-in
8b866be demand support is now a compile-time option
ee5fca7 removed pathnames.h and pidfile support
fc07493 Linux ioctl() gone, ECP support optional, CCP support optional
a17ea13 autoselecting which PolarSSL files to use support added
8bb4ea8 removed some useless Linux calls
26e8372 changed PolarSSL compile-time condition
4704efa PAP support is now an optional compile-time feature
339925e CHAP support is now an optional compile-time feature
28360a7 MSCHAP is now an optional compile-time feature
49bb62d and less and less useless auth code (will this end ?)
04f121b less and less auth code
6ce5c8e disabled upap_rauthreq()
7736cda replaced BCOPY to lwip-MEMCPY
05aa1f1 using MEMCPY() instead of memcpy()
42827cd more and more ppp options removal
b88dad4 disabled almost all PPP options strings and support as well as useless file-based auth code
d064527 removed HMAC support from ciphers
dea27e1 cleaned PolarSSL files
0bfad43 Commit to prouve we copied the raw BSD PolarSSL files
4c1b507 fixed MS-CHAP and MS-CHAP-V2, MD4 polarssl uses bytes as input length, not bits
0289055 Revert "Revert "Added PolarSSL DES library, which is necessary for MSCHAP.""
83a48da Revert "Revert "Replaced md4/md5/sha1 implementations to PolarSSL ones""
a7a20a9 Revert "now using OpenBSD DES implementation"
82b67b0 Revert "removed salted DES ( known as crypt() function ), we don't need it"
b896203 Revert "Removed all stuff requiring encryption."
795d580 EAP support is now optional
7d43f4a removed useless system header from EAP
c268c5e Removed all stuff requiring encryption.
5176596 removed salted DES ( known as crypt() function ), we don't need it
a9672e1 now using OpenBSD DES implementation
4570f71 modified auth_reset() so that we can choose which auth we want
ca2fd86 Revert "Replaced md4/md5/sha1 implementations to PolarSSL ones"
624da03 Revert "modified auth_reset() so that we can choose which auth we want"
a820f32 Revert "Added PolarSSL DES library, which is necessary for MSCHAP."
f5dc6e8 Removed uneeded crypt() from auth.c and session.c
de70b71 Added PolarSSL DES library, which is necessary for MSCHAP.
bf10a27 modified auth_reset() so that we can choose which auth we want
aa2656c Replaced md4/md5/sha1 implementations to PolarSSL ones
adf2b2b don't compile wkmodulus[] if SRP is not used
6773326 replaced MIN to LWIP_MIN
1d7efce Removed TDB code, which we cannot port, because it needs a filesystem.
1a1deb5 reworked magic/randm
bcba806 ported randm module from previous PPP port
00648c2 world changed, removed IPX support
4885b39 removed run_program() support
0f3e70b removed user and passwd globals
372a0f9 moved refuse_mschap, refuse_mschap_v2, refuse_eap from globals to ppp_settings
2a44bad removed passwd_from_file usage, removed some of unused PAP file fetch code
33e8472 CHAP auth is now working
8834a8b using UNTIMEOUT macro instead of timeout()
db794c2 PPPoL2TP patch from Debian, not used yet, but already fixed
a1d80c2 fixed demand_rexmit() with new IP addr, maybe we will never support demand or drop it, but it is already patched just in case
bea796e pppd: Terminate correctly if lcp_lowerup delayed calling fsm_lowerup
d497821 using rp-pppoe pppd exits with EXIT_OK after receiving a timeout waiting for PADO due to no modem attached, from Debian patches
ef59e95 added IPCP no/replace default route option from Debian patches, I like the idea
54d5ee5 added LCP adaptive echo from Debian patches, I like the idea
eb75ae0 Early development stage of an attempt to port PPPd 2.4.5 to lwIP.