When a connection is being established, the ack sequence number in the
SYN+ACK segment must be the sequence number from the SYN packet + 1.
Change-Id: I91df986f1f1b7cf8eaff0171921ab4c8cf1ddf93
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
The fragment count value was incorrectly printed. All
the values > 9 had their last digit chopped off.
Change-Id: I8304b8047baa97995c3927809e4616653c87928b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This change is related to patch called
"net: Adapt to new behavior of net_buf_frag_add"
This version removes extra net_nbuf_unref() from
the code. The unref was done because net_buf_frag_del()
did not remove the double ref from the list element.
Because of the other patch, the list does not have
double ref any more, so we need to remove the extra
unref in couple of extra places.
Change-Id: If90e01c24b9b4e68afbfa283850d2a1ecb3065ed
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
net_buf_frag_add takes the ownership of the reference passed to it so it
is no longer needed to unref when deleting fragments.
Change-Id: I73f44ba313819a176b6a64b7644c80a83d86000e
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Earlier test results was updated as soon as test server ACK client
dhcpv4 request. But update results on IPv4 address add event on
interface.
Change-Id: I212309a4d1d2eae88f73470e00754db1d6fecda5
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Change definition name suffix to WPANUSB
Change-Id: I3456ebff061866a67b7a07b33f6ff83a31a2d7a8
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
It should go to LISTEN state as soon as possible, to service another
connection. The client connection, though, should be in the
ESTABLISHED state.
Change-Id: I98708e67bd969f09b84e60ac2fecc284bf82a79f
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
When an incoming TCP connection is accepted, a net_context for the
client is allocated. However, some steps prior to calling the
user-defined accept callback can fail, without freeing the
newly-allocated client context.
Change-Id: I94ed03d2f3b69eb3edd23c990da5842fa4605a29
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Only TCP sockets are supported by net_context_listen(), so check if the
socket family is TCP rather than UDP in order to return success or
error.
Change-Id: I2ab5e9985d448811da2e1414d3ecafd9b3b3e475
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
This keeps the semantics of the low-level network stack API closer to
the BSD sockets API. Prior to this change, listen() primitive was a
no-op, and accept() would change the connection state to LISTEN; this
changes the functions so that calling listen() is required before
calling accept().
Change-Id: Icd89eb8d76439d63339fc99277d5d3dad66fa5f5
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Instead of defining the poorly-named a2u32() and a2u16() functions
inside tcp.c, use macros provided in <misc/byteorder.h> to obtain
unsigned 32- and 16-bit values instead.
Change-Id: I344fe0e495c574cb8cc717036154221e912b4406
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Adjust the DHCPv4 client configuration wording to distinguish the
option that enables dhcpv4 client from the option that enables its
debug. Provide help text for the latter.
Change-Id: Iadb115bc93f56e7dd3f1c0824f57a9cfc4453e75
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
Adjust the workding of NET_DBG() diagnostic to emphasize that the
contents of a received dhcpv4 message where not expected, rather than
incorrect.
Change-Id: Iee29e1b93c6a4876effa2e968bf77d9a0ada4ff0
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
Add a NET_INFO diagnostic to output the allocated IP address.
Change-Id: If6854467cfddc5b3fbe18f48d4639e6ff0c84fff
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
Add NET_DBG() output itemizing the parsed context of a dhcp request.
Change-Id: Ic4b2586314aa749d46c25a02d512057a3372e975
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
RFC2131 requires that a client must choose XIDs in order to minimize
the chance of collision with another client. Selection of a random
XID at boot is a valid approach. Adjust the XID representation from
array of bytes to the more convenient uint32_t representation,
initialize the XID to a random number and increment for each request.
Refactor the dhcp test case to generate response messages with the XID
from the received message.
Change-Id: I93f180e6aa02430f807e0a97186577dc956fb653
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
net_l2 is the proper name, looked by sanitycheck.
Change-Id: I08548865df21a57c8198fe0a801aa8c2a81b7fb0
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The test "Test block sized transfer" does not work with
new IP stack so disable it temporarily for new stack.
This needs to be fixed later.
Change-Id: Ie89dd101270ab9b8a9b056757de79cd3da009180
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add support for inserting data into an arbitrary location in fragment.
Change-Id: Iaecdc4e980a73e0f66c208315d342e05762cd6f5
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Add support for nbuf write to an arbitrary location in fragment.
Change-Id: I686c6d86feb8545603edd7c7a9ef6fde1c909a72
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
net_l2_init sections used to exist in early stage of the native IP stack
but got removed since.
Change-Id: I189d6e6f7aa05a6e5a62a28973c714d0367b0c5a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit updates the README files to reflect that ZEP-1036
is already solved.
Information about ZEP-1097 and ZEP-1098 is now included.
Change-Id: I3c83160962d308d374823e086bbf083dca988606
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
This commit modifies the conf and Makefile files of the DNS client
application.
Inside the Makefile, the CONF_FILE variable is updated to include
the BOARD name, therefore prj_'board_name'.conf is used from now on
to refer to the conf file. The right conf file is selected by passing
BOARD='board_name' to make.
Configuration variables at the conf files are also homogenized.
Change-Id: I6f5aaad0b52d458bceb90b315aba2b31f085c0a0
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
A bunch of if's are a poor substitute for straightforward interval
checking. You just have to be careful about the sign.
Also the seq_equal() routine was unused.
Change-Id: Id3a627ff75c8ab9889f226c733faa3fcb38207a7
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
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>