If we want to receive packets to multiple addresses, the solution is to
listen on the ANY address, and add the address to the interface in
question (already done).
Change-Id: I383cc1401f1236ee05bdb010252a9f9909aa15bd
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Before using the LED we must set the direction of the GPIO pin to
output, and the LED will turn on when that GPIO pin is 'low'. So, for
our purposes, the LED is active low.
Change-Id: If8e6ce05ff2f3ddb7b17a87b172a91f7276194a4
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
'board.h' includes the definition of LED0_GPIO_PORT and LED0_GPIO_PIN,
without this include the fallback was used, as if the board in question
didn't have any LEDs.
Change-Id: I78ebdb2e2ffc41dff5011dcf9e33e09d70950e81
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
This adds a configuration profile allowing this example to run on a
Quark SE C1000 devboard.
Change-Id: Ic04fd30a91ed0a1fc8c3a3b3a6e397f0722f50b1
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
The original version can fail in ARM like this
***** USAGE FAULT *****
Executing thread ID (thread): 0x200027a8
Faulting instruction address: 0x00008080
Unaligned memory access
Fatal fault in thread 0x200027a8! Aborting.
so use UNALIGNED_PUT() and UNALIGNED_GET() instead.
This failure was seen when IPv6 address was
copied to neighbor cache in ipv6.c:nbr_new().
Change-Id: I638424b9a95c451e13314ca9182c39ab8aa71830
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If CONFIG_INIT_STACKS is not enabled but CONFIG_NET_SHELL is,
then net_analyze_stack_get_values() was not properly compiled
out which caused unknown function call.
Change-Id: I18de5ec0b5d6ab7876e801c83b82c9dd5bf22093
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This no longer apply as there is no longer a extra reference needed.
Change-Id: I84f50da7e15f31722cd99b906f9dd987a10ce2dd
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
If NET_DEBUG is enabled within tcp.c, all state transitions are checked
against the TCP state machine specification. If an invalid state
transition is found, a debugging message is printed.
Change-Id: I8fe521a74da6c57e8aeee32e99b25c3d350fd4b0
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
The whole function is only built if TCP is also built.
Change-Id: I0ed71273fa8db52b3e4c18d4b7b1766593f15f5a
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
This sends FIN|ACK in one single segment instead of two while closing
a connection.
Change-Id: I80ff3da74deab2caffb69777438a0d13f75b4b32
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
The sanity checker should check for these as well eventually.
Change-Id: Ia22c8d0e000ee315ee2f582caa5a6b0c721e8b5f
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Nbuf data size needs to be set to 128 bytes, specifically for wpan
sample.
Debug output kills timing, and thus can generate spurious failures on
reception, so limiting it to errors by default.
Change-Id: Ia0b8c904e0bc66a7922af4f317db623db6c51462
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Hack in commit-id 835f93b8250abc0f3edbee9a99463fccac03597c was breaking
raw mode needed for wpan* adaptations.
Change-Id: If1ff96fa8170cc84e356fb0452e487f0ff174da5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
packet_received() does most of our work here already. The appdata
needs to be filled in correctly for TCP packets, which needed the
header size computation to be abstracted out of the ACK code.
Change-Id: Ifeb87c8ddcaa6f4b116214a3b3fb737ab03286f1
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
More protocols are incoming. Put the UDP specific stuff (address
wrangling and connection creation) in a separate function, leaving the
synchronous handling in place for other protocols to use.
No behavior changes.
Change-Id: I67fd9f683314ca9b2e671b84c46b9392db9496b2
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
I believe the original intention was to have code similar to:
buf = net_ipv6_create(...)
buf = net_udp_append(...)
buf = net_tcp_append(...)
buf = net_ipv6_finalize(...)
However, each protocol has different ways of creating packets and
checking invariants. Thus, the code now does something similar to:
if (proto == UDP) {
// original UDP code
} else if (proto == TCP) {
// TCP code, which creates the IP header as well
} else {
// unknown protocol
}
Which negates the need of such check in net_udp_append().
Change-Id: I7f05b7d556462b0db35aaecdf060539f8c246e8c
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
The call would eventually return -EDESTADDRREQ, however -ENOTCONN is
the sane error value in this case.
Change-Id: I6c24bf9bf2ecc4bff6a615567547390e6f5b7d77
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
This adds the required code to echo server so that it works with TCP as
well.
Change-Id: Ib45dd91a52a60ddb4d8f0ae11175ceb52199c398
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Adds support to send TCP packets using net_context_send() and
net_context_sendto() functions.
There's one behavior change: net_udp_append() will only append UDP
headers+payload if the context protocol matches. This would allow
sending only IP packets from Zephyr. Proper support for raw packets
should be added later if required, so the new behavior is to return
-EPROTONOSUPPORT if trying to send a packet through an
-unknown/unsupported protocol.
Note that sending packets outbound from Zephyr is still WIP; this is
just a step in the general direction of making it work.
Change-Id: Idcf26ad3820e85f1495e7029aed94f3b7abf25ed
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Both functions perform the same logic, except that the sendto() variant
expects two more parameters to specify the destination address.
Just obtain that from the context in the send() case and forward the
information to the sendto() variant.
Reduces code slightly, while also making it easier to add more
protocols later.
Change-Id: I48da621d8788d5ba2cddaf2982324d3e896c13c3
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
To avoid the risk of overflowing when dealing with retransmission
timeouts, increase the size of their representation to 32-bits.
Change-Id: I7c9c1e00c41f5ba75e19b0fd4527f273852eb85f
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
When debugging is enabled, compilation fails with an error, similar to
this:
... net/yaip/net_mgmt.c:155:35:
error: 'struct k_sem' has no member named 'sem'
k_sem_count_get(&network_event.sem));
^
As 'network_event' is a k_sem, there is no '.sem' field.
Change-Id: I09fb46ec02b62c30b9a12972abcaea8a36b84610
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Including shell allows to execute some kernel commands and make sure
system is not crashed.
Change-Id: I6157229614655dc7e523f1cf0f84ee7c58d7a717
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Current reassembly of 802.15.4 packets works only if fragments are
in correct order. But as per RFC 6282 reassembly should be based on
offset parameter in fragmentation header.
Change-Id: Icdcb10b9aa8f5837063b0201a64f8eb050c75681
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
This is a hack, related to:
commit-id 835f93b8250abc0f3edbee9a99463fccac03597c
Change-Id: I7e305cef9ca908e2a71a011920663e1603ad8d6e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Fragments reassembly was never used in l2.
Change-Id: Ia06ccbcd591ff79c43915e81c0b273533c607aa6
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Current value is not enough anymore it seems. (depends however, if some
debug output is enabled or not).
Would be much better if the build system could automatically compute
such size.
Change-Id: I9052616a7923e484664e4f5c7760e6a6e1152c63
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
There were different tags defined in testcase.ini files for
networking tests. Unify these and change the tag to "net"
in all networking tests. This makes it easy to execute
all network tests via sanitycheck.
Change-Id: I8ce7ccf8cccca35234602e37f6568db0b986d181
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
There is something wrong with Arduino 101 ARC compiler.
Sanitycheck runs ethernet tests for this board basically using
this command:
cd tests/drivers/build_all
make pristine && make CONF_FILE=ethernet.conf BOARD=arduino_101_sss
Which then gives following warning
warning: missing braces around initializer [-Wmissing-braces]
which is then converted to error in sanitycheck.
Change-Id: I822c599cb172825a79b5b8e4a71cb9252757a435
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The net_buf tests were including net_ip.h which requires some
extra config options to be usable when the new native IP stack
is used. In order to avoid this dependency, define struct in6_addr
locally in the source file.
Change-Id: Iafe0d2b5b507665baaed23f5e2c55a9d9a300d47
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The 802.15.4 frame has a header and in the end after the payload a CRC.
Overall MTU is 127 bytes, but CRC is most likely going to be generated
by the device itself (offloading). Because the limitation of current
nbuf, it's not possible to keep this CRC in the buffer because it
require a user data size of 127 bytes but if we do so, IP stack will
fill in as much as it can as packet data, thus occupying the 2 last
bytes. This generates bugs. A perfect solution would be to generalize a
better handling of MTU and head or tail reserve data into nbuf, but
this will probably be solved in the future.
Change-Id: I1a0fee4d555e2717c1edd5afba399a1f17d9c7a9
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
User is able to send ICMPv4 Echo Request to destination
address.
Change-Id: Ie32d5970e5f3e75e925c283947f97e096e509555
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the destination IP address is loopback, then bypass
the L2 layer and directly feed the IP packet back to us.
If the destination IP address is unspecified, then
drop the packet.
All this is only done if CONFIG_NET_IP_ADDR_CHECK is
set as this extra processing can be unnecessary if
it is always known what addresses the device is going
to use. By default the address checking is enabled.
Change-Id: I323cce97a72533c75b0424870f08729479024ebf
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Create utility functions to create IPv4 packet if the
network context is not known.
Change-Id: I982830d09f3b91e23b75e6b63a5d97bfea0e8d4e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>