Port the zperf network performance tool to native IP stack.
TCP support is missing from this version.
Change-Id: I2648e7d81014bb0cae8cf50854b0ae5f89a6567c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
We must not set destination link layer address when generating
ICMPv6 Echo-Reply message. The reason is that the address must
come from neighbor cache right before the reply is sent to the
network.
Jira: ZEP-1360
Change-Id: I32a23f5689107b6827728cce67a5d27fa964ebd2
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If we cannot send a network packet, do not quit as that is
really not necessary here.
Change-Id: I7613d46bdbc849b75aaf0fc71c58beba810fd658
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
As the default board is qemu_x86, make sure there is similarly
named config file that can be used by default.
Change-Id: Ibc480d3b4eecc2601e3670c8da19be9c01833c36
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Use by default a board specific config files for both
echo-server and echo-client sample applications.
This makes more sense than using the network technology specific
config file that was used earlier.
Change-Id: I155fc138f4b0ed1166f4e25267513afc3fb6fd76
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Remove legacy stack artifacts from the echo-server and echo-client
config files.
Change-Id: Icc591b9540495c4ee181517369b0df9bb91972bb
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Removed already done items related to IPv6, 6LoWPAN, user space
protocols and documentation from the TODO file.
Change-Id: I0d864675c544ae69ad3ef351c0d42680a6a0b4e6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Check that we change the ll address in neighbor cache
properly when receiving NA.
Change-Id: Ib0373751abebdfe1c5e83fd38ec91b9587797e32
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Peer address is used when sending NS so that it is added
properly to neighbor cache.
Change-Id: I51c2e236a0b137f7ab086a782f3baced13aa3ee3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Also disable prefix lifetime overflow test as it does not work
properly.
Change-Id: I54c8716f6a6d4f5bec76b0a61fe0e18e983924f4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The value is useful debugging information.
Change-Id: I8b0b378299644edb9d887fa3248b3cd821360526
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This is needed so that we can call it from module test
application.
Change-Id: I1e92d1a62af1db823e4f89f30783c94fd7edf324
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Interface pointer was not given in parameter list which
caused garbage to be printed.
Change-Id: If6c4487bb21e0639d5ada283b9e478e5417f18a0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If we are suppose to send an IPv4 buffer that does not have
ethernet header, then add it here so that the packet can
be sent properly.
Change-Id: If873bd299d7f2d6762a6e593ef69043a9190e976
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The cc2520 driver RX thread did not like the stack information
collection macros defined in net_core.h. Both the cc2520 TX and
RX got the same variable name which did not compile.
This is now changed so that the first parameter is added to
the variable name to create a unique variable.
Change-Id: Ia41d01a71afd73af2ef31aa5f7a890a3cf0385aa
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If we receive extension 59 (No Next Header), then drop the
packet as we do not support forwarding atm.
Change-Id: I8b1a2a3748f2e88dbf47eb24b732f5edfb9c006c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the fragment size is different than the value in IP
header, then drop the packet as there is clearly something
wrong in L2 layer. The fragment size must match the value in
protocol headers.
Change-Id: Ibfdb0ab37b3cd4e81e6e03c36beb1e0abfa8c00d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Same IPv4 address can only be added once to the network interface.
Change-Id: I5fb545dd07c11f0e4ed358759ea39afd1334606f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Same IPv6 prefix can only be added once to the network interface.
Change-Id: Ib972bb76cf2589d0c873023d1dc2ad49f9b5cf25
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Same IPv6 address can only be added once to the network interface.
Change-Id: Iabc02ffb4026bdccc46e5b2e7ffee82b3c0a59ea
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
It is expected that the caller of the net_send_data() function
will release the net_buf or do whatever it wants with it if
there is an error while sending the net_buf.
Change-Id: Id9ddeed3da8b5091c0a8b9d72377f9d12fa76b59
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This enables application debugging using qemu target:
export QEMU_EXTRA_FLAGS="-s -S"
make qemu
Was tested with echo_server
Change-Id: I1906dea2fbc5afe03b11729d2edb8f3629a629f8
Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
As the native IP stack is now the default, there is no need
for corresponding Kconfig option.
Change-Id: I08e4992f540f928a2b7378e8803e634e38725348
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit removes the old MQTT and NATS publisher and subscriber
applications that were based on the uIP stack.
Change-Id: I7ba8e155e32ba0aa53c8dec1b6c0cc5170d70943
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
This commit removes the legacy Contiki based uIP stack.
The new native IP stack must be used after this commit.
The commit also removes following things:
- legacy cc2520 driver
- legacy ethernet drivers
- legacy IP stack samples
and changes these things:
- disabled tests that only work for legacy IP stack
- select new IP stack by default
- enable random number generator by default as it is needed
by the new IP stack
Change-Id: I1229f9960a4c6654e9ccc6dac14a7efb9394e45d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The default kernel init priority is too low. Make this
configurable and set the default priority so that the
ethernet driver is started just before the network stack.
This commit adds generic ethernet priority and changes
currently available ethernet drivers to use it.
Change-Id: If695e52b6dd9ea227f10ba306bb145d72d2312b0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
We tried to use the received Echo-Request buffer to send
the Echo-Reply. This did not work that well as then the
source link layer address was set to be the same as
destination address by the lower level L2 driver.
Jira: ZEP-1350
Change-Id: I0e7c06866d5b863f091e1d5c2a79dfcc2f23df20
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Refactor code to exit earlier in case of error.
Change-Id: I9ff893f923ff877d69b0e985bb6e4159504e67cd
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
The "net conn" net-shell command will print information
about currently active TCP connections.
Change-Id: I6ef67887997553f4bfad14bcfd4fcde0e062a77b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This is to be used in net-shell to view currently active
TCP connections.
Change-Id: I9c2a69e3ab6013835a42dfde47d580623998b3fa
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The "net conn" net-shell command will print out currently
active network contexts (sockets).
Change-Id: Iaf3ced1a4b7ab10291c0b87eecd9e9bedb486e06
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The address family of local endpoint address was not
set in net_context. This caused wierd issues as the
address family was always AF_UNSPEC.
Change-Id: Ibd05f9af86a8bdea3399ad20e3b84bd7d43a6415
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This is to be used in net-shell to view currently
available network connections.
Change-Id: Iadb6555ed6db4e8fb0639e6d0dcf1eccd970acca
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If IP stack offloading is enabled, then call corresponding
L2 driver when corresponding net_context API function is
called. The L2 driver can then do its magic to send/recv
IP packet or do what ever with it.
Change-Id: I26695cee6feb80a41923db0165f22d94477333be
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
For dual IPv6 and IPv4 stack, the limit of network connections needs
to be increased as the default value of 4 is too small in this case.
Change-Id: If031ae9ee1dd095d20ee6a677ef8c678055ecfb0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Return -ESHUTDOWN when this flag is set.
Change-Id: Ia2f5d8890b70652c1c348f25d4879248540ac66e
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
This code is inspired by a similar feature found in ccan[1],
that enforces that the parameter passed to ARRAY_SIZE() is
always an array and not a generic pointer. This is a slightly modified
version that will work if the macro is expanded outside of a function
body.
The check is performed by comparing if typeof(array) and
typeof(&array[0]) are of a different type. Due to the way arrays
decays to pointers in C, if one passes a pointer, the types won't be
compatible and a compile time assertion will fail.
No bugs have been found with this change, but since there's no runtime
or size overheads, there's no reason to not enable it.
[1] https://github.com/rustyrussell/ccan/blob/master/ccan/array_size/\
array_size.h
Change-Id: I6c321714d0024298e593176be43b2d0b5362cc0d
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
When preparing a non-data segment, the FIN flag was not set in the sent
segment. Do it now.
Also, set NET_TCP_IS_SHUTDOWN when transitioning to this state. This
flag isn't currently used beyond sending data segments, but will be
checked before the application tries to send data, or when data is
received from the network.
Change-Id: I6fb4f8fc7aa2a433522075d49307e8615ec6f2c7
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
This cleans up some code, and fixes some wrong assertions. For
instance, the following code was present in net_context_bind():
NET_ASSERT(context >= &context[0] || \
context <= &context[NET_MAX_CONTEXT]);
The intention was to see if the context (which is a pointer to a
net_context struct) was part of the "contexts" array, but instead did
something else entirely.
Change-Id: Iae8161990987ec0c3632ee493ff9248e789683dc
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
This macro does two things: first, it validates that the pointer is not
NULL. Second, it validates if it's between the first and the last
element in the array.
This is useful for cases where a pool of structures are used, such as
in the network subsystem.
Change-Id: I9d815936e31d87a3b3ff80466eea97bc4ad954b5
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
The original commit:
https://gerrit.zephyrproject.org/r/#/c/6256/
has changed because an internal rebase. Two lines adding an SPI
command are missing.
This commit adds back the missing lines.
Change-Id: I5cbeda73ef1eae5eb98dfa3b7f3086b7438da9a9
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
My IPv4 address was missing because of complex set of #ifdef's.
Change-Id: I6768587d3e104a57c10756bc43267f26068aa3cb
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
We need to have a menuconfig for setting up networking
sample application IP address. This way we can properly
use strtol() which is only available if the
CONFIG_MINIMAL_LIBC_EXTENDED is selected.
Change-Id: I749ea444584b3e15d4a6fee9cd9065aba22a7278
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The net_tcp_release() function was checking if the passed pointer to a
net_tcp struct was valid by checking if the pointer was within the
range of the tcp_context array.
However, the check was inverted, and the function was returning -EINVAL
every time a pointer to any element of the tcp_context array was
passed.
Because of this, TCP connections were never properly disposed, TCP
context were most likely left in either active or passive close states,
and new connections could never be established again.
Change-Id: I2ed368157349f0ca5641f7d15a555c0035e1a9e2
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>