- 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>
Invalid values were used when filling reserve, context and
network interface in nbuf private data area.
Change-Id: Id063fa3a415cd281d50148c10e7b838d56878894
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
We must use the link layer header length derived from the
actual interface when sending IPv6 neighbor solicitation msg.
Change-Id: I1836743ffed50254c89341fbdade039741e62f33
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If we do not know link layer address when sending ethernet frame,
then initiate IPv6 neighbor discovery process.
Change-Id: Id9c55646895a12ea3693cdca330e730bc80d83dc
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Resolve the ll address so that IPv6 packet can be sent.
This means that the IPv6 neighbor discovery needs to be done.
The original packet will be sent after neighbor advertisement
is received.
Change-Id: If54cdbd1468ca802f59e206996ea3addab16d5b8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Pending variable needs to be init so that we do not use
some old value when cache entry is reused.
Change-Id: Id6af61981d4fc7628992b4a018d84a4e5c8a16f6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The IP address was not printed properly when registering a handler.
Change-Id: Iadb02997a43f1440932d224e0113b6f45c4f0aed
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
No need to partition the data if MTU is large enough and
data can be sent in one frame.
Change-Id: I8ba0f5030ed1e2c1341c7e2dd409ba636b1a9a4c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
When allocating net_buf via a net_context, set the network
interface and protocol family to net_nbuf.
Change-Id: I0df876e0c8ba66bac42f3aa7fd17c5bf9a935985
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The sending functions net_context_send() and net_context_sendto()
will need to send data.
Change-Id: I5372cb9dede2a996276c30241f28689c4f902dff
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This API provides similar kind of functionality as BSD socket
API. This API does not provide BSD socket API.
Change-Id: I537d0ad2a5213f1d1e11fa7891dd4f4d0f3cc4bb
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The earlier default 1 was too low, a more usable 2 is now
the default. User can set the limit to 1 if needed.
Change-Id: Ib30a1ceb95c42f69197298f672daaeab6b41890b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
When a UDP packet has been received and if a watcher match
is found, then a callback is called. It is useful to have
a pointer to net_conn when calling the callback.
Change-Id: Ifa97b37c22b1fc9cac7eadfba23aa68dfd473fda
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>