Commit Graph

1030 Commits

Author SHA1 Message Date
Sylvain Rochet
50ecd2c12c PPP, CORE, removed useless st variable in ppp_close()
Code cleaning.
2015-02-17 23:22:15 +01:00
Sylvain Rochet
07f9212799 PPP, chained returns up to ppp_open()
ppp_open() now returns lower level protocol return value if something failed.
2015-02-17 23:22:15 +01:00
Sylvain Rochet
8a8cba75a2 PPP, lower protocols, chained returns from local functions to callback caller
PPPoS,PPPoE,PPPoL2TP functions using non-void returns are now propagated
to callback caller (PPP core).
2015-02-17 23:22:15 +01:00
Sylvain Rochet
1ae3808e13 PPP, CORE, prepared for lower protocols callbacks returning state
Until now, callbacks used void return, preparing callbacks to return
PPPERR_ status.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
ee2936ffbf PPP, all protocols, uniformised naming
Uniformised fonction naming between and inside PPPoS, PPPoE, PPPoL2TP.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
5b29f1cdec PPP, CORE, Fixed warning with PPP_PROTOCOLNAME enabled
lwip/src/netif/ppp/ppp.c: In function ‘ppp_input’:
lwip/src/netif/ppp/ppp.c:769:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
     const char *pname = protocol_name(protocol);
     ^
2015-02-17 23:22:14 +01:00
Sylvain Rochet
bce29ac353 PPP, CORE, code cleaning
Reordered functions in the order they are declared in headers.
Removed useless ppp_link_down() function.
Merged ppp_stop() and ppp_close().
Merged ppp_hup() and ppp_sighup().
2015-02-17 23:22:14 +01:00
Sylvain Rochet
f7584fa883 PPP, CORE, fixed callbacks return value
Fixed return value in case of abnormal termination.
Set pcb->err_code in case of failed setup link.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
18074ff98f PPP, PPPoE, improved removal from linked list
Replaced naive link list removal code to a more clever one.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
69469496e2 PPP, PPPoS, moved out_accm from PPP core to PPPoS
Last PPPoS variable in PPP core moved to PPPoS.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
baaa2592a6 PPP, PPPoS, removed xmit_accm, almost duplicate of out_accm
xmit_accm was meant to be a user configurable asyncmap, it was actually
broken since the introduction of ppp_new by the way we now reset the PPP
initial state, looks like no one until now is needing it anymore. If
necessary we will reintroduce this feature later properly instead of a
dirty and ugly hack into the PPP code.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
ecb8aa6fc1 PPP, PPPoS, merged ppp(os)_pcb_rx to pppos_pcb
Merged ppp(os)_pcb_rx to pppos_pcb, saved 8 bytes of pointers
and unecessary init steps.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
34210901bf PPP, PPPoS, moved ppp.rx to pppos.rx
PPP rx control block moved to PPPoS
2015-02-17 23:22:14 +01:00
Sylvain Rochet
7132893863 PPP, PPPoS, re-enabled PPPCTLG_FD
Found a fine way to get PPP fd without making this call crash for for PPPoE
or PPPoL2TP.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
cfe04d4453 PPP, PPPoS, using PPPoS PCB pointer on VJ and pppos_ configuration functions
Slightly more consistent this way, and prevent using link_ctx_cb pointer
from PPPoS protocol file.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
f98f2890f3 PPP, PPPoS, check if PPPoS configuration functions are used on PPPoS
We don't have callbacks which can be set or cleared for PPPoS
configuration, there is too much callbacks to create and PPPoS must be
kept light, therefore PPPoS functions can be called when PPP core
configure a PPPoE or PPPoL2TP interface, this is very unlikely to
happens because protocols not supported by PPPoE or PPPoL2TP are
disabled at LCP/IPCP negotiation but being safe is still better.

Check if passed PPP pointer to PPPoS configuration functions is a PPPoS
interface by using a linked list of exiting PPPoS interfaces.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
d93c21349f PPP, PPPoS, fixed build with PPP_FCS_TABLE=1
Oops, I managed to break builds with PPP_FCS_TABLE=1, fixed.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
9358dbbd99 PPP, PPPoS, various static and const added
ppp_get_fcs() is now static, const modifier added on ppp_accm_mask
2015-02-17 23:22:13 +01:00
Sylvain Rochet
2b9d304816 PPP, PPPoS, renamed *sc pointer to *pppos, renamed *pcb pointers to *pppos and *ppp
It was a bit confusing and error prone having *pcb pointers for both
ppp_pcb* and pppos_pcb*, fixed confusion with a strict naming for both.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
e6465a6f44 PPP, PPPoS, moved VJ from PPP core to PPPoS
VJ is only available for PPPoS, moved VJ from PPP CORE to PPPoS.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
4aa9244b92 PPP, PPPoS moved fd from ppp_pcb to pppos_pcb
Moved fd from ppp_pcb to pppos_pcb.

However PPP ioctl PPPCTLG_FD is temporarily disabled until I found a
better solution.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
1ac4d1b793 PPP, PPPoS needs vj.h 2015-02-17 23:22:13 +01:00
Sylvain Rochet
ea205f2fcd PPP, add PPPoS CB for PPPoS private data
Created a new PPPoS CB going to have PPPoS private data, so allocating a
PPPoE or a PPPoL2TP interface does not allocate as well PPPoS variables.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
9c15ffbb74 PPP: Moved PPPoS from ppp.c to pppos.c
Started removing from PPP core most of low level protocol PPPoS
handling to separate files, using the new low level PPP callbacks.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
09b4485870 PPP, generalized callbacks calls from PPP core, removed all PPPoE and PPPoL2TP references
Almost there, removed all PPPoE and PPPoL2TP references from PPP core,
using the generic callbacks interface everywhere.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
19282d6d6c PPP, moved low level protocol connect init to low level protocol files
Low level protocol init machine state does not belong to PPP core,
moved those init to respective low level protocol files.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
ee85aaccd2 PPP, removed low level create functions from PPP core
ppp_over_ethernet_create() moved from ppp.c to pppoe.c
ppp_over_l2tp_create() moved from ppp.c to pppol2tp.c
2015-02-17 23:22:13 +01:00
Sylvain Rochet
0afc34f6fc PPP, moved ppp_write and ppp_netif_output low level protocols functions to respective low level protocol files
Moved ppp_write_over_ethernet() and ppp_netif_output_over_ethernet() to pppoe.c
Moved ppp_write_over_l2tp() and ppp_netif_output_over_l2tp() to pppol2tp.c
2015-02-17 23:22:13 +01:00
Sylvain Rochet
45bfccfddc PPP, prepare new callbacks for low level protocols
New callbacks: write and netif_output
2015-02-17 23:22:13 +01:00
Sylvain Rochet
f8501478f6 PPP: prepared callbacks from PPP core to low level protocols
New PPP callback from PPP core to low level protocols, first
step about removing named calls to low level protocols from PPP core.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
b4fe72c4a2 PPP: removed duplicated code in ppp_close()
Looks like previous refactoring and cleaning made ppp_close()
consistent for all our low level protocol backends, cleaned
up duplicated code.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
808098413c PPP: removed PPPoE and PPPoL2TP callback status notifier
Added necessary PPP core functions for PPPoE and PPPoL2TP status
notificaton (ppp_link_failed and ppp_link_end), removed callback,
low level protocol are now calling PPP core "link" functions.
2015-02-17 23:22:12 +01:00
Sylvain Rochet
74fd2dc9ad PPP: moved ppp_new() to low level protocol init for PPPoE and PPPoL2TP
First step of a rework of how low level protocols are using the
PPP core. Low level protocols are now going to use the core instead
of core using the low level protocols.

