Commit Graph

1425 Commits

Author SHA1 Message Date
Dirk Ziegelmeier
6aed6e659f Rework DHCP PCB handling: Old code registered one UDP PCB per netif where DHCP was active and there was a special case in udp_input() for this. New implementation uses one PCB for all netifs and removes special case in udp_input().
The old approach called udp_bind() on each of the PCBs, which puts them into udp_pcbs list. The PCBs were iterated on all non-DHCP udp_inputs() with no effect.
My cleanup removes the special handling in udp.c, and uses only one DHCP UDP PCB to catch all DHCP messages from all netifs. The dhcp_recv function then checks whether ip_current_input_netif() has DHCP enabled - if not, the message is ignored. The PCB is only created/registered when one or more PCBs have DHCP enabled.
2016-02-29 19:31:19 +01:00
Dirk Ziegelmeier
42c92f80f1 Add compatibility macro for udp_new_ip6() 2016-02-29 13:25:13 +01:00
goldsimon
fa16ee8dcb cleaned up includes a bit after IPv6 changes 2016-02-29 09:27:59 +01:00
goldsimon
97b7555119 bring back ETHARP_HWADDR_LEN (if anyone uses it) 2016-02-26 14:21:03 +01:00
Joel Cunningham
8cb64698aa Allow backlog to be updated
This commit adds support to the sockets and netconn layer to update the
backlog by calling listen when the netconn is already in the listen state.
When backlog is not enabled, the call returns successfully

This commit also introduces a macro for setting the backlog value that
prevents a 0 sized (invalid) backlog
2016-02-25 15:19:52 -06:00
sg
a649a3eb50 dual-stack fix: moved common definitions/code for ethernet used by etharp and ethip6 to new files ethernet.h/.c 2016-02-25 22:10:28 +01:00
Dirk Ziegelmeier
953b7bdd59 Implement UDP dual-stack PCB support
Create special IP address type "IPADDR_TYPE_ANY" for it.
SNMP uses new feature in non-netconn mode.

TODO: Same for TCP & RAW, adapt NETCONN to use this feature
2016-02-24 22:37:01 +01:00
sg
68590c2b27 minor/coding style: lowpan6_opts.h: tabs->spaces, trim trailing spaces 2016-02-24 22:03:40 +01:00
Dirk Ziegelmeier
3b5803ec9a sys.h: Avoid un #defined LWIP_COMPAT_MUTEX macro (usually #defined in arch/sys_arch.h) 2016-02-23 15:49:58 +01:00
Dirk Ziegelmeier
481d350bf3 lwip/stats.h: Add some comments to MIB2 variables to explain correct usage a bit 2016-02-23 12:08:31 +01:00
Dirk Ziegelmeier
680f8f31ab I don't know why I have a diff here (I guess line ending problems like in my last lowpan6.c commit)... 2016-02-23 10:20:05 +01:00
Dirk Ziegelmeier
9a4d7b9956 Use netif_input_fn typedef instead of creating a new one in tcpip.h 2016-02-22 21:10:50 +01:00
Dirk Ziegelmeier
fe8d2ba72f Eliminate tcpip_pppos_input function 2016-02-22 21:00:00 +01:00
Dirk Ziegelmeier
e2a3565971 Initial import of Ivan Delamer's 6LoWPAN implementation with slight modifications to allow compiling in IPv6 only mode 2016-02-22 20:44:32 +01:00
Dirk Ziegelmeier
777e667f08 Add generic tcpip_inpkt function that can be called to make last changes really usable 2016-02-22 20:18:10 +01:00
Dirk Ziegelmeier
fa6f068fd1 Eliminate TCPIP_MSG_INPKT_PPPOS message type.
Fix my last commit, I accidentally unchecked the wrong file in commit dialog
2016-02-22 17:47:01 +01:00
Dirk Ziegelmeier
439ae629e0 Change TCPIP INPKT API message to take a function pointer. Allows integration of other protocols without extending lwIP core (e.g. 6LoWPAN)
Remove unused sem member of struct tcpip_msg
2016-02-22 17:39:01 +01:00
Dirk Ziegelmeier
d8531a2407 Cleanup NETCONNTYPE_ISIPV6 macro 2016-02-22 13:55:27 +01:00
Dirk Ziegelmeier
c805843e64 Change signature of ip_output, ip_output_if, ip_output_if_src, ip_output_hinted, ip_route, ip_netif_get_local_ip, ip_route_get_local_ip and tcp_eff_send_mss not to take an isipv6 parameter. Use the IP version of the destination address instead. 2016-02-22 13:38:40 +01:00
Dirk Ziegelmeier
880f1008d6 Together with Simon: Eliminate last instances of isipv6 member in pcbs;
Don't allow NULL pointers (IPv4 ANY) in connect() and sendto() functions as destinations since this does not make sense.
2016-02-22 13:03:51 +01:00
Dirk Ziegelmeier
339e82d7aa Eliminate IP_PCB_IPVER_EQ macro 2016-02-21 19:45:51 +01:00
Dirk Ziegelmeier
5a25652c21 Eliminate IP_PCB_IPVER_INPUT_MATCH macro 2016-02-21 19:21:36 +01:00
Dirk Ziegelmeier
24bc77a935 Found some struct instances that can be const 2016-02-16 22:31:59 +01:00
Dirk Ziegelmeier
cddd3b552a etharp.c: Make MAX_AGE of an ARP entry configurable 2016-02-11 09:38:17 +01:00
Dirk Ziegelmeier
208f24a20c SNMP: Add some comments in thread sync code 2016-02-04 16:20:46 +01:00
Dirk Ziegelmeier
222155d7e2 pbuf: Make pbuf_skip function public, so it can be used in SNMP code 2016-02-03 08:37:04 +01:00
Dirk Ziegelmeier
28549e35fe SNMP: Update threadsync not to use mem_malloc - memory can be instantiated statically since it is only needed once per threadsync instance 2016-02-02 22:31:59 +01:00
Dirk Ziegelmeier
8f6cfa8769 Private mempools: Add missing include for LWIP_MEM_ALIGN_SIZE in memp_priv.h 2016-02-02 22:28:21 +01:00
Sylvain Rochet
4beacc4ca0 PPP, VJ, fixed TCP retransmission
We used to modify in place the packet payload during compression but TCP
stack requires that we don't change the packet payload, therefore we now
copy the whole packet before compression.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2016-01-24 20:07:54 +01:00
Sylvain Rochet
858bce7b4e PPP, VJ, code cleaning
Using lwIP types instead of u_ types.
Removed useless register modifier on variable.
Removed trailing spaces.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2016-01-24 01:38:26 +01:00
Sylvain Rochet
733758a909 tcp: fixed TCPH_UNSET_FLAG macro
This macro is only used by VJ support in PPP and was always wrong since
its introduction in commit e4a6d199fe. It's almost only used to clear
the PSH TCP flag when necessary. This flag was probably less common
about a decade ago so that would be the reason why it goes unnoticed for
so long.

Fixes: e4a6d199fe "Merged from DEVEL into main tree."
Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2016-01-24 01:38:26 +01:00
Joel Cunningham
96373f6959 Define LWIP_CHKSUM_COPY_ALGORITHM when port provides LWIP_CHKSUM_COPY macro
When the port has LWIP_CHECKSUM_ON_COPY enabled and provides
a definition of LWIP_CHKSUM_COPY, the existing logic left
LWIP_CHKSUM_COPY_ALGORITHM undefined

In this case we want it to be defined to 0 since none of the copy
checksum algorithms provided are being used

This commit also introduces indentation matching LWIP_CHKSUM to
improve the readability of the code
2016-01-20 11:34:25 -06:00
Joel Cunningham
0a67c06b51 Fix type on snmp_set_test_ok to be snmp_err_t
This function was returning values from snmp_err_t but wasn't
upgraded to using the typedef after commit babce70

This resulted in compilation failure on MSVC 2013
2016-01-20 11:18:35 -06:00
Dirk Ziegelmeier
babce70c95 SNMP: Convert SNMP error #defines to an enum and fix type mismatches discovered by conversion; Convert SNMP_NEXT_OID_STATUS to an enum 2016-01-20 10:53:59 +01:00
Sylvain Rochet
6185bf6f61 PPP: CCP: don't drop output packets if CCP negotiated that we don't compress on our side
CCP might negotiate to not compress if peers cannot agree on a
compressor, therefore if the null compressor is chosen we must pass
packets as is instead of dropping them.

Reported-by: Stephan Linz <linz@li-pro.net>
Fixes: 987f6237c4 "PPP, MPPE, drop input/output packets if we couldn't find the chosen decompressor/compressor"
Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2016-01-19 23:51:47 +01:00
Dirk Ziegelmeier
d9534325cf SNTP: Add function to get operating mode 2016-01-15 11:41:12 +01:00
Dirk Ziegelmeier
4e8574bd23 SNMP: Table API cleanup 2016-01-07 09:53:25 +01:00
Dirk Ziegelmeier
7412a0e74e SNMP: Move common MIB code into snmp_core.c helper functions 2016-01-02 21:29:01 +01:00
Dirk Ziegelmeier
dfaa979b99 Start working on udpEndpointTable 2015-12-31 16:13:45 +01:00
Dirk Ziegelmeier
611966de63 SNMP: Cleanup snmp IP helper functions, add IPv6 support 2015-12-29 22:06:23 +01:00
Dirk Ziegelmeier
4341df4094 SNMP: Fix compile when IPV4 is not enabled 2015-12-28 22:28:01 +01:00
Dirk Ziegelmeier
fdd98879bf C-Style comments only, please 2015-12-26 12:17:07 +01:00
Dirk Ziegelmeier
5e34b8736a Minor SNMP compile and comment fix 2015-12-26 12:02:16 +01:00
Dirk Ziegelmeier
7b946fa9b1 SNMP agent rewrite
- SNMPv2c support
  - Greatly reduced RAM usage, no memory pools any more
  - API cleanup
  - MIB2 is separated from SNMP stack
  - Support for multiple MIBs (snmp_set_mibs call) - e.g. for private MIB
  - Improved MIB2 implementation (tcpConnTable etc.)
  - Redesigned simple and generic API for MIB implementation
  - Comfortable node types for scalar arrays and tables
  - Counter64, bit and truthvalue datatype support
  - Callbacks for SNMP writes
  - Runs on two APIs: RAW and netconn
  - Async API is gone - the stack now supports netconn API instead,
    so blocking operations can be done in MIB calls.
    SNMP runs in a worker thread when netconn API is used.
  - Simplified thread sync support for MIBs - useful when MIBs
    need to access variables shared with other threads without locking
    (used in MIB2 to access lwIP stats from lwIP thread)

Currently in work:
  - Traps rewrite
  - MIB compiler
2015-12-26 11:43:29 +01:00
Dirk Ziegelmeier
0178d1d2ee Add missing comment for MIB2 callbacks in opt.h 2015-12-09 21:06:14 +01:00
Dirk Ziegelmeier
f69b1841e0 Fix compile when netconn api is disabled but socket api is enabled.
Problem is that declaring functions as static in a public header will produce warnings in every file it is included because the static functions are not implemented.
Solution: When socket api is enabled, netconn is simply available, too
(Socket api uses netconn api internally)
2015-12-05 21:58:38 +01:00
Axel Lin
3b60c855e1 netbuf: Move #include "lwip/opt.h" out of #if LWIP_NETCONN || LWIP_SOCKET guard
LWIP_NETCONN and LWIP_SOCKET are defined in opt.h,
so move #include "lwip/opt.h" out of #if LWIP_NETCONN || LWIP_SOCKET guard.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-12-05 21:22:34 +01:00
Dirk Ziegelmeier
8bb27ba8c4 Forgot to remove two SNMP options from opt.h that are now in lwip/apps/snmp_opts.h 2015-12-03 13:51:59 +01:00
Dirk Ziegelmeier
3f49b85680 Update header include guard naming of all apps headers
Unbreak compilation, lwip/apps/snmp.h guard clashed with lwip/snmp.h
2015-11-18 20:21:56 +01:00
Dirk Ziegelmeier
65bb7a623c snmp.h: Add missing #if around function prototypes 2015-11-18 08:18:04 +01:00