Commit Graph

6171 Commits

Author SHA1 Message Date
Dirk Ziegelmeier
104a629a51 zepif: Convert to dual-stack 2018-03-15 09:21:32 +01:00
goldsimon
d79416eee6 lowpan6: move a function to delete one prototype 2018-03-14 16:59:20 +01:00
Axel Lin
6070a7ef6a netif: Add netif_do_ip_addr_changed function to reduce duplicated code
As the common code to call tcp/udp/raw_netif_ip_addr_changed is called
by multiple places, add netif_do_ip_addr_changed() to call them.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-03-14 22:59:17 +08:00
goldsimon
08bcfa2b29 netif: initialize netif->output with a dummy function for IPv6 only netifs 2018-03-13 20:29:37 +01:00
goldsimon
0074022bb5 minor: fix typos and spaces 2018-03-13 20:28:59 +01:00
Axel Lin
10ae311a93 lowpan6: Rework to speed up dequeue datagram process
Current implementation iterates the lowpan6_data.reass_list every time
dequeue_datagram() is called.
We can get previous lrh in all the context calling dequeue_datagram().
By adding a prev arguemnt to dequeue_datagram(), we can speed up the
dequeue datagram process.

All the callers never check return value of dequeue_datagram() as it
always return ERR_OR, thus make it return void instead.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-03-13 08:16:35 +08:00
Axel Lin
909037c2ca api_lib: Remove superfluous #if LWIP_TCP in netconn_recv_data_tcp
netconn_recv_data_tcp() will be built only when LWIP_TCP=1.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-03-11 16:47:14 +08:00
goldsimon
16afe566ff lowpan6: fix doc warning in clang 2018-03-09 13:40:15 +01:00
goldsimon
253fcc8dcd http_client: call tcp_recved for header bytes
Without this, closing the connection after successful transfer resulted
in a RST being sent because the window was not fully marked as 'recved'.

Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-03-09 11:30:23 +01:00
goldsimon
8d8572354b lowpan6: fix bug #47291 (wrong datagram size for fragmentation)
Fragment datagram_size and datagram_offset should be calculated from the uncompressed datagram.
We did this on the compressed size and thus were not compatible to other implementations.
Now my test setup communicates with contiki sicslowpan.

Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-03-09 11:28:35 +01:00
goldsimon
b86f9b97e0 lowpan6: refactor decompression to not allocate a pbuf 2018-03-09 06:37:59 +01:00
goldsimon
61a1b98cc9 various IPv6-only compile fixes 2018-03-07 20:55:00 +01:00
goldsimon
972f32dd47 zepif: fix compiling with IPv4 disabled 2018-03-07 19:58:09 +01:00
Axel Lin
971404ff90 http_client.h: Include lwip/pbuf.h
struct pbuf is used by httpc_headers_done_fn, thus need to include
lwip/pbuf.h.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-03-07 15:24:14 +08:00
Axel Lin
0411332856 api_msg.h: Fix build error when LWIP_NETIF_API && !LWIP_SOCKET && !LWIP_NETCONN
netifapi related lwIP internal definitions should be guarded
by #if LWIP_NETIF_API rather than #if LWIP_NETCONN || LWIP_SOCKET.

Fix below build errors:
cc -g -DLWIP_DEBUG -Wall -pedantic -Wparentheses -Wsequence-point -Wswitch-default -Wextra -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wc++-compat -Wwrite-strings -Wold-style-definition -Wcast-align -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Wunreachable-code -Wuninitialized -Wmissing-prototypes -Wredundant-decls -Waggregate-return -Wlogical-not-parentheses -Wlogical-op -Wc90-c99-compat -Wtrampolines -I. -I../../..  -I../../../../lwip/src/include -I../../../ports/unix/port/include -I../../../../mbedtls/include -Wno-redundant-decls -DLWIP_HAVE_MBEDTLS=1 -c ../../../../lwip/src/api/netifapi.c In file included from ../../../../lwip/src/api/netifapi.c:46:0:
../../../../lwip/src/include/lwip/netifapi.h:76:50: error: unknown type name 'netifapi_void_fn'; did you mean 'netif_init_fn'?
 err_t netifapi_netif_common(struct netif *netif, netifapi_void_fn voidfunc,
                                                  ^~~~~~~~~~~~~~~~
                                                  netif_init_fn
../../../../lwip/src/include/lwip/netifapi.h:77:29: error: unknown type name 'netifapi_errt_fn'; did you mean 'netif_input_fn'?
                             netifapi_errt_fn errtfunc);
                             ^~~~~~~~~~~~~~~~
                             netif_input_fn
