Move the IN_USE clear in net_tcp_release() to the END of the function
after the destruction is complete so someone else doesn't allocate it
while we're still cleaning it up.
Also, operations on the IN_USE flag need to be atomic for correctness.
Stick an irq_lock() around them.
Change-Id: I9d7557244fc8de5b0c69fd0bc749a9e28fa19a54
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Big chunks of this struct were essentially unused:
+ The prev_state field was stored at state change but never inspected.
+ The send_wnd, send_max_wnd, send_cwnd, send_pcount and
send_ss_threshold fields were simply unused.
+ The recv_scale field was never initialized to anything but zero,
remove the support. Windows greater than 64k seem very unlikely to
be useful to Zephyr anyway; if we actually want window scaling (in
either direction -- there are large memory costs!) it should
probably be optional via Kconfig. We surely don't want to carry
this for all builds.
+ The buf_max_len field was hard-coded static, replace with a #define
+ Double-memset of the ack_timer field in initialization
Change-Id: I223665518529dc6a7f267bbc6992a645a30f5735
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Rename project configuration to be architecture independent and do not use ARCH
in Makefile.
Change-Id: Ic793751e3187bc74fd14cec929754d691b01a799
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Implement serial-radio protocol used in Contiki-based border routers
to interact with 802.15.4 devices connected over serial or USB-serial.
Change-Id: I938b34ca32ae7a08e5d48e3bea585cda6c98c113
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Change DBG to ERR for error cases to get errors when only errors are
selected.
Change-Id: I51fd15900b1efb96d5dff36367afcdf380f11b88
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This prepends logs instead of [general] with [cc2520].
Change-Id: I148159a451981fbe3da638732f0e97900f76bc58
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This provides only initial set of functionality tests
for TCP. More tests are to be written.
Change-Id: I157fed85f561523bf063732ce86eaae551c2d384
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This creates initial TCP handling logic but does not yet
enable fully working TCP connection.
Some of the connection logic is taken from FNET TCP
implementation.
Origin: FNET 3.6.1
URL: https://github.com/butok/FNET/blob/master/fnet_stack/stack/fnet_tcp.c
Change-Id: I1e100d9fa9c91437562b933d94d0bd3db1a5885e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
NET_NBUF_USER_DATA_SIZE can be used to set the user_data size required
by drivers in order to be able to reuse the network data buffer without
copying them.
Change-Id: I198b24ee6d2b8971801c8da40ce008da20bd95c4
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This way we avoid ugly casts in the calling code.
Change-Id: I9c949cf22ecd1603e9247a07240de5759bf85463
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Apparently, a copy-paste error: NET_CONTEXT_TYPE was used instead of
NET_CONTEXT_PROTO. The corresponding "set" function uses the latter,
so it for "get" too.
Change-Id: Ideb5bfaeb548222a6e64d53b782c9a111e3ef33b
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Current net_nbuf_write() api just appends data to last fragment. And
doesn't write data based on offset. That's why renaming this api.
New net_nbuf_write() apis based on offset will be coming soon.
Change-Id: Ie8e13e5f6091a279b62b6d8b0b3928a5187e75b0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Reason for error is ARP message redirected back to ethernet
instead of sending directly.
Call flow:
ehternet_send()
net_arp_prepare()
net_send_data().. which again calls ethernet_send().
So below check is necessary in net_arp_prepare().
"if (ntohs(hdr->type) == NET_ETH_PTYPE_ARP)".
When same buffer used for Tx, it still contains garbage in link
layer header (which is uninitialized). But this check
assumes buffer is ARP and send it immediately.
So first fix is just queue the Tx buf with net_if_queue_tx.
Now only ethernet_send() will call net_arp_prepare(), means
input buffer for net_arp_prepare is not ARP at all. So the check
is not necessary.
Jira: ZEP-1036
Change-Id: I86eaba5ffaa9cabfe43e643b17fa0f9171c4c521
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Slip context parameter is not used in hexdump and in few places
it is not defined. So CONFIG_SLIP_DEBUG=y throws errors.
Change-Id: I73ca26b7d5cd7c3cd532462b5300e25bbdac9511
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
net_buf_frag_add() maintains proper refcount. We loose refcount by doing
this "buf->frags = new_data_frag".
Change-Id: I16f9b7f1dc36a8acbc1b6545c42288956cf9d535
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
This commit adds support for the Arduino 101 board with the
ENC28J60 Ethernet module.
Change-Id: Ib852e9cfb2b3b2188d3320e00d6bc24620e187f5
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
This commit adds the '+' operator that keeps symmetry with the line
below.
Change-Id: Icb2a5f22b5202597e3e0cc252436b422ce7b44a2
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
This is a sample app using ECJPAKE crypto algorithm on DTLS, using
mbedTLS, and native IP stack
Jira: ZEP-900
Jira: ZEP-943
Change-Id: Ica17b047aab11b989d3e8c8f6ac1b79e3041053a
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
For SLIP under QEMU, there is a choice between using TAP and TUN
interfaces, which have different frame formats. So, it makes sense that
we have different options for each, as they are incompatible.
Change-Id: I43f76391ccf3574da16741b314639427f5c1dd40
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Most applications will want to use randomly generated tokens, add a
helper for that.
Change-Id: If2a6b1d96596024afd2d2ce8e3632900adfe9c0f
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
This ports zoap to the native stack.
Just for reference, and totally not scientific, here are the numbers
using the old stack:
$ size outdir/qemu_x86/zephyr.elf
text data bss dec hex filename
34657 10316 16916 61889 f1c1 outdir/qemu_x86/zephyr.elf
With yaip:
$ size outdir/qemu_x86/zephyr.elf
text data bss dec hex filename
30575 9148 6164 45887 b33f outdir/qemu_x86/zephyr.elf
Jira: ZEP-818
Change-Id: I7992a3e2af7d419081ee5a64d7cc2d49fb628ead
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Extends the echo server and echo client samples to work with YAIP
network stack with ethernet L2 layer and ENC28J60 ethernet device
on Arduino 101 boards.
Jira: ZEP-859
Change-Id: I242e5555aff18741bf00a551424b081b5396f4b3
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
Add item for enabling samples with CONFIG_NET_L2_BLUETOOTH.
Change-Id: I2a51c197c2b1cf4a81edb189e86f645de754533b
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The "Unsupported Content-Format" error was missing from the list of
supported errors.
Change-Id: I208d79f8949838187b877eaa0a53597d8a5bc6cb
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
ll_reserve is given through each buffer to be sent, it is therefore easy
to get it from there.
Change-Id: I8b52fe1b72065f5f58275f939253942f7db1f136
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
No need to store the mtu locally as the network interface already holds
it.
Change-Id: I4a1c3d164eefa28622dcb6cd510a66a825c3d9fb
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Link Layer reserved space will be handled by relevant L2 layer.
Change-Id: I8e45119adb4de84ba321cad444c11bedef4415e8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
While testing SLIP driver, I found out that after some packets, the
ethernet L2 was getting the eth hdr pointer 14 bytes behind the proper
place. That's because at some point the slip driver got a buf which had
been used already, and thus had a ll_reserve value set from previous
usage. That's bad, so let's make sure ll_reserve is 0 when we take a
buffer. (Note that ll_reserve and reserver_head is much different at
this point).
Change-Id: If68d010775f1093cf087e164968751e3cd634fe3
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Or then the ip data pointer will still point at the beginning of the
packet, and not after ethernet header.
Change-Id: I24a621e0beb9ac43628eec6234ce7dd2dd939a3f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The underlying function 'net_nbuf_write_bytes()' was writing one byte
at a time, allowing it to handle multiple bytes at a time is a useful
adition, as it seems the common use case.
Change-Id: Ifa1a906d3ef135b9a48f50f9a9d86875696c5869
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Print an error message if the fragment list that we have
gotten from upper layers contains too short fragments.
In this case the issue is not in ethernet.c as it expects
to get full fragments.
Change-Id: I067b7a286a336ab8b7f955a4c3ec0084286eeb9c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
DHCPv4 client functionality removed as it is done.
Change-Id: I830f1b80911e0aa8006eabbd72f881bcb6182ead
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
When CONFIG_NET_ARP is disabled the 'setup_hdr' label is unused. To
avoid warnings during compilation, we can tell the compiler that that
label is unused intentionally.
Change-Id: Iaeed6831cb37cb534bdf23991ee57d4363f238a5
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Valid case:
1) If the offset is more than current fragment length, adjusts offset
from next relevant fragment and starts reading or skipping.
2) If the read or skip length is more than available data length,
then throw an error.
In case of an error, frag is 'NULL' pos is '0xffff'. Rest of the cases
are successful read and skip.
Change-Id: I88c4b85e14e5821f681966b5148ba9519b91cca4
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
If the received packet checksum is elided and checksum bit is set,
calculate UDP checksum locally.
Change-Id: I53e64d76313b5fad01d708edfc5922e7f7011dbc
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
The legacy stack has all the net_context API stuff in
net_socket.h so include it in net/net_context.h file.
This re-works the commit 627feb92d4 which added the
net_context_get_internal_connection() to net_context.h.
Now that function prototype is found in net_socket.h.
Change-Id: If22fa63357f4b2e9503f8c9850e69ffda39c61c7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit adds the DNS Client sample app on top of the new native
IP stack. This sample app supports IPv4 and IPv6. See README_IPv4 and
README_IPv6 files.
Origin: Original
Jira: ZEP-793
Jira: ZEP-855
Jira: ZEP-975
Change-Id: Id78bd634c44e216fd45b395c91d95b71ef68c976
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
This commit adds support the DNS client API on top of the new
native IP stack. Some features of this implementation are:
- Support for IPv4 and IPv6
- Support for multiple concurrent queries. A net_buf structure is
required per context. See the DNS_RESOLVER_ADDITIONAL_BUF_CTR
configuration variable
Origin: Original
Jira: ZEP-793
Jira: ZEP-855
Jira: ZEP-975
Change-Id: I351a636462a1b78a412c9bce1ef3cd0fa6223a52
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
This commit removes the legacy DNS client sample code.
This patch is part of a commit series that will add support for
DNS client services on top of the new native IP stack.
Jira: ZEP-793
Jira: ZEP-855
Jira: ZEP-975
Change-Id: Ieb3366b21a365b8f77e576109c64c0fc4218aabb
Signed-off-by: Flavio Santes <flavio.santes@intel.com>