Commit Graph

3056 Commits

Author SHA1 Message Date
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
a5582e0960 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: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
48f7678771 PPP: re-order prototypes, ppp_init before ppp_new
Cosmetic only.
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
604a92dc3d fixed bug #38853 "connect() use a wrong errno": return ERR_ALREADY/EALRADY during connect, ERR_ISCONN/EISCONN when already connected 2015-02-17 22:10:23 +01:00
sg
b146ae96a7 sockets.c: removed LWIP_TCPIP_CORE_LOCKING hack in lwip_sendto(): since all functions are static when LWIP_NETCONN==0, the speedup gained by this hack should now be minimal and not worth the duplicate code. 2015-02-17 21:26:40 +01:00
goldsimon
0963e91c34 api_msg_c: fixed compiler warning (added brackets in if statement) 2015-02-17 09:38:20 +01:00
goldsimon
5d13b5a2fb fixed bug #37614 "Errors from ipX_output are not processed". Now tcp_output(_segment) checks for the return value of ipX_output and does not try to send more on error. A netif driver can call tcp_txnow() (from tcpip_thread!) to try to send again if TX buffers are available again. 2015-02-17 08:02:34 +01:00
sg
90db821036 patch #8361 "Add support for NTP option in DHCP" (slighly modified) 2015-02-16 21:23:06 +01:00
Sylvain Rochet
99d1fdd270 snmp: syntax error fix on endif comment
*/ omitted on comment, added.
2015-02-14 19:38:35 +01:00
Sylvain Rochet
10ab72855d opt: fix build without SNMP_COMMUNITY_EXT
define value omitted on #define SNMP_COMMUNITY_EXT in opt.h, default is 0
2015-02-14 19:38:29 +01:00
sg
0d18516af8 added support for write-access community and dedicated community for sending traps 2015-02-14 15:44:32 +01:00
sg
e22c815444 patch by Freddie Chopin: SNMP: const-correctness around snmp traps and enterprise 2015-02-14 15:11:44 +01:00
sg
e579e98469 minor coding style fix: tab -> spaces 2015-02-14 15:05:12 +01:00
sg
723eaa1f40 Fixed compiler warning in snmp.h introduced by last patches 2015-02-14 15:04:55 +01:00
Freddie Chopin
4ebeeaf1e0 msg_in.c, msg_in.c: add snmp_get_community() and snmp_set_community() accessors
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
2015-02-14 14:49:42 +01:00
Freddie Chopin
2c9ceea3cf msg_in.c, snmp_msg.h: convert snmp_community to a modifiable pointer
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
2015-02-14 14:49:41 +01:00
Freddie Chopin
c289872ab7 msg_in.c, msg_out.c, snmp_msg.h: rename snmp_publiccommunity to snmp_community, update descriptions
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
2015-02-14 14:49:39 +01:00
Freddie Chopin
9469bdc93e msg_in.c, snmp_msg.h: don't hardcode size of community string
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
2015-02-14 14:47:55 +01:00
Freddie Chopin
9b4564d7f3 snmp_trap_header_sum(): use strlen() to get the length of community string
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
2015-02-14 14:46:51 +01:00
sg
b5b5844119 added hook LWIP_HOOK_MEMP_AVAILABLE() to get informed when a memp pool was empty and an item is now available 2015-02-13 21:53:55 +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
sg
e3e3200f95 fixed bug #22070 "MIB_OBJECT_WRITE_ONLY not implemented in SNMP" 2015-02-13 21:12:23 +01:00
sg
7a0f814043 introduce sys_timeouts_sleeptime (returns the time left before the next timeout is due, for NO_SYS==1) 2015-02-12 22:14:28 +01:00
sg
80b62df0a9 fixed bug #36403 "ip4_input() and ip6_input() always pass inp to higher layers": now the accepting netif is passed up, but the input netif is available through ip_current_input_netif() if required. 2015-02-12 22:04:10 +01:00
chrysn
81d4e201bb include the memp struct list once before actually using it
when custom lwipopts.h files are used (MEMP_USE_CUSTOM_POOLS), there is
typically the need to use sizeof(some_struct) in there, but on structs
that are not already declared in lwip; thus, they use #include on custom
headers.

even if the included files have proper include guards, the way memp
headers are used (

    typedef enum {
    #define LWIP_MEMPOOL(name,num,size,desc)  MEMP_##name,
    #include "lwip/memp_std.h"
      MEMP_MAX
    } memp_t;

) breaks when fresh includes are involved. in this patch, this gets
circumvented by including lwip/memp_std.h once with an empty
LWIP_MEMPOOL definition, so that all the includes from custom
lwippools.h files can be handled safely.
2015-02-11 23:10:15 +01:00
sg
8155b8cfb3 patch #7702 "Include ability to increase the socket number with defined offset" 2015-02-11 23:05:52 +01:00
sg
276e35ecfb Fixed a bug in linger-closing when LWIP_TCPIP_CORE_LOCKING==1 2015-02-11 22:53:19 +01:00
sg
7d8657287e patch #8362 Add defines for well known ethernet packet types 2015-02-11 21:59:48 +01:00
sg
f7905582db More tiny code cleanups... 2015-02-11 21:53:12 +01:00
Fred Baksik
f12e6837be LWIP_PLATFORM_DIAG: check if LWIP_PLATFORM_DIAG is defined as needed.
-- LWIP_STATS and LWIP_DEBUG require this macro
2015-02-11 21:44:43 +01:00
Fred Baksik
3870031c6e LWIP_ASSERT: check for LWIP_PLATFORM_ASSERT if LWIP_NOASSERT is not defined.
-- add comment about usage of LWIP_NOASSERT
2015-02-11 21:43:40 +01:00
sg
060a1fc727 patch #8481 Fix a couple of c&p mistakes in the error prints 2015-02-11 21:39:45 +01:00
sg
28783abbe2 fixed bug #43094 "The function tcpip_input() forget to handle IPv6" 2015-02-11 21:36:46 +01:00