../../../../lwip/src/api/netifapi.c: In function 'netifapi_do_netif_add':
../../../../lwip/src/api/netifapi.c:67:22: error: dereferencing pointer to incomplete type 'struct netifapi_msg'
   if (!netif_add( msg->netif,
                      ^~

Fixes: 30a2283993 ("Move netifapi private definitions to priv/api_msg.h")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-03-07 07:58:10 +08:00
goldsimon
b6d9bb6b2a http_client: check current state when receiving FIN 2018-03-06 21:51:13 +01:00
goldsimon
91a2d9e237 zepif: fix comment for calling netif->input() 2018-03-05 08:40:51 +01:00
goldsimon
5474498f7e zepif: call netif->input instead of tcpip_6lowpan_input for rx packets
This allows reusing zepif e.g. with contiki 6LoWPAN code for testing.
2018-03-05 06:43:57 +01:00
Joel Cunningham
b28e979739 unit: write out XML file
This writes out the results of the unit tests in an XML file called
lwip_unittests.xml in the same directory as the unittests executable.

See https://libcheck.github.io/check/doc/check_html/check_4.html#XML-Logging
for an example of the ouput. Of particular use is the duration field, for
each test and for the entire test run.
2018-03-04 10:42:54 -06:00
Axel Lin
53ddb9244b apps/sntp: Trivial build warning fix
Fix below build warning:
../../../../lwip/src/apps/sntp/sntp.c: In function ‘sntp_servermode_dhcp’:
../../../../lwip/src/apps/sntp/sntp.c:726:3: warning: ISO C90 forbids mixed declarations and code [-Wc90-c99-compat]
   u8_t new_mode = set_servers_from_dhcp ? 1 : 0;
   ^~~~

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-03-04 19:18:26 +08:00
Joel Cunningham
b1258bf8e6 unit: speed up test_pbuf_queueing_bigger_than_64k
Speed up test_pbuf_queueing_bigger_than_64k by using memcmp rather than
a byte by byte comparision. This allows using word aligned compares
within the memcmp implementation

This fixes a unit test timeout on my Windows 10 box with WSL which was
taking longer than 4 seconds for the unix port unit test to complete

See failure details in https://savannah.nongnu.org/patch/index.php?9579
2018-03-03 17:43:23 -06:00
Dirk Ziegelmeier
91038e4979 Improve 6LoWPAN documentation 2018-03-03 11:09:57 +01:00
Dirk Ziegelmeier
08bf8b7121 Improve documentation for 6LOWPAN BLE and ZEPIF 2018-03-03 11:00:04 +01:00
goldsimon
282e1601ef finally got zepif running 2018-03-02 13:01:05 +01:00
goldsimon
ab0e457066 lowpan6: change the name of 2 members to indicate usage for tx 2018-03-01 22:17:12 +01:00
goldsimon
a137e16ff8 lowpan6.c: fix referenced RFCs 2018-03-01 12:44:18 +01:00
goldsimon
6e62baaa6c sockets.h: include <string.h> for memcpy in FD_ZERO 2018-03-01 09:05:29 +01:00
goldsimon
cb746a1aea zepif: fix destination IP (default should be broadcast, not 0.0.0.0) 2018-03-01 07:08:03 +01:00
goldsimon
fcccc47be4 lowpan6.c: fix clang doc warnings 2018-03-01 07:00:32 +01:00
goldsimon
002ba1a66b zeoif: ZEPIF_LOOPBACK should be 0 default, not 1 2018-03-01 06:15:55 +01:00
goldsimon
43778e5334 add zepif.c to Filelists.mk 2018-02-28 23:00:08 +01:00
goldsimon
43a55003da Added a netif encapsulating 6LowPAN in ZEP (ZigBee Enxapsulation Protocol)
This protocol is sent over a 2nd netif via UDP/IP and can used to analyze
6LoWPAN with a Wireshark dissector.

Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-02-28 22:58:48 +01:00
goldsimon
d9770d2c5f tcpip_thread: TCPIP_MSG_INPKT: free input pbufs if the input function returns an error
This simply wasn't the case until 6LoWPAN. However, since tcpip_input is like this, we
should stay with that pattern.

Adapted documentation in netif.h

Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-02-28 22:48:56 +01:00
goldsimon
3a8af612b3 lowpan6.c: handle 6-byte MAC addresses on netif, too 2018-02-28 22:46:55 +01:00
goldsimon
2a5b66c9b1 lowpan6.c: tiny whitespace fix 2018-02-28 22:32:58 +01:00
goldsimon
3a93029e92 lowpan6.c: implement software CRC (e.g. required for use with ZEP) 2018-02-28 21:39:38 +01:00
goldsimon
fe68fa49f7 lowpan6.c: refactor parsing and writing the ieee 802.15.4 header to separate function 2018-02-28 21:38:49 +01:00
goldsimon
5e91cd47c9 lowpan6.c: ensure netif->hwaddr_len == 8 (to not create invalid frames) 2018-02-28 21:09:55 +01:00
goldsimon
4f059fea76 fix some IEEE_802154_FC_ bit definitions 2018-02-28 21:03:40 +01:00
goldsimon
569464ffd3 lowpan6.c: move static variables declared inside lowpan6_frag into lowpan6_data 2018-02-28 20:42:31 +01:00
Axel Lin
6e6eb620df tftp_opts.h: Make TFTP_DEBUG default OFF
TFTP_DEBUG should be enabled only when it's necessary to debug tftp,
make it default OFF.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-02-28 13:49:44 +08:00
Axel Lin
3c71e3fc77 lowpan6_ble_opts.h: Make LWIP_RFC7668_DEBUG default OFF
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-02-27 18:04:36 +08:00
Axel Lin
2e2c607727 lowpan6.c: Fix ‘lowpan6_context_lookup’ defined but not used build warning
Fix build warning with LWIP_6LOWPAN_NUM_CONTEXTS==0.
lowpan6_context_lookup() is only used when LWIP_6LOWPAN_IPHC &&
LWIP_6LOWPAN_NUM_CONTEXTS > 0.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-02-27 18:01:18 +08:00
goldsimon
49acdae8d0 lowpan6.c: fix building with LWIP_6LOWPAN_NUM_CONTEXTS==0 2018-02-27 10:07:15 +01:00
goldsimon
7db978ca03 lowpan6.c: rework lowpan6_input processing of the ieee 802.15.4 header
This should fix bug #48825 (lowpan6: source PAN ID is skipped without
checking PAN ID compression flag)
2018-02-26 21:47:24 +01:00
goldsimon
731b83ac5f lowpan6.c: a netif input function must return ERR_OK only if the input pbuf was freed 2018-02-26 20:51:13 +01:00
goldsimon
fb5bbca1d9 lowpan6.c: move IEEE 802.15.4 definitions to their own header file
This is mainly a preparation to merge the two 6LoWPAN netifs
2018-02-26 20:38:41 +01:00
goldsimon
a022590f40 lowpan6.c: move netif-specific data to a common struct 2018-02-26 20:32:39 +01:00
Axel Lin
c28aa02820 lowpan6_ble: Convert to use pbuf_remove_header instead of pbuf_header
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-02-26 10:20:05 +08:00
goldsimon
e7766297de dhcp6_disable: need to set pcb_allocated to zero
See bug #53224: dhcp6_disable() pcb_allocated need set to zero.
2018-02-25 13:20:28 +01:00