We allocate a neighbor entry when neighbor solicitation is received
from peer.
Change-Id: I837262af1ccfba42d52075f32cb15f402b483f55
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Do not try to send invalid packet that does not have
link layer address set.
Change-Id: I48292fbd57841d069e00c57028b4be53eba4e732
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Install a timer that will drop pending packet if we have not
received NA in timely manner.
Change-Id: I32b133314603a9a1b52d304eb8631f5b174e26f5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Instead of macros use inline functions to access the data so
we can catch wrong pointer type kind of errors.
Change-Id: I281a4c902cd98e71b77d2f555b2edbe56ecceea3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The nbuf.h was not included by net_private.h
Change-Id: I51daf4fecded6347ffcc9cf2be44a6d94319220c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
When an ethernet frame is received, we pre-set the ll address
length. In this case the length of the ethernet mac address was
set too long.
Change-Id: I10d8c60da644558af33644309db51e294d7233d7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
No need to receive ethernet frames that are not meant for us.
Change-Id: Ib49fc12d11b365a99a26c65106d765e125375302
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The net_linkaddr_cmp() will compare two link layer addresses
and return true if they are the same.
Change-Id: I13f5ee9e7976a4118e891aefdb6e7c08f098c0b6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Meant to setup a real 802.15.4 device, changing channel, pan id, etc...
Change-Id: I221ad197aa221bc8f9ec67d0fd523da2023f7979
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Making sure we build cc2520 driver when native IP stack is used.
Change-Id: I25f3cb38a2da0c7a54ac4befcea217dc70b31028
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
It's basically a copy/paste of original driver,
using native IP stack API.
This is meant to avoid cluttering the original driver
code with #ifdef, and in future it will help removing
the old driver as well.
Change-Id: I67d974ad7440d258583a5c7c6c7160e99210808c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Another driver will be made for native IP stack. This is meant
to avoid cluttering the code with #ifdef all over the place.
Instead driver will be transparently selected at built time.
Change-Id: I283f1194fece9357425b87794b5cb51938ca80d3
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
- Parsing a proper ACK reply
- Generating a ACK reply from a data packet requesting it, and comparing
it to a proper one.
Change-Id: I1717fedc899eafa0aa849e1e253f02cd3dc3d4fc
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
If a data packet is received with AR flag set, it will reply
accordingly. This is meaningful when running the stack above hardware
that cannot reply automatically to ACK request.
Change-Id: I7e5be94c4a5b1c889adb67ceb6f44dadd36db3ce
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
First test is a unit test for frame parsing
Change-Id: I080d64a71fe4b6ff00e071a0cdee97ab9cd922d5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Overly Reduced Functionality Device, which is meant only for
testing as well as to mimic legacy stack's behavior. This is
not spec compliant!
Change-Id: I2f98092c85d538b9fbfcef0e812461a80b0d67d3
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This is the simplest - if not the dumbest - radio protocol we can use
for IEEE 802.15.4 stack. It just transmsits right away (with optional
retry) without taking care of doing any CCA (Clear Channel Assesment).
See IEEE 802.15.4 specification document, part 4.5.4.2
Change-Id: I341ad197aa221bc8f9ec67d0fd523da294a0351b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
It currently supports the basics for the Data MAC service. A radio
protocol is still necessary to send packets.
Change-Id: I78f974ad7440d258583a5c7c6c7160e904eb54f4
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This new radio API will be provided by 802.15.4 device drivers in order
to fit in the new IEEE 802.15.4 stack within native IP stack.
Change-Id: Ib28e8dd3f25e5c802284568b88c2ea6d5cf58f89
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Allocate the right amount of space for L2's context.
Change-Id: Ia2f4f4162334e9e9c26dc95230abdfde5986e052
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
One might need to find out the proper interface from a given struct
device pointer.
Change-Id: Id480d0a2bdf57f0b2d38379727ea1491dedf213e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
To track down the initialization of each interface.
Change-Id: Ia52aba0979689ab6ce24433853d1d87ecb693b3d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The dst_ip6 is a parameter, required for future 802.15.4 L2 layer.
At some point such parameter could be changed to a void pointer,
and a utility function would populate it depending on L2 layer,
if such parameter needs someday to be variable and complex (some
specific struct or else).
Also make sure we use ARG_UNUSED() relevantly, and using proper prefix
to functions.
Change-Id: I43297bb4fb48a8f1bb5075c216342db16261cbb8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The options length check was using fragment length to
verify the correctness of options. This is incorrect
as we need to check against the remaining length of the
packet after we have removed IPv6 and ICMPv6 header lengths.
Change-Id: Ied1b19e3f4b1a88409e81a1974ba5a4bdf022e72
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This is related to changes in commit 7dcbbc39e7
("build: move from srctree to ZEPHYR_BASE for app include paths")
Change-Id: Ie902ed66bb74188ed54aae44e2f4289f954ec351
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This is necessary when an external component tries to relate an address
to an actual neighbour.
Change-Id: Ic1b40032300e9fa06e029017098c16b6260c3a41
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Source link-layer address option might not be present, if the IP source
address is unspecified.
Change-Id: I1c9e89cce39588c6c8735e59cf894f6d278d52bb
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
CONFIG_NET_IPV6_ND enables ND packet processing, and we are thus
interested about the packet recv/sent/drop statistics.
Change-Id: Id281c924193bd2b1d71088bf40d47b1601daad5c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Current stack consumption as reported by analyzer
RX fiber stack real size 1200 unused 84 usage 1072/1156 (92 %)
so increase the stack to 1200 bytes.
Change-Id: Ibf2b27a6fb25cfb6be6d95e77c2e882526128a0a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the packet is not sent yet, then return NET_CONTINUE so that
the caller can avoid processing the packet yet. The packet might
not be sent yet if for example IPv6 ND is being done.
Change-Id: I242ffcafb3e68f63d9dca06367e075a143a7bbe6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Instead of swapping the ll address set the source and
destination addresses if they are not set.
Change-Id: Icdded06df2edb27f71894e29e9bc22a8f0313fae
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The IPv6 and ll address of the neighbor was not properly updated
and set in the neighbor cache. Symptoms were that packets were
discarded even thou the cache contained proper ll address.
Change-Id: I2acfb1b03d2eb69eddcf7ad5e25e8a7ce2ce3bb5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The L2 layer sender should actually set the link layer addresses
properly.
Change-Id: I9dd2f9ca269384dff0bef12e570317173f6a5f02
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Initial value for nbuf variables need to be set as they
might contain garbage from previous allocation.
Change-Id: I1d16e72387dbda86355ac01aabc1ba617bba0d50
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The packet sending function returns either NET_OK or NET_DROP
instead of <0 value. Make sure we check the value correctly.
Change-Id: Iab5b5c07ca548e9c2ccb31542a7633ecc0de2bc9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The send callback in net_context is called after packet has been
successfully sent or dropped. The callback is not called if the
packet is pending and waiting for example IPv6 ND to finish.
Change-Id: I28e77c6333974705a0e31862bb913eedace0b3f9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The send callback should be called after the packet has been
sent so setup things allowing that.
Change-Id: Icb82f9896667dcb1e400376c0fca6df380509090
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The token is used by net_context.c when sending packet. User
can set the token and get it back when data has been sent.
This can be used to know what specific packet was sent if
there are multiple packets going at the same time.
Change-Id: Iaaf730faaa55a712ae22d903e612e44deb683b8f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Additional checks to make sure the received IPv6 neighbor
solicitation, neighbor advertisement and router advertisement
messages are not corrupted.
Change-Id: Ic34a92eaac14dc9e2e6ed305fc7b2b6dcab9c29c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
In order to be consistent with naming, this commit renames
ip_protocol enum that is found in net_ip.h to net_ip_protocol.
Change-Id: Ie6caf059279b819794a13494468de789450e2bd8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Echo-server no longer reverses the data as doing it
when we have a fragment chain is quite challenging.
Change-Id: I298669f3ddba67000672320e7b3b14f72e9f12d4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>