Final goal: separate PPP core code from low level protocols.
2015-02-17 23:22:12 +01:00
Sylvain Rochet
443b2551c7 PPP: moved duplicated init code from ppp_over_X_create() to ppp_new()
Some init code were duplicated for all low-level PPP protocols, moved
uselessly duplicated code to ppp_new().
2015-02-17 23:22:12 +01:00
Sylvain Rochet
7b681bc94a PPP: re-order functions in the common sense API order
Re-order ppp.[ch] functions in the order functions should be called from
user application. Moved create functions, which actually return a PPP
control block before functions needing a PPP control block.
2015-02-17 23:22:12 +01:00
Sylvain Rochet
bd29f7168c PPP: ppp_init() is not a public function, moving it in private part
ppp_init() is not a public fonction anymore, move this function
in ppp.c "private" functions.
2015-02-17 23:22:12 +01:00
Sylvain Rochet
c8c0dc2f53 PPP: using a macro for ppp_set_default() instead of a function
This function is only calling netif_set_default(), a macro
is adequate.
2015-02-17 23:22:12 +01:00
Sylvain Rochet
17c6be6a9b PPP: removed ppp_delete(), merged with ppp_free()
The only benefit of ppp_delete() call was about having a persistent
netif interface. netif was moved out of PPP pcb so we don't need
ppp_delete() anymore, second step in simplifying the weird
new/open/free/delete PPP API.
2015-02-17 23:22:12 +01:00
Sylvain Rochet
318e752fd6 PPP: removed ppp_new(), merged with ppp_over_X_create()
The only benefit of ppp_new() call was about having a persistent netif
interface. netif was moved out of PPP pcb so we don't need ppp_new()
anymore, first step in simplifying the weird new/open/free/delete PPP
API.
2015-02-17 23:22:12 +01:00
Sylvain Rochet
3dcfd7ba41 PPP: moved netif out of PPP control block
Users might want to share a netif control block between an Ethernet
interface and a PPPoS interface (I want actually) in case PPP is just
used as redundancy if Ethernet is down (eg. PPPoS GPRS fail over).

Moved netif out of PPP control block in a similar way it is currently
done for Ethernet interfaces. Furthermore, this is a first step on
removing the "new/create/free/delete" API which is awful but currently
necessary to handle fail over from PPPoX to another PPPoX (eg. from PPoE
on xDSL to PPPoS on GPRS fail over) without free()ing the netif which
might be used on udp_sendto() or L2TP VPN links.
2015-02-17 23:22:12 +01:00
sg
6ef7563f53 Added the option PBUF_LINK_ENCAPSULATION_HLEN to allocate additional header space for TX on netifs requiring additional headers 2015-02-13 21:42:04 +01:00
Sylvain Rochet
5dd6b1effc PPP, updated pppd followup 2014-12-24 23:23:36 +01:00
Sylvain Rochet
369e9fbf08 PPP, from PPPD upstream, Eliminate some unnecessary ifdefs 2014-12-24 23:12:30 +01:00
Sylvain Rochet
e39d012312 PPP, from PPPD upstream, separate IPv6 handling for sifup/sifdown
The current code is buggy regarding handling of link state when using
both IPCP and IPv6CP: if IPv6CP has been set up and if during IPCP
negociation, ipcp_up() fails, it will incorrectly take the interface
down. The simple solution here is to change the platform code to do the
same as on Solaris: separate IPv6CP up/down state handling with sif6up()
and sif6down(), so that we really know when the interface is allowed to
go down.

(Based from pppd commit b04d2dc6df5c6b5650fea44250d58757ee3dac4a)
2014-12-24 23:01:06 +01:00
Sylvain Rochet
7d077a2260 PPP,SLIP include lwip/sio.h after lwip/sys.h to prevent functions prototype collision
User port may redefine sio_* functions, we must ensure we are loading
user functions prototypes before loading default prototypes.
2014-12-24 21:23:54 +01:00
Sylvain Rochet
61f0231ce0 PPP, fixed more compiler warnings
Using -Wall -pedantic -Wparentheses -Wsequence-point
-Wswitch-default -Wextra -Wundef -Wshadow -Wpointer-arith
-Wbad-function-cast -Wc++-compat -Wwrite-strings -Wold-style-definition
-Wmissing-prototypes -Wredundant-decls -Wnested-externs -Wno-address
2014-12-24 18:14:10 +01:00
Sylvain Rochet
482a18e6de PPP, added const modifier on auth strings 2014-12-24 17:17:00 +01:00
Sylvain Rochet
2b3e020152 PPP, fixed some compiler warnings
Using -Wall -pedantic -Wparentheses -Wsequence-point
-Wswitch-default -Wextra -Wundef -Wshadow -Wpointer-arith
-Wbad-function-cast -Wc++-compat -Wwrite-strings -Wold-style-definition
-Wmissing-prototypes -Wredundant-decls -Wnested-externs -Wno-address
2014-12-24 15:16:03 +01:00
goldsimon
01391f0234 etharp: fixed casting 'ctime' from u16_t to u8_t in local variables (introduced when fixing bug #34682) 2014-12-22 11:21:18 +01:00
chrysn
36f470383b use u32_t instead of u_int32_t
The style u_int32_t is not used anywhere else in the project, and is not
supported by the C standard, now using lwIP u32_t type. It was introduced
in 25e398a.
2014-11-11 16:28:27 +01:00
Sylvain Rochet
52dc9ef418 slightly improved compiler warning fixes 2014-11-07 16:26:15 +01:00
goldsimon
ec93b03d8d Fixed multiple smaller compiler warnings 2014-11-07 14:29:53 +01:00
Sylvain Rochet
60f920df0e fixed bug #43235, checking for non-existent preprocessor macros is non-standard, added predefinition for all affected macros 2014-10-12 20:51:58 +02:00
Sylvain Rochet
da19974e81 fixed bug #43235, cleared compiler warnings when using gcc with -Wextra option 2014-10-12 19:54:43 +02:00
Simon Goldschmidt
ab9feb2e35 fixed bug #43173, pppos_input() corrupts memory if IP_FORWARD is enabled 2014-10-12 18:23:10 +02:00
Simon Goldschmidt
82d7c78b0c Reverted typo fix for vj.c which is in the original sources: no need to add a diff only because of a typo... 2014-09-18 21:25:19 +02:00
Simon Goldschmidt
33237419c1 Parts of patch #8397 Typos corrected in comments and text outputs 2014-09-18 21:15:13 +02:00
Sylvain Rochet
a7745e9a86 PPP, PPPoE, fixed bug #42138, pppoe_destroy() called with wrong pointer, PPPoE control block was never freed 2014-04-19 23:38:24 +02:00
Sylvain Rochet
3fd7bc8058 PPP, updated pppd followup 2014-04-15 22:57:59 +02:00
Sylvain Rochet
25e398a8f0 PPP, from PPPD upstream, accept IPCP ConfAck packets containing MS-WINS options
pppd: Accept IPCP ConfAck packets containing MS-WINS options

Since last week I'm seeing IPCP negotiations going like this (and
eventually failing) when connecting to my ISP:

Jul 11 20:03:25 * pppd[4833]: sent [IPCP ConfReq id=0x2 <addr 0.0.0.0> <ms-dns1
0.0.0.0> <ms-dns2 0.0.0.0>]
Jul 11 20:03:26 * pppd[4833]: sent [IPCP ConfReq id=0x2 <addr 0.0.0.0> <ms-dns1
0.0.0.0> <ms-dns2 0.0.0.0>]
Jul 11 20:03:26 * pppd[4833]: rcvd [IPCP ConfNak id=0x2 <addr 10.167.246.198>
<ms-dns1 213.162.69.1> <ms-dns2 213.162.69.169> <ms-wins 124.6.168.55> <ms-wins
17.17.17.17>]
Jul 11 20:03:26 * pppd[4833]: sent [IPCP ConfReq id=0x3 <addr 10.167.246.198>
<ms-dns1 213.162.69.1> <ms-dns2 213.162.69.169> <ms-wins 124.6.168.55> <ms-wins
17.17.17.17>]
Jul 11 20:03:26 * pppd[4833]: rcvd [IPCP ConfAck id=0x3 <addr 10.167.246.198>
<ms-dns1 213.162.69.1> <ms-dns2 213.162.69.169> <ms-wins 124.6.168.55> <ms-wins
17.17.17.17>]
Jul 11 20:03:27 * pppd[4833]: sent [IPCP ConfReq id=0x3 <addr 10.167.246.198>
<ms-dns1 213.162.69.1> <ms-dns2 213.162.69.169> <ms-wins 124.6.168.55> <ms-wins
17.17.17.17>]
...

with the last two lines repeating until the IPCP error limit is
reached. As you can see, the peer added two extra fields in the
ConfNak reply. This is allowed, and indeed the following sent
ConfReq packet reflects this. However, when the ConfAck packet
is received, pppd discards it as invalid, because of the ms-wins
fields.

This fixes it.
2014-04-15 22:55:28 +02:00
Sylvain Rochet
c31b03327f PPP, from PPPD upstream, Don't crash if NULL pointer passed to vslprintf for %q or %v
pppd: Don't crash if NULL pointer passed to vslprintf for %q or %v

