The given buffer might have an ll part already filled in, so handling
its content if any.
Also reordering the local variable declaration according to Zephyr's
style.
Change-Id: Iaf9c117d39c90d5f71ca3aad02a52ea9d9b34223
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Fixing as well minor Kconfig issues related to IEEE 802.15.4
fragmentation.
Change-Id: I4edd3db4501563a473b7cdf15da8262b8443c0ac
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
For consistency as well as for helping when grepping etc.
Change-Id: Ib5e6b3369e510dd2b996f735d801c2b80291ad7f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
If compression header watermark is not found, it will successfully
return as it's not an error. It just means there is not uncompression
work to do.
Using NET_ASSERT() to check the argument validity as well.
Change-Id: I907f3f197d59d7ddb546860d232d6ca20a4445e3
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
net_core.h is loading sys_log.h as well, so we need to be
first in order to setup some local definitions.
Change-Id: Ife482bd21e314aa5a5e88433eb8f9a560f9d53a6
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
No need to control the state of this routine, as this
will be ran only once.
Change-Id: I2f9f04012d793787ba56ef6403f8a92e8e1b073e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This is only meant for the new IP stack.
Change-Id: I643b0556f87423f09555274749db93397ef66c59
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Reassembly IEEE 802.15.4 fragments as per it's datagram size
and datagram tag. Uncompress IP header fragment as soon as it
arrives. Size matches only after uncompression of IP header with
total length.
Support added for multiple IP packet reception. Default is one full
IP packet at a time. Cache size can be modified via Kconfig option
(NET_L2_IEEE802154_FRAGMENT_REASS_CACHE_SIZE).
Note: If you increase the size by 1 means, you should have N number
of data buffers available at max.
e.g. One full IP packet (1280 MTU) needs 15~16 data fragments means,
multiply size by same number of fragments. It requires more memory.
Offset based reassembly yet to be done (fragments can come in any order
[e.g. mesh]). Now assuming that fragments are in right order.
Change-Id: I17baee30a1087eb9ec6dc25f03ed64bbe0df2917
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
If IPv6 packet exceeds IEEE 8021.15.4 payload, it should be
fragmented as per RFC 4944 and RFC 6282.
Change-Id: Ic02c3089a510a8f6ffe3c3cd4537284a06ac1453
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Add support for IPv6 header dispatch (without IPv6 compression
and uncompression). Only IPv6 dispatch header will be added at the
beginning of the buffer.
Change-Id: I7400a4dd115ac3b4b3d9deecd3cdb9ea292573fb
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
6lowpan compression and uncompression done on original
input buffer. So no need to return paramter as net_buf *.
If the compression or uncompression fails, unref the buffer
as it cannot be used further.
Change-Id: I64f496e22b2008a91a358fff65de1b87659cd9eb
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
UDP length was wrongly set and test count was hardcoded.
Change-Id: Iade959e1b8c3580b43aa2a9ff1fc10eb5a462f2f
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
The neighbor index only works when indexed over neighbor pool
as that takes into account the additional data that is embedded
after the net_nbr struct.
Change-Id: I3a5b971beccb24735e75dd87bfefc75bebba30dc
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The code tried to access the neighbor via index but this does
not work as there is embedded data after the net_nbr struct.
Change-Id: I3efe325266ac244d82f2c713ed5530eeb0e6a363
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the received IPv6 router advertisement contains prefix
address options, set the validity of the prefix and expire
them when needed.
Change-Id: I7026d2101bd9eca1f90688c14d5c6aaa66e4af5e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
We need to use target address when checking whether
the IPv6 neighbor cache as the destination address is
typically a multicast address and it will never be in
the neighbor cache.
Change-Id: I13ba90e164393a7ab92bcb388a9d1d83f849fd4b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If there is no pending data when IPv6 neighbor advertisement
is received, then do not try to use NULL pointer and send
bogus data.
Change-Id: I3225e0ffbfdfcd6f2cb3789af0b3a7158ffca24d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
IPv6 neighbor discovery reachability timer support
was missing.
Change-Id: I54e934b65abe2e99b11762ad29f43b69a8a97754
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add utility function that cleanups the neighbor cache.
Change-Id: I77363566469c4f9d0410c08b5a3009bbe8d1b96e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
As we know the network interface, use it when creating
initial entry in neighbor cache.
Change-Id: Ife022ffbdf0e8fb84253091b4072aebcee026e34
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
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>