No functionality changes, just doxygen additions and some
things are hidden from document generation.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The extra check for CONFIG_NET_OFFLOAD is not needed as it
prevents documentation generation for this API.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
In order to follow the naming from Linux, change the name of
can_msg to zcan_frame, and can_msg_filter to zcan_filter.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The UDP API functions are for Zephyr internal use only so do
not generate documentation for them.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add short overview for DHCPv4. Do not add dhcpv4 library internal
state in the documentation.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This function is the opposite of getaddrinfo(), i.e. converts
struct sockaddr into a textual address. Normally (or more
specifically, based on the flags) it would perform reverse DNS
lookup, but current implementation implements only subset of
functionality, by converting to numeric textual address.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Following convention, all functions of sockets API have zsock_
prefix, then optionally aliased to bare POSIX names.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
In order to follow the BSD socket numbering of the network
interfaces, start numbering from 1. The index 0 is reserved
to mean any interface in BSD socket code.
Fixes#13084
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The doxygen documents must be placed before the symbol in order
them to be shown in the generated documentation.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Make sure that network related functions are always documented.
This means keeping the prototype and possible stub together.
Fixes#12615
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
There are issues using lowercase min and max macros when compiling a C++
application with a third-party toolchain such as GNU ARM Embedded when
using some STL headers i.e. <chrono>.
This is because there are actual C++ functions called min and max
defined in some of the STL headers and these macros interfere with them.
By changing the macros to UPPERCASE, which is consistent with almost all
other pre-processor macros this naming conflict is avoided.
All files that use these macros have been updated.
Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
shutdown() itself is described as just marking RX or TX path of a
socket as not available. For the first approximation, we implement
it just as a dummy function, to allow build existing POSIX
applications which use it.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Initial implementation of IPSO Timer object #3340
Based on: http://www.openmobilealliance.org/tech/profiles/lwm2m/3340.xml
"This IPSO object is used to time events and actions, using patterns
common to industrial timers. A POST to the trigger resource or On/Off
input state change starts the timing operation, and the timer
remaining time shows zero when the operation is complete. The
patterns supported are One-Shot (mode 1), On-Time or Interval
(mode 2), Time delay on pick-up or TDPU (tmode 3), and Time Delay
on Drop-Out or TDDO (mode 4). Mode 0 disables the timer, so the output
follows the input with no delay. A counter is provided to count
occurrences of the timer output changing from 0 to 1. Writing a value
of zero resets the counter. The Digital Input State resource reports
the state of the timer output."
NOTE: Only One-Shot Mode (mode 1) is implemented in this patch.
Signed-off-by: Michael Scott <mike@foundries.io>
During the initial work on LwM2M, the float32/64 code was
basically stubbed out. Float32 sent only whole values and
float64 was completely broken.
Let's clean up the OMA TLV formatting code by moving the float
processing code into a separate file: lwm2m_util.c.
Then using public definitions for binary32 and binary64, let's
fix the processing code to correctly fill the float32_value_t
and float64_value_t types.
Signed-off-by: Michael Scott <mike@foundries.io>
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>
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 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>
pkt->buffer is represented by 1+ net_buf. If some are unused, this will
deallocates them.
This situation can happen on TCP where net_pkt allocator evaluates the
header size to its maximum size. Which space might not be (fully) used
in the end. On fixed data size buffer, this might end up by having last
buffer(s) not bein used. So better removing those.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This will take into account the family and the protocol, as well as
existing buffer occupation, to return the available buffer space that
can be used for payload.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The convention is that implementation of any Socket API function
lives in zsock_*(), and then it's optionally aliased to bare POSIX
name if requested. This convention must be followed to get proper
integration into the general POSIX subsystem.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This commits adds a new MQTT transport. The purpose is to be able to
connect to a MQTT broker through a SOCKS5 proxy.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
The transport number is used to pick elements of an array which is
initialized using #if defined macros. Having explicit numeration in this
enum leads to situations where the array index is different than the
enum value.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
Implemented via Zephyr's net_hostname_get(). As support for that call
is configurable and by default off, while many POSIX applications
assume that hostname is always available, we need a default value
in case CONFIG_NET_HOSTNAME_ENABLE is "n". Initial version of this
patch added that on the level of gethostname() call, but of was
suggested to move that down to net_hostname_get() instead.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
It is possible to set the filter in user application and that
information is passed to the CANBUS device driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>