This is to avoid crashes like that reported in
https://bugs.launchpad.net/ubuntu/+source/ppp/+bug/1244714
2014-04-15 22:50:53 +02:00
Sylvain Rochet
f6d56e2937 PPP, from PPPD upstream, take out unused %r conversion completely,
pppd: Take out unused %r conversion completely

This just removes some code surrounded by #if 0/#endif, which Fedora
apparently feels the need to patch...
2014-04-15 22:34:24 +02:00
Sylvain Rochet
c0aef7dd6b 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 2014-04-12 01:23:57 +02:00
Sylvain Rochet
4283ecf774 PPP, PPPoS, fixed IP forward from PPP to Ethernet by allocating PBUF_LINK instead of PBUF_RAW if IP forwarding is enabled 2014-04-11 22:31:01 +02:00
Sylvain Rochet
b49584457a Merge branch 'master' into ppp-new 2014-03-23 13:17:55 +01:00
goldsimon
40d25adb88 Added LWIP_HOOK_ETHARP_GET_GW to implement IPv4 routing with multiple gateways 2014-03-17 12:53:31 +01:00
Sylvain Rochet
a38e5a44ec Merge branch 'master' into ppp-new 2014-03-14 20:48:12 +01:00
Simon Goldschmidt
8558fa0bcf etharp_entry::ctime must be u16_t after changing ARP_TMR_INTERVAL from 5 seconds to 1 second when fixing bug #34682 2014-02-26 21:51:56 +01:00
Sylvain Rochet
58d0e8b28f Merge branch 'master' into ppp-new 2014-02-24 20:21:47 +01:00
Simon Goldschmidt
07fbe82305 fixed bug #34681 Limit ARP queue length by ARP_QUEUE_LEN (=3) 2014-02-22 21:38:56 +01:00
Simon Goldschmidt
05a967564a fixed bug #34682 Limit ARP request flood for unresolved entry 2014-02-22 21:23:06 +01:00
Sylvain Rochet
d7ba4bbb9b Merge branch 'master' into ppp-new 2014-02-21 00:39:29 +01:00
Simon Goldschmidt
6dcc85dcf4 patch #7993: Added support for transmitting packets with VLAN headers via hook function LWIP_HOOK_VLAN_SET and to check them via hook function LWIP_HOOK_VLAN_CHECK 2014-02-20 21:08:50 +01:00
Sylvain Rochet
357b28f675 PPP, fixed VJ compression/decompression output IP path 2014-01-14 18:20:18 +01:00
Sylvain Rochet
4fda366b67 PPP, added PPP notify phase support
PPP notify phase support, using compile-time PPP_NOTIFY_PHASE macro.

This can be used for example to set a LED pattern depending on the
current phase of the PPP session.

Callback example:

static void ppp_notify_phase_cb(ppp_pcb *pcb, u8_t phase, void *ctx) {
  switch(phase) {
      case PPP_PHASE_DEAD:  /* Kept off */
      case PPP_PHASE_MASTER:
        /* LED Off */
        break;
      case PPP_PHASE_INITIALIZE:  /* Session opened */
        /* LED FastBlink */
        break;
      case PPP_PHASE_RUNNING:  /* Session running */
        /* LED On */
        break;
      default:
        /* LED SlowBlink */
   }
}
2013-04-30 15:16:09 +02:00
Sylvain Rochet
2ceae6014e PPP, reduced by one buffer PPPoS RX requirements in multithreaded context
Removed one unecessary allocated PBUF per PPPoS RX packet if PPP_INPROC_MULTITHREADED is set by adding the necessary data for
pppos_input_callback() in front of the first pbuf instead of allocating a new buffer.
2013-04-26 23:24:08 +02:00
Sylvain Rochet
2350d941a5 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.
2013-04-26 21:51:15 +02:00
Sylvain Rochet
25f9f55878 PPP, removed PPP_INPROC_OWNTHREAD feature, which almost only make things harder
I consider to remove the PPP_INPROC_OWNTHREAD crap in ppp-new,
as said in bugs #37278 and #37353.

1. It requires the ppp_input_thread() function to be modified to match
user system, like some did by adding the vTaskDelete(NULL); FreeRTOS
call at the end of the function, for example.

This is a tiny-tiny fonction that should be, in my opinion, on the user
port, like the Ethernet input thread we see in many Ethernet port.

2. It is actually not that thread safe.

2.1. pcb->phase IS modified by the lwIP core thread so it should at
least be set to volatile, otherwise the pcb->phase copy may live
indefinitely in CPU register. It works because of the sio_read()
function call which without doubt flush pcb->phase copy from CPU
register. I dont want to set ppp_pcb struct to volatile for obvious
performance reasons.

2.2. This function assume PCB still exists whatever is happening, which
is not the case after you called ppp_delete() function outside of this
thread. If sio_read() is blocking waiting data and pcb destroyed, it is
going to read a deallocated pcb which luckily should still have
pcb->phase set to 0 (=PHASE_DEAD) due to preallocated "control block"
structures of lwIP. Even with sio_read_abort(), there might be timings
issue due to a lack of a synchronization mechanism.

3. I dislike the sys_msleep(1), it means that systems should have at
least a 11 chr buffer at 115200/10 byte/s, and bigger with higher serial
speed, for example with 3G/HSDPA modems accessed through SPI, at 20
Mbits/s this is a ~2000 bytes buffer required to keep incoming data
during this sleep, I don't see why we require systems to do so,
sio_read() should obviously be a blocking call. I cannot easily
remove this sleep because some systems might have wrongfully used this
call as a CPU idle feature with a non blocking sio_read() call.
2013-04-26 20:30:01 +02:00
Sylvain Rochet
f47a93b0c1 PPP, cleared compilation warning about unused variable 'pcb' in ppp_drop() if neither VJ nor SNMP support are enabled 2013-04-26 14:02:30 +02:00
Sylvain Rochet
a1555e0615 PPP, added ppp_free()
Free the control block, clean everything except the PPP PCB itself
and the netif, it allows you to change the underlying PPP protocol
(eg. from PPPoE to PPPoS to switch from DSL to GPRS) without losing
your PPP and netif handlers.
2013-04-23 00:19:07 +02:00
Sylvain Rochet
44b527415f PPP, slight API change, great code factorisation
Created new ppp_over_X_create() functions which only prepare the PPP session without starting it
Removed ppp_reopen() and all of its sub ppp_over_X_reopen()
Removed PPPoL2TP reconnect() function, merged to connect()
Added ppp_open() able to start or restart any session
2013-04-22 23:58:51 +02:00
Sylvain Rochet
58ffa8d526 PPP, free input pbuf left in ppp_delete() 2013-02-27 22:29:22 +01:00
Sylvain Rochet
bfe8c15a29 PPP, fixed return code coherency for ppp_netif_output_*() callbacks (using ERR_* as expected by lwIP core instead of PPPERR_*) 2013-02-22 11:52:44 +01:00
Sylvain Rochet
2fa7e003b1 PPP, fixed LCP delayed up feature
LCP is stealing a bit from fsm->flags struct member for LCP delayed up feature.
Bit stealed used to be the 9th bit (0x100) but fsm->flags was reduced to u8_t to save memory,
we are now stealing the 8th bit (0x80).
2013-01-31 15:36:30 +01:00
Sylvain Rochet
de1375201f PPP, "try" variable used in LCP might conflict with some buggy C++ compiler 2013-01-04 23:08:11 +01:00
Sylvain Rochet
13ba8810c7 PPP, fixed one more IAR warnings 2013-01-04 22:51:13 +01:00
Sylvain Rochet
bdfbac2aa6 PPP, added missing semicolon (dammit) 2012-12-23 22:58:52 +01:00
Sylvain Rochet
211a889528 PPP, fixed some IAR warnings
these are the compiler warnings I get with the head of ppp-new. All
of them are trivial, [...] (I'm using IAR EWARM 6.4).

ppp.c
Warning[Pe550]: variable "c" was set but never used
lwip\src\netif\ppp\ppp.c 1012

Warning[Pe111]: statement is unreachable
lwip\src\netif\ppp\ppp.c 1132

Warning[Pe111]: statement is unreachable
lwip\src\netif\ppp\ppp.c 1377

Warning[Pe111]: statement is unreachable
lwip\src\netif\ppp\ppp.c 1412

utils.c
Warning[Pe186]: pointless comparison of unsigned integer with zero
lwip\src\netif\ppp\utils.c 210
2012-12-23 22:52:58 +01:00
Sylvain Rochet
6751ac4970 PPP, moved FSM configuration to ppp_settings struct 2012-12-09 22:25:28 +01:00
Sylvain Rochet
6764957d06 PPP, moved EAP configuration to ppp_settings struct 2012-12-09 21:45:14 +01:00
Sylvain Rochet
c719ba7bf3 PPP, moved PAP configuration to ppp_settings struct 2012-12-09 21:22:19 +01:00
Sylvain Rochet
defef2222a PPP, improved PAP and CHAP timeout/request/maxrequests configuration values 2012-12-09 20:24:22 +01:00
Sylvain Rochet
63459f65fb PPP, moved DEFLOOPBACKFAIL from ppp/lcp.h to lwip/opt.h 2012-12-09 19:28:53 +01:00
Sylvain Rochet
c68e1ceb64 PPP, using timeouts values defined in opt.h instead of values defined in PPP headers or statically assigned values 2012-12-09 18:42:06 +01:00
Sylvain Rochet
07e72d2ac8 PPP, correctly cast int to u8_t in PPPCTLS_ERRCODE in ppp_ioctl() 2012-11-08 14:39:30 +01:00
Sylvain Rochet
7f97e354b4 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 2012-10-14 02:04:36 +02:00
Sylvain Rochet
e5a554f0b5 PPP, adding const pragma to FSM callbacks, saving about 350 bytes in .data segment 2012-10-13 18:54:25 +02:00
Sylvain Rochet
9e4aa79278 PPP, adding const pragma to struct protent, saving about 200 bytes in .data segment 2012-10-13 18:38:18 +02:00
Sylvain Rochet
a0298728df PPP, disable persist mode by default, so the default behavior does not look like a buggy behavior. Fixes bug #37279. 2012-10-12 20:32:05 +02:00
Mark Lakata
0eb83f6ee6 PPP, IAR EWARM won't compile ppp-new due to keyword clash
The word "class" is reserved in IAR's EWARM compiler since it looks like c++.
This causes a failure to compile in the lcp code.

Arguably it is a bug in the compiler, but it is easy to work around with a
name change in the lcp.[ch] code. I fixed it by changing "class" to "class_".
2012-10-12 20:17:40 +02:00
Sylvain Rochet
e81f092520 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 2012-09-27 23:53:20 +02:00
Sylvain Rochet
af56eebc6a PPP, cleaned MTU,MRU variables 2012-09-01 19:44:43 +02:00
Sylvain Rochet
387c778496 PPP, added PPPoS reopen support 2012-09-01 19:29:17 +02:00
Sylvain Rochet
fbbde125d9 PPP, removed unnecessary ethif from ppp_pcb 2012-09-01 15:05:21 +02:00
Sylvain Rochet
dbaefd6126 PPP, cleaned persist and holdoff features 2012-09-01 14:43:31 +02:00
Sylvain Rochet
a1c87f7c49 PPP, improved fsm_sconfreq() allocated buffer size 2012-08-27 19:10:09 +02:00
Sylvain Rochet
045ee53468 PPP, using PBUF_POOL instead of PBUF_RAM pbufs for PPP negociation packets
PPP stack does not handle chained pbuf, but PPP negociation packets
are at most ~40 bytes long, so we are only checking if the payload
can fit into the allocated pbuf (p->tot_len == p->len).
2012-08-27 00:47:21 +02:00
Sylvain Rochet
b84ab718b0 PPP, ppp_input() code cleaning, removed dead code, fixed indentation 2012-08-25 20:38:54 +02:00
Sylvain Rochet
6144deb6b6 PPP, moved out PPPoS code into their own functions, improved ppp.c readability 2012-08-25 20:30:14 +02:00
Sylvain Rochet
19864a4a08 PPP L2TP, only skip HDLC header if necessary
RFC 2661 does not specify whether the PPP frame in the L2TP payload should
have a HDLC header or not. We handle both cases for compatibility.
2012-08-25 18:15:15 +02:00
Sylvain Rochet
7920b6e163 PPP, don't allocate twice struct eth_hdr per PPPoE pbuf 2012-08-25 16:21:58 +02:00
Sylvain Rochet
076f177100 Added PPPd follow-up file, so that we can track what is happening on pppd.
The lwIP PPP support is based from pppd 2.4.5 (http://ppp.samba.org) with
huge changes to match code size and memory requirements for embedded devices.

Anyway, pppd has a mature codebase for years and the average commit count
is getting low on their Git repositories, meaning that we can follow what
is happening on their side and merge what is relevant for lwIP.

So, here is the pppd follow up, so that we don't get away too far from pppd.
2012-08-22 17:40:23 +02:00
Sylvain Rochet
e9b29184d0 PPP, renamed all functions using common names in utils.c that can conflict with lwIP user code during link operation 2012-08-21 20:21:38 +02:00
Sylvain Rochet
1ddebcc862 Moved PPP headers into include/netif/ppp/, fixing bug #37040. 2012-08-18 22:40:19 +02:00
Sylvain Rochet
1adb900561 Moved the include of lwip_md5.h or md5.h into the #if PPP_MD5_RANDM block, as suggested by Ivan Delamer 2012-08-18 12:56:59 +02:00
Sylvain Rochet
c5c1012ddd removed some compiler warnings in pppoe_disconnect() 2012-08-17 23:42:14 +02:00
Sylvain Rochet
c58c27ed8b removed time-based PPP phase state machine hacks from PPPoE dans PPPoL2TP
Our PPP phase state machine is now clean, we can safely remove time based
hacks in PPPoE dans PPPoL2TP.
2012-07-24 22:50:17 +02:00
Sylvain Rochet
59567b43b0 pcb->link_status_cb must be set, we don't need to check each time we use it if not NULL 2012-07-23 00:55:24 +02:00
Sylvain Rochet
e067e84d69 switch to phase dead if PPPoE or PPPoL2TP failed to connect 2012-07-23 00:48:27 +02:00
Sylvain Rochet
35c670513f fixed some more PPP phase state machine issues
The only way PPPoE or PPPoL2TP disconnect it through ppp_link_terminated(),
therefore PPP is always already down, so we don't need to ask PPP to hup or stop.
2012-07-22 23:53:27 +02:00
Sylvain Rochet
8ec92b6fe7 don't call ppp_hup() and ppp_stop() if PPPoE or PPPoL2TP failed to connect
This is useless because PPP is not started yet, it confuses the PPP phase
state machine.
2012-07-22 23:37:35 +02:00
Sylvain Rochet
5552f082e8 handle cases when ppp_close() is called while session is in dead or holdoff phase 2012-07-22 21:42:56 +02:00
Sylvain Rochet
3c122117fc improved PPP API, added ppp_reopen()
This is now the user choice to re-establish the session in the link status callback
by either calling the ppp_reopen() to re-establish or ppp_delete() to free the PPP
control block. Without user intervention, the PPP control block now stay in the dead
phase, allowing the user to re-establish or delete the control block later.
2012-07-22 20:53:54 +02:00
Sylvain Rochet
a467d21eba ppp_close() PPPoL2TP support added 2012-07-22 18:05:19 +02:00
Sylvain Rochet
bc724ea206 Do not destroy the PPP control block automatically anymore, added ppp_delete() API function.
Without that, PPP user don't know when and how the PPP control block is free()ed, which
can lead to hard fault.
2012-07-22 17:20:40 +02:00
Sylvain Rochet
4ea5c1d973 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 2012-07-21 00:26:23 +02:00
Sylvain Rochet
c65883a727 UCHAR_MAX is defined in limits.h, I do not want to add any system include, replaced to 0xff 2012-07-16 20:09:49 +02:00
Sylvain Rochet
a4f6146667 removed some FIXME that are not relevant anymore 2012-07-15 15:57:54 +02:00
Sylvain Rochet
936c6c0d5c reduced call stack by one when receiving a PPPoE disc packet 2012-07-15 15:12:40 +02:00
Sylvain Rochet
91af8878e1 saved some bytes from PPPoE control block, improved PADI retries 2012-07-15 15:07:07 +02:00
Sylvain Rochet
d2b2ae09e6 saving 14 bytes per PPPoE pbuf; not allocating struct eth_hdr two times per packet 2012-07-15 14:56:30 +02:00
Sylvain Rochet
94c35184a9 replaced PPPoL2TP printf() used to debug to PPPDEBUG a/o deletion 2012-07-14 17:47:30 +02:00
Sylvain Rochet
9e021cd1a8 improved PPP default interface management, added ppp_set_default() API call 2012-07-14 17:25:24 +02:00
Sylvain Rochet
78565026ac 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 2012-07-12 01:11:08 +02:00
Sylvain Rochet
de6be743c6 added holdoff support for PPPoE and PPPoL2TP when persist mode is used 2012-07-11 23:50:33 +02:00
Sylvain Rochet
f534e80c71 added L2TPv2 (PPP over L2TP, a.k.a. UDP tunnels) support
Supported:
 - L2TPv2 (PPP over L2TP, a.k.a. UDP tunnels)
 - LAC

 Not supported:
 - LNS (require PPP server support)
 - L2TPv3 ethernet pseudowires
 - L2TPv3 VLAN pseudowire
 - L2TPv3 PPP pseudowires
 - L2TPv3 IP encapsulation
 - L2TPv3 IP pseudowire
 - L2TP tunnel switching - http://tools.ietf.org/html/draft-ietf-l2tpext-tunnel-switching-08
 - Multiple tunnels per UDP socket, as well as multiple sessions per tunnel
 - Hidden AVPs
2012-07-09 23:25:32 +02:00
Sylvain Rochet
0797ab6bc6 some buggy compiler get confused with duplicated labels used in enum tcp_state and fsm.h, prepending PPP's ones 2012-07-09 22:12:14 +02:00
Sylvain Rochet
b4df26a75d some buggy compiler get confused with duplicated labels used in enum tcp_state and fsm.h, prepending PPP's ones 2012-07-09 22:04:09 +02:00
Sylvain Rochet
d92c462466 added PPP Sequential API module, based from the Network Interface Sequential API module 2012-07-07 19:50:56 +02:00
Sylvain Rochet
572e457e77 improved PPP API header documentation 2012-07-07 15:05:15 +02:00
Sylvain Rochet
be9b23a082 fixed LCP Echo Request/Reply feature 2012-07-07 12:16:48 +02:00
Sylvain Rochet
90faecd86e replaced u_int{8,16,32}_t to lwIP u{8,16,32}_t types
added padding to compiler generated bitfield, this is seen as best practice,
maybe it helps buggy compilers
2012-07-03 22:59:50 +02:00
Sylvain Rochet
2e069429c2 removed bool type, replaced by u8_t 2012-07-03 22:03:51 +02:00
Erik Ekman
11a3057e8e PPP: Add option to skip FCS table
Option PPP_FCS_TABLE is created which controls if PPPoS FCS calculation
should be done against precalculated table or by using a short algorithm.

Default value is 1, keeps old behaviour.
Setting it to 0 saves around 0.5 kB flash.
2012-06-23 15:11:49 +02:00
Sylvain Rochet
ba0c619844 clarified PPP_INPROC_OWNTHREAD documentation 2012-06-23 13:46:51 +02:00
Sylvain Rochet
a83fb30836 fixed PPPoS multithread support 2012-06-23 13:07:43 +02:00
Sylvain Rochet
dc092653f4 now displaying sent packet before PPPoS add its escaping, trailing flags, ... 2012-06-23 12:04:27 +02:00
Sylvain Rochet
25c6278000 fixed some endianess issues with PPPoS 2012-06-23 02:27:03 +02:00
Sylvain Rochet
5033e0e752 display IPV6CP packets 2012-06-23 01:44:52 +02:00
Sylvain Rochet
295eeef9b6 "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. 2012-06-22 21:48:21 +02:00
Sylvain Rochet
f63b87e28b setting tot_len before using it, oops 2012-06-22 21:43:22 +02:00
Sylvain Rochet
408a56ffaf phase must be set to initalize each time we try to reconnect 2012-06-22 20:48:08 +02:00
Sylvain Rochet
a84f5d52ff added ppp_pcb to ppp callback 2012-06-22 19:59:46 +02:00
Sylvain Rochet
fb6eed0087 set LL addresses before bringing the interface up for IPv6 2012-06-22 19:45:45 +02:00
Sylvain Rochet
dc242a01b4 don't build ppp_netif_output_ip6() if PPP IPV6 support is disabled 2012-06-22 19:29:55 +02:00
Sylvain Rochet
074d3dd2b1 moved ipv6cp global variables to ppp_pcb 2012-06-22 19:27:03 +02:00
Sylvain Rochet
807afbc879 improved FSM structure size 2012-06-22 18:50:09 +02:00
Sylvain Rochet
8f1eeb1025 improved ipv6cp_options struct size 2012-06-22 18:23:07 +02:00
Sylvain Rochet
dd288f70ec fixed sent PPPoE dump packet and copy everything we need after pppoe_xmit() free'd the pbuf 2012-06-22 18:07:59 +02:00
Sylvain Rochet
6a11134a18 fixed PPPoS suppport compilation 2012-06-22 17:53:39 +02:00
Sylvain Rochet
9b60b55f03 SNMP prefers tot_len 2012-06-22 17:48:31 +02:00
Sylvain Rochet
77aa06df64 improved ppp_write_over_ethernet(), don't MEMCPY the entire packet into a new pbuf 2012-06-22 17:03:59 +02:00
Sylvain Rochet
9b7860d6ec merged ppp_write and ppp_write_pbuf 2012-06-22 14:17:35 +02:00
Sylvain Rochet
bda73b1bc9 replaced call from ppp_write to ppp_write_pbuf 2012-06-21 23:31:23 +02:00
Sylvain Rochet
8576ee0981 randomized seed when using MD5 random support and PPPoE 2012-06-21 23:08:20 +02:00
Sylvain Rochet
8093b55e86 don't destroy and create the PPP interface each time sifup() is called (it is actually called twice with IPv4 + IPv6 enabled) 2012-06-21 22:28:52 +02:00
Sylvain Rochet
b6db4a0e2e PPP IPv6 local link support added 2012-06-21 18:05:17 +02:00
Sylvain Rochet
cd7894dfc9 added compilation macro to eui64.[ch] and cleaned unix-dependant code 2012-06-20 13:39:08 +02:00
Sylvain Rochet
c36d73f42a added raw IPv6 PPP files 2012-06-20 13:29:21 +02:00
Sylvain Rochet
9871c4ff06 improved IPCP control structure size 2012-06-20 00:10:08 +02:00
Sylvain Rochet
e330983408 improved lcp_options structure size 2012-06-20 00:03:08 +02:00
Sylvain Rochet
4bbf443ba2 improved CHAP structure size, however there is not much we can do 2012-06-19 23:42:41 +02:00
Sylvain Rochet
0234c62c3e improved PAP control structure size 2012-06-19 23:37:33 +02:00
Sylvain Rochet
0bdc27186d some more improvements to ppp_pcb 2012-06-19 23:31:20 +02:00
Sylvain Rochet
c51c55b782 LCP and IPCP variable size improved 2012-06-19 23:25:57 +02:00
Sylvain Rochet
26250f1953 removed pcb->chap_mdtype_all 2012-06-19 23:14:31 +02:00
Sylvain Rochet
7ecfe6304a reduced MTU/MRU variables 2012-06-19 23:03:47 +02:00
Sylvain Rochet
b7be03801c improved much more ppp_pcb entry size 2012-06-19 22:53:38 +02:00
Sylvain Rochet
b21cb8a396 removed pcb->num if PPP debug is not compiled 2012-06-19 22:08:14 +02:00
Sylvain Rochet
eadd56a376 replaced exit code (pcb->status) with ppp_ioctl() 2012-06-19 22:00:12 +02:00
Sylvain Rochet
2aa9a66c57 don't duplicate user and password anymore, anyway, the PPP user will have them already allocated as static strings or from configuration flash/file 2012-06-19 21:26:52 +02:00
Sylvain Rochet
8e9c07df39 more idle time limit macros 2012-06-19 18:02:23 +02:00
Sylvain Rochet
1d392f0e76 removed useless flags from ppp_settings 2012-06-19 17:54:29 +02:00
Sylvain Rochet
08cbc1b22b idle time limit and connect time limit are now compile time options 2012-06-19 17:50:02 +02:00
Sylvain Rochet
f744d7a789 reduced ppp_settings types size 2012-06-19 17:42:13 +02:00
Sylvain Rochet
ff2a737094 ppp_settings.remote_name is now a compile time option 2012-06-19 17:38:02 +02:00
Sylvain Rochet
111a1cef52 moved ppp_settings.lax_recv and ppp_settings.noendpoint bool types (so char) to the ppp_settings bitfield 2012-06-19 17:07:02 +02:00
Sylvain Rochet
a44b56dc61 pcb->nak_buffer replaced with a pbuf 2012-06-19 15:36:53 +02:00
Sylvain Rochet
1b586b69bc do not allocated pbuf of more than pcb->peer_mru instead of PPP_MRU, to save some memory 2012-06-18 15:07:48 +02:00
Sylvain Rochet
4a7f2ffc5e pcb->outpacket_buf replaced by pbuf everywhere it was used 2012-06-18 02:21:18 +02:00
Sylvain Rochet
503162ec54 CHAP is now using pbuf instead of pcb->outpacket_buf 2012-06-18 01:18:24 +02:00
Sylvain Rochet
22fad86453 PAP is now using pbuf instead of pcb->outpacket_buf 2012-06-18 01:10:21 +02:00
Sylvain Rochet
8641b8a36e PPP_PCB are now allocated using memp_alloc() 2012-06-17 23:48:55 +02:00
Sylvain Rochet
be2d3b5886 moved back temporarily moved structure definitions from various headers to ppp.h during unit to ppp_pcb transition 2012-06-17 02:33:47 +02:00
Sylvain Rochet
3120487243 cleanified old style C function declaration from utils.c 2012-06-17 01:47:45 +02:00
Sylvain Rochet
4404ef0281 prevent conflict with existing (md4|md5|sha1|des) object file if polarssl is already used elsewhere in the project 2012-06-17 00:55:11 +02:00
Sylvain Rochet
0c68fc409e fixed pppoe_find_softc_by_session() when we have the same PPPoE session id on 2 ethif 2012-06-17 00:33:02 +02:00
Sylvain Rochet
ea7bf19057 fixed most "unit 0" used instead of pcb pointer 2012-06-17 00:17:22 +02:00
Sylvain Rochet
99bf9775d9 NUM_PPP is defined is opt.h, clearing from ppp_impl.h 2012-06-16 18:45:53 +02:00
Sylvain Rochet
0e2d5f9d0e removed unused inpacket_buf in ppp_pcb 2012-06-16 14:53:13 +02:00
Sylvain Rochet
3065b9f968 no more pcb->unit, new user selectable pcb->num for debugging purpose (like netif does) 2012-06-16 04:12:10 +02:00
Sylvain Rochet
cce5fbc7b1 fixed PPPoS xmit_accm ppp_pcb variable access 2012-06-16 03:58:48 +02:00
Sylvain Rochet
82a4d4ec65 LCP global variables moved to ppp_pcb as well as input/output buffers 2012-06-16 03:53:05 +02:00
Sylvain Rochet
708147625f FSM global variables moved to ppp_pcb 2012-06-16 03:30:36 +02:00
Sylvain Rochet
93559a54e9 IPCP global variables moved to ppp_pcb 2012-06-16 03:25:31 +02:00
Sylvain Rochet
f10ddea305 removed fsm->unit 2012-06-16 03:14:26 +02:00
Sylvain Rochet
4a8ff6d824 protent prototype switched from unit to ppp_pcb 2012-06-16 02:43:13 +02:00
Sylvain Rochet
4b7e3af77c IPCP and LCP structures moved to ppp_pcb 2012-06-16 02:13:50 +02:00
Sylvain Rochet
19238a910c global variables removed from chap support 2012-06-15 01:22:01 +02:00
Sylvain Rochet
2deb13df43 EAP is now using ppp_pcb as well 2012-06-15 01:06:27 +02:00
Sylvain Rochet
1ece33e79a PAP and CHAP are now using ppp_pcb* 2012-06-15 00:24:39 +02:00
Sylvain Rochet
844f5e5af1 moved auth.c global variables to ppp_pcb 2012-06-14 00:25:45 +02:00
Sylvain Rochet
51bfac71b0 auth.c functions now use ppp_pcb* as first argument 2012-06-14 00:08:56 +02:00
Sylvain Rochet
81a0fd782f removed unit from ppp_ioctl() 2012-06-13 00:12:55 +02:00
Sylvain Rochet
3a30e5bf78 removed ppp_input_header, replaced using 2 chained pbuf the only area we need it 2012-06-12 23:28:09 +02:00
Sylvain Rochet
a87096cdc9 fixed PPPoS support, improved ppp_input() 2012-06-12 00:59:02 +02:00
Sylvain Rochet
527d99fd39 removed all PPP unit in ppp.c except pih->unit and unit used in debugging output 2012-06-12 00:55:53 +02:00
Sylvain Rochet
6e2722a6d3 started the unit to ppp_pcb replacement 2012-06-11 01:39:03 +02:00
Sylvain Rochet
8694deaabb don't add ppp_pcb_rx to ppp_pcb struct if PPPOS support is disabled 2012-06-10 21:06:02 +02:00
Sylvain Rochet
a226099b04 ppp_close() on PPPoE actually works,
clear persist mode if user asked the connection to shutdown
2012-06-10 01:45:29 +02:00
Sylvain Rochet
336ba8f419 pppoe now have access to the ppp_pcb structure, removed "persist" option copy 2012-06-10 01:08:37 +02:00
Sylvain Rochet
5abdc99f3e no more PPP unit number in PPPoE, now using ppp_pcb 2012-06-10 01:00:50 +02:00
Sylvain Rochet
f7ef9887d7 improved ppp_set_auth() mschap support 2012-06-09 23:38:38 +02:00
Sylvain Rochet
fed76f29d0 added missing EAP_SUPPORT macro 2012-06-09 23:38:26 +02:00
Sylvain Rochet
a3cfbfc6ba ppp_set_auth() modified to handle new handled authtype (mschap + eap) 2012-06-09 23:32:31 +02:00
Sylvain Rochet
444646b65e renamed ppp_control to ppp_pcb, replaced unit number to ppp_pcb in all ppp.h declared functions 2012-06-09 23:06:45 +02:00
Sylvain Rochet
8bd508a73d moved ppp_settings to ppp_control, improved PPP API to really allow multiple PPP sessions 2012-06-09 18:06:55 +02:00
Sylvain Rochet
1cceb4e0ad moved hide_password global variable to ppp_options 2012-06-09 17:05:19 +02:00
Sylvain Rochet
c2d2034ae8 PPPoE persist is working, removing FIXME comments about that 2012-06-09 16:56:32 +02:00
Sylvain Rochet
f94ed922e5 moved exit status global variable to ppp_control 2012-06-09 16:43:12 +02:00
Sylvain Rochet
7a57d28db4 moved listen_time global variable to ppp_settings 2012-06-09 16:18:01 +02:00
Sylvain Rochet
ce5121e659 removed unused "unsuccess" global variable 2012-06-09 16:00:22 +02:00
Sylvain Rochet
a7d7158b05 removed useless error_count global variable from ppp.c 2012-06-09 15:58:51 +02:00
Sylvain Rochet
6b8c78bacc moved remote_name and explicit_remote global variable to ppp_settings 2012-06-09 15:55:01 +02:00
Sylvain Rochet
2da930ba4c removed some useless extern 2012-06-09 15:45:52 +02:00
Sylvain Rochet
772cac7946 removed useless error_count global variable 2012-06-09 15:42:57 +02:00
Sylvain Rochet
42f672d85d phase global variable moved to ppp_control structure 2012-06-09 15:39:16 +02:00
Sylvain Rochet
945f2912a7 using PPP_DEBUG instead of debug global variable 2012-06-09 15:09:00 +02:00
Sylvain Rochet
1ccf516c5e options.c is now empty, removed 2012-06-09 14:43:56 +02:00
Sylvain Rochet
fb396b8fac moved debug option from options.c to ppp.c 2012-06-09 14:42:31 +02:00
Sylvain Rochet
6db3026d47 using our_name from ppp_settings (only used in server mode and disabled by default) 2012-06-09 14:39:44 +02:00
Sylvain Rochet
becc306300 using idle_time_limit from ppp_settings 2012-06-09 14:35:06 +02:00
Sylvain Rochet
4e7ce11684 removed holdoff support, can be handled without persist mode outside lwIP 2012-06-09 14:31:45 +02:00
Sylvain Rochet
6589cf9d8e removed useless options 2012-06-09 14:16:59 +02:00
Sylvain Rochet
552589f098 removed multilink option when multilink support is not compiled 2012-06-09 14:14:06 +02:00
Sylvain Rochet
2ec79c03a0 unused ifunit global variable removed 2012-06-09 01:26:21 +02:00
Sylvain Rochet
21653f0f91 pr_log is unused, don't even try to build it 2012-06-09 01:20:01 +02:00
Sylvain Rochet
b922eaa754 print packet is working back, at least for PPPoE 2012-06-09 00:52:20 +02:00
Sylvain Rochet
d27da93c33 now using maxconnect from ppp_settings 2012-06-07 23:34:06 +02:00
Sylvain Rochet
2e6fa7f8a3 dns server support is done, clearing FIXME entries 2012-06-07 23:05:19 +02:00
Sylvain Rochet
302184938a removed malloc() from ms chap 2012-06-07 23:02:08 +02:00
Sylvain Rochet
e5355cc45f PPP server support is now optional (disabled by default, not working until PPP have a "listen" support) 2012-06-07 22:22:57 +02:00
Sylvain Rochet
2fe778507a fixed randm if random MD5 support is not enabled 2012-06-07 22:19:25 +02:00
Sylvain Rochet
4077422ae2 fixed pbuf leaks in ppp_input() in case of packets not expected 2012-06-07 20:41:21 +02:00
Sylvain Rochet
a9ac45c5f0 added PPPoE persist support (don't timeout sending PADI packets) 2012-06-07 01:48:12 +02:00
Sylvain Rochet
7ef99ee6f3 added a persist option (enabled by default for now until we add a way for users to pass a ppp_settings structure)
improved PPPoE state machine and added persist mode support
2012-06-07 00:46:19 +02:00
Sylvain Rochet
e44aada634 improved PPPoE callback with state values, so that PPP know exactly what is happening on the PPPoE side 2012-06-06 23:42:20 +02:00
Sylvain Rochet
ac0a864e14 fixed typos s/parms/params/g 2012-06-06 22:36:23 +02:00
Sylvain Rochet
3c3331d5ed fixed some debug strings 2012-06-06 22:34:16 +02:00
Sylvain Rochet
6f21f48937 added MTU support (using MRU from the peer) 2012-06-05 23:10:38 +02:00
Sylvain Rochet
2e227f868b 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) 2012-06-05 22:22:35 +02:00
Sylvain Rochet
7d7513c71c re-enabled DNS support 2012-06-04 23:19:23 +02:00
Sylvain Rochet
d95f1e9913 added missing initialisation in ppp_init.c 2012-06-04 22:48:12 +02:00
Sylvain Rochet
1013b49ab7 disabled ppp_over_ethernet_close(), which is not exported and probably bogus, until we fix it 2012-06-04 22:23:10 +02:00
Sylvain Rochet
dc0e15a74e we should reduce nak_buffer[] size 2012-06-04 22:22:37 +02:00
Sylvain Rochet
d6e5ca722f setting default route by default 2012-06-04 19:00:36 +02:00
Sylvain Rochet
cd3ba00479 get_mask now returns "255.255.255.255" by default, which is what we want in almost all cases on a PPP link 2012-06-04 18:58:05 +02:00
Sylvain Rochet
c549dba725 re-enabled LCP echo interval / echo fail 2012-06-04 16:25:16 +02:00
Sylvain Rochet
ca1ad99bea PPPoE reauth bug fixed 2012-06-04 15:31:29 +02:00
Sylvain Rochet
2c7bd7e591 fixed print_string() prototype 2012-06-04 01:45:33 +02:00
Sylvain Rochet
bea45b3c30 cleared IDE warnings 2012-06-04 00:59:24 +02:00
Sylvain Rochet
093c7b4386 cleaned depreacted __P() and __V() macros, removed the legacy varargs.h header 2012-06-04 00:34:28 +02:00
Sylvain Rochet
8332a5aa53 disabled all plugins hooks 2012-06-04 00:12:45 +02:00
Sylvain Rochet
eb020656d2 disabled all plugins hooks 2012-06-04 00:12:17 +02:00
Sylvain Rochet
31456a6dfe removed CamelCase in ppp.c and ppp_impl.h, added compat macro in ppp.h (but disabled for now) 2012-06-03 23:56:56 +02:00
Sylvain Rochet
03fda0f803 removed CamelCase for all ppp.h declared functions 2012-06-03 21:48:10 +02:00
Sylvain Rochet
c09f03f6e8 VJ support is back! 2012-06-03 20:44:47 +02:00
Sylvain Rochet
3bad9ff50a ppp_impl.h is back! 2012-06-03 20:25:32 +02:00
Sylvain Rochet
0663421d01 re-added PPPoS code from the previous port, it builds, maybe it works 2012-06-03 20:05:40 +02:00
Sylvain Rochet
2f5f86d6fc don't build any PPP file if PPP support is disabled 2012-06-03 16:38:26 +02:00
Sylvain Rochet
89d2c2917f more ppp.[ch] cleaning 2012-06-03 16:24:33 +02:00
Sylvain Rochet
05817aa3b9 LQR (Link Quality Report) support is now optional 2012-06-03 14:02:25 +02:00
Sylvain Rochet
5464ed6661 removed all useless header files, merged ppp_defs.h to ppp.h
removed session.[ch] and tty.c which are Unix-centric files and disabled
2012-06-03 13:53:45 +02:00
Sylvain Rochet
05c84a147d added ECP_SUPPORT in opt.h (disabled by default); renamed MD5_SUPPORT to PPP_MD5_RANDM, which is more meaningful 2012-06-03 13:07:46 +02:00
Sylvain Rochet
9c35403b98 clarified a bit more ppp.[ch] 2012-06-03 01:46:46 +02:00
Sylvain Rochet
b5b075eb04 demystified a bit the PPP impl, renamed output() to ppp_output() to prevent conflict 2012-06-03 00:30:12 +02:00
Sylvain Rochet
e1261c9620 removed all system headers except the strict minimum 2012-06-02 23:29:40 +02:00
Sylvain Rochet
5531bca078 make it build with avr32-gcc
Disabled Unix-centric non necessary include files

Changed some include paths

Removed all printf() I put there and there for debugging.

It builds with the avr32 gcc toolchain, meaning we removed
all the pppd code requiring a unix base.
2012-06-02 23:04:03 +02:00
Sylvain Rochet
44c2a0a7fc fixed most PPP compilation warnings with -pedantic 2012-06-02 21:25:58 +02:00
Sylvain Rochet
d143acfc76 fixed all PPP compilation warnings with -Wall 2012-06-02 20:46:52 +02:00
Sylvain Rochet
b4d59fd52d removed headers that were initially copied but not used (yet) 2012-06-02 19:37:40 +02:00
Sylvain Rochet
2ee2a1b730 removed sys-linux.c 2012-06-02 19:34:37 +02:00
Sylvain Rochet
86ebc8e46c removed pppd.h and ppp.c, renamed pppmy.c to ppp.c and pppmy.h to ppp.h 2012-06-02 19:30:31 +02:00
Sylvain Rochet
29c5ee6b19 pppd.h disabled, renamed MAX() to LWIP_MAX() 2012-06-02 19:19:51 +02:00
Sylvain Rochet
323aebf1f5 cleaning unused stuff in pppd.h, syslog() is no more used 2012-06-02 18:47:53 +02:00
Sylvain Rochet
a5dd1ccfaa ppp.c disabled, everything required for lwIP moved to our impl 2012-06-02 18:07:34 +02:00
Sylvain Rochet
4dd297cef2 protent table moved to our PPP impl 2012-06-02 17:22:12 +02:00
Sylvain Rochet
7f9fea18ae added pppmy.h in all .c files to easily find conflicts 2012-06-02 17:12:55 +02:00
Sylvain Rochet
adb8b881b4 resolve conflit, ipcp.c defines ip_ntoa() which is already defined by lwIP, disabled ipcp.c::ip_ntoa() and using lwIP one 2012-06-02 17:04:46 +02:00
Sylvain Rochet
d3d1b69c7a more ppp.c cleaning 2012-06-02 16:56:20 +02:00
Sylvain Rochet
922d3716ff PPP statistics optional (non working) compile time option added 2012-06-02 16:41:09 +02:00
Sylvain Rochet
4158222e86 moved new_phase() to our own implementation, re-enabled new_phase() support 2012-06-02 15:00:18 +02:00
Sylvain Rochet
6727c43441 PPP notifier support is now a compile time option
However, as of now, the notify() function is empty, so it requires
some work if someone want to use it.

The notify feature allows someone to be able to follow the
state of the PPP stack (auth ok, ipcp up, initialise, ...), this
is like the callback feature set by pppOverEthernetOpen() and others,
but with more details.
2012-06-02 14:48:04 +02:00
Sylvain Rochet
55c1ec2925 re-enabled auth notifiers 2012-06-02 14:12:54 +02:00
Sylvain Rochet
0f1c18e675 PPP interval timeout support disabled (using lwIP timeout support), protocol_name() moved to our PPP impl and disabled by default 2012-06-02 13:46:45 +02:00
Sylvain Rochet
0de1293ff5 clarifying what is actually the "datainput" entry in protent 2012-06-02 13:03:43 +02:00
Sylvain Rochet
89ab390719 added necessary pppSingleBuf() call before passing the packet to the appropriate PPP subsystem 2012-06-02 02:44:18 +02:00
Sylvain Rochet
88ef3ffa50 POSIX signal support removed 2012-06-02 02:30:43 +02:00
Sylvain Rochet
668d5d9d92 removed set/getenv functions 2012-06-02 02:23:56 +02:00
Sylvain Rochet
6c908ac727 removed more protent fields only used by print packets functions 2012-06-02 02:14:19 +02:00
Sylvain Rochet
2c4bd7162f print packet functions are now optional 2012-06-02 02:07:49 +02:00
Sylvain Rochet
cf18e0776d removed demand prototypes if not compiled-in 2012-06-02 01:55:24 +02:00
Sylvain Rochet
8b866beaeb demand support is now a compile-time option
Obviously, it requires some wiring to know if there is new activity
on a not-yet established PPP interface with the default route
already set.

I don't think any lwIP user will ever need that, all should know
when to bring the link up and down.
2012-06-02 00:53:25 +02:00
Sylvain Rochet
ee5fca7a2b removed pathnames.h and pidfile support 2012-06-02 00:33:37 +02:00
Sylvain Rochet
fc074937f5 Linux ioctl() gone, ECP support optional, CCP support optional
Removed all the used Linux ioctl(), sys_linux.c is entirely disabled.

Replaced unecessary functions to set up a PPP link to null fonctions,
however all stuff necessary to shutdown a PPP link should be done.

Some utils functions related to I/O files are disabled too.

ECP and CCP support only set PPP attributes into the PPP kernel support,
they are now compile-time options and are disabled by default and
obviously not supported (yet? :p)
2012-06-02 00:19:40 +02:00
Sylvain Rochet
a17ea13453 autoselecting which PolarSSL files to use support added 2012-06-01 01:10:02 +02:00
Sylvain Rochet
8bb4ea85b8 removed some useless Linux calls 2012-06-01 01:07:27 +02:00
Sylvain Rochet
26e8372c75 changed PolarSSL compile-time condition 2012-06-01 00:59:15 +02:00
Sylvain Rochet
4704efa32a PAP support is now an optional compile-time feature 2012-05-30 23:32:30 +02:00
Sylvain Rochet
339925e835 CHAP support is now an optional compile-time feature 2012-05-24 00:52:20 +02:00
Sylvain Rochet
28360a7f26 MSCHAP is now an optional compile-time feature 2012-05-23 23:29:19 +02:00
Sylvain Rochet
49bb62d221 and less and less useless auth code (will this end ?) 2012-05-23 00:51:59 +02:00
Sylvain Rochet
04f121b88f less and less auth code 2012-05-23 00:04:07 +02:00
Sylvain Rochet
6ce5c8eb78 disabled upap_rauthreq() 2012-05-22 23:07:28 +02:00
Sylvain Rochet
7736cdae1c replaced BCOPY to lwip-MEMCPY 2012-05-22 23:02:02 +02:00
Sylvain Rochet
05aa1f1ae4 using MEMCPY() instead of memcpy() 2012-05-22 22:13:41 +02:00
Sylvain Rochet
42827cdea2 more and more ppp options removal 2012-05-22 21:59:23 +02:00
Sylvain Rochet
b88dad4034 disabled almost all PPP options strings and support as well as useless file-based auth code 2012-05-22 01:28:30 +02:00
Sylvain Rochet
d0645273df removed HMAC support from ciphers 2012-05-21 23:02:27 +02:00
Sylvain Rochet
dea27e105d cleaned PolarSSL files 2012-05-21 22:48:41 +02:00
Sylvain Rochet
0bfad4392a Commit to prouve we copied the raw BSD PolarSSL files 2012-05-21 22:33:37 +02:00
Sylvain Rochet
4c1b507c07 fixed MS-CHAP and MS-CHAP-V2, MD4 polarssl uses bytes as input length, not bits 2012-05-21 22:26:20 +02:00
Sylvain Rochet
0289055948 Revert "Revert "Added PolarSSL DES library, which is necessary for MSCHAP.""
This reverts commit a820f32ec9.
2012-05-21 22:15:40 +02:00
Sylvain Rochet
83a48dafea Revert "Revert "Replaced md4/md5/sha1 implementations to PolarSSL ones""
This reverts commit ca2fd867b8.
2012-05-21 22:14:29 +02:00
Sylvain Rochet
a7a20a9de4 Revert "now using OpenBSD DES implementation"
This reverts commit a9672e1a21.
2012-05-21 22:14:13 +02:00
Sylvain Rochet
82b67b01ff Revert "removed salted DES ( known as crypt() function ), we don't need it"
This reverts commit 517659640e.
2012-05-21 22:14:02 +02:00
Sylvain Rochet
b896203dcf Revert "Removed all stuff requiring encryption."
This reverts commit c268c5e07c.

Conflicts:

	src/netif/ppp/auth.c
	src/netif/ppp/ppp.c
	src/netif/ppp/pppmy.c
	src/netif/ppp/pppmy.h
2012-05-21 22:04:04 +02:00
Sylvain Rochet
795d5807b5 EAP support is now optional 2012-05-21 01:18:36 +02:00
Sylvain Rochet
7d43f4a1f4 removed useless system header from EAP 2012-05-21 00:03:18 +02:00
Sylvain Rochet
c268c5e07c Removed all stuff requiring encryption.
OpenBSD DES require more than 70 kB of static memory.

The GNU libcrypt DES, for information, require more than 131 kB,
so this is probably the case with all non memory optimised DES.

PolarSSL only required 132 bytes of stack with some kB of .rodata
precomputed tables :-)

I personally don't need MS CHAP v1 or MS CHAP v2, and that was not
supported in the previous PPP port, so there is no regression,
I feel comfortable about removing those hard to port stuff.

If someone want to do the MS CHAP port, he first have to find or
do a small memory footprint DES implementation.
2012-05-20 23:23:14 +02:00
Sylvain Rochet
517659640e removed salted DES ( known as crypt() function ), we don't need it 2012-05-20 22:47:12 +02:00
Sylvain Rochet
a9672e1a21 now using OpenBSD DES implementation 2012-05-20 22:32:24 +02:00
Sylvain Rochet
4570f71f21 modified auth_reset() so that we can choose which auth we want 2012-05-20 20:46:45 +02:00
Sylvain Rochet
ca2fd867b8 Revert "Replaced md4/md5/sha1 implementations to PolarSSL ones"
This reverts commit aa2656cb9e.

Licence issue, we cannot include GPLed source code.
2012-05-20 20:40:27 +02:00
Sylvain Rochet
624da03bad Revert "modified auth_reset() so that we can choose which auth we want"
This reverts commit bf10a27db8.

Licence issue, we cannot include GPLed source code.
2012-05-20 20:40:08 +02:00
Sylvain Rochet
a820f32ec9 Revert "Added PolarSSL DES library, which is necessary for MSCHAP."
This reverts commit de70b710af.

Licence issue, we cannot include GPLed source code.
2012-05-20 20:39:15 +02:00
Sylvain Rochet
f5dc6e80c0 Removed uneeded crypt() from auth.c and session.c 2012-05-20 20:04:05 +02:00
Sylvain Rochet
de70b710af Added PolarSSL DES library, which is necessary for MSCHAP.
Added a README about our PolarSSL included files, clarifying what we did.

Removed crypt(), -lcrypt ( setkey() / encrypt() ) dependencies.
2012-05-20 19:57:37 +02:00
Sylvain Rochet
bf10a27db8 modified auth_reset() so that we can choose which auth we want
also fixed MS-CHAP and MS-CHAP-V2, MD4 polarssl uses bytes as input
length, not bits
2012-05-20 15:27:52 +02:00
Sylvain Rochet
aa2656cb9e Replaced md4/md5/sha1 implementations to PolarSSL ones
Using cleaned PolarSSL md4/md5/sha1 implementations, without changing the API,
so that lwIP users already doing SSL or using PolarSSL don't need to compile
md4/md5/sha1 twice.

Added to that, we need a DES library for MSCHAP, and PolarSSL provided
a DES support.

And finally, PolarSSL is outstanding :-)
2012-05-20 01:44:22 +02:00