Now that legacy net_pkt_pull function has been removed, the new
function can be renamed accordingly.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Now that the stack uses the new API from net_pkt for pulling, no need
to keep the legacy one around.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Now that legacy net_pkt_clone function has been removed, the new
function can be renamed accordingly.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Now that the stack uses the new API from net_pkt for copying, no need
to keep the legacy one around.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Now that legacy net_pkt_clone function has been removed, the new
function can be renamed accordingly.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Now that the stack uses the new API from net_pkt for cloning, no need to
keep the legacy one around.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
net_pkt_clone_new() sets the same attributes of the original packet to
the cloned one.
Fixes#13147
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
There is no need for appdata pointer: net_pkt's cursor is already at the
right position, i.e. the beginning of the payload right after all IP/TCP
headers.
Also, when reading the actual data, let's use net_pkt_read_new()
relevantly instead of going through the buffer by ourselves.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
There is no need for appdata pointer: net_pkt's cursor is already at the
right position, i.e. the beginning of the payload right after all IP/UDP
headers.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
It will return the amount of data to be read from current cursor
position. This will prove to be useful to remove appdatalen attribute.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
It is now useless as the only function using it
(net_pkt_set_appdata_values) got removed.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Let's not call net_pkt_set_appdata_values() which will be more costly
since it will need to parse all over again the packet to grab the tcp
header. Instead, let's use the tcp header pointer we have already and
set the appdata attributes directly.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Though unused anywhere, this function seems to have some usage while
debugging.
Let's rename it to a more semantically relevant name.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
And remove the parameter "full" as there is no "ll reserve" distinction
anymore. The parameter was unused since the ll reserve concept removal.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
It not used anymore. If one wants to do the same check, it will require
to place the net_pkt cursor at the relevant position and use
net_pkt_is_contiguous(pkt, sizeof(struct net_udp_hdr))
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
It is now useless and can be replaced by net_udp_get_hdr() directly, in
the 2 unit tests it was used.
Removing as well the dbg function too_short_msg()
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Let's use the new API for these 2 functions. Note that in some places,
using these functions is under-optimized (like in llmnr-responder in
dns: it gets the ip/udp headers already from the recv callback. That
will need to be taken care of later).
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
net_pkt_tcp_data was only used in tcp unit test and could be replaced by
local net_tcp_get_hdr.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
net_ipv6_finalize() can take care of this, if net_pkt's ipv6_next_hdr
attribute is set to the right one, as well as ipv6_ext_len one.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Legacy net_pkt allocator was not setting default value for IPv6
next header. And new net_pkt allocator was not setting default value
for TX traffic class and virtual LAN tag.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
It is now unused anywhere: former net_pkt_get_src/dst_addr where the
only one using it and that has been changed since.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This function is only used in sockets, thus making it a private function
of socket library and renaming it relevantly.
Note that sockets should be reviewed at some point to avoid using such
function: zsock_received_cb() already get the ip header and the protocol
header, so it could grab the src addr/port from there. It would be way
more optimized to do so, since net_pkt_get_src_addr is costly as it
parses all over again the ip/protocol headers.
utils unit test is updated and the test of the former
net_pkt_get_src_addr/net_pkt_get_dst_addr are removed.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Make kconfigfunctions.py agnostic to where GENERATED_DTS_BOARD_CONF is
located.
We don't want to encode the path of GENERATED_DTS_BOARD_CONF into more
places than necessary. Also, re-using GENERATED_DTS_BOARD_CONF makes
it easier to change where generated_dts_board.conf is located.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
kconfigfunctions.py will silently set all values to '0' when the
environment variable 'PROJECT_BINARY_DIR' is not set.
But PROJECT_BINARY_DIR not being set indicates an internal error, so
we should instead error out with an appropriate error message.
Silently failing is dangerous and increases debug time. It is better
to fail fast.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Add nvs support to nucleo_f091rc board. This requires to
add erase-block-size property to stm32f0.dtsi.
Storage partition is set to 4kb at the end of the flash.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
In order to enable build of stm32f7 flash driver in sanitytests,
add nucleo_f746zg to flash_shell platform whitelist.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>