This implements LLMNR client from RFC 4795. This means that caller
is able to resolve DNS resource records using multicast DNS.
The LLMNR is used in Windows networks.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Defines a PTP clock driver that can be implemented in those network
interface drivers that provide gPTP support.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Julien Chevrier <julien.chevrier@intel.com>
This is actually the same as #7229 in which we missed this side of
conversion (only PCP to packet priority was implemented).
The conversion is actually the same both ways, thus it uses the map
added earlier.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
Allow creation of TX timestamp thread which will collect TX timestamp
information from device drivers. If the callback is registered, then
it will pass that timestamp information to the relevant party for
further processing. This support will be used by gPTP code in
subsequent commits.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Julien Chevrier <julien.chevrier@intel.com>
Ethernet header is always filled in the first fragment of a packet,
so passing it as a separate function paramter is supefluous.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
There was no proper support to timeout an ARP requests which meant
that trying to resolve non-existent IP address left network packet
pending on ARP cache.
Fixes#8019
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add net_eth_carrier_on() and net_eth_carrier_off() functions that
can be called by ethernet device driver when it detects that carrier
is lost or found.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If CONFIG_NET_L2_ETHERNET_MGMT is not enabled, then provide
stubs for ethernet_mgmt_raise_carrier_on_event() and
ethernet_mgmt_raise_carrier_off_event() functions so that those
functions can be called always.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Let's set it by default when allocating net_pkt. A macro will avoid
ifdefs as well
CONFIG_NET_TX_DEFAULT_PRIORITY is always defined.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
When disabling an ethernet interface, only its cache entries need to be
cleared up and not the whole cache. This is meaninful in case there is
2+ ethernet interface instances.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Layer code mask is 0x7FF so obviously 0x802 is not valid (as it will
always set the synchronous bit).
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This will be useful for OpenThread, drivers will need to implement that
fonction to be able to proceed with ED.
Fixes#5714
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
L2 could take advantage of such hardware capability, when supported by
the device. This is also required for OpenThread.
Fixes#5714
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This patch introduces several changes to support OPTIONAL resources.
The primary indicator for this behavior is to assign FLAG_OPTIONAL
to the object field's permission flags.
These resources are not setup by the LwM2M object code. They are
left up to the user-based code for initialization via the following
functions:
lwm2m_engine_set_res_data()
lwm2m_engine_get_res_data()
When assigning const-based data as a data buffer, user-based code can
also specify the following data flag: LWM2M_RES_DATA_FLAG_RO
The FLAG_OPTIONAL flag also affects the LwM2M engine in the following
ways:
- CREATE operations won't generate an error if optional resources are
not included.
- Object instance READ operations won't complain about missing
optional resources.
- In the future, BOOTSTRAP operations can have different handling
based on optional resources.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
In the future, we will have optional resources that may or may
not be assigned a buffer for data storage. When these resources
are queried we need to be able to return an error code if the
buffer isn't set.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
Similar to UDP, some drivers can make use of the following functions:
net_tcp_get_hdr()
net_tcp_set_hdr()
Let's expose them as <net/tcp.h> and change all internal references
to "tcp_internal.h".
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
Add functions that will return correct source IPv4 address
according to given destination address. This is done similar
way as for IPv6.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
According to IEEE 802.1Q the VLAN priority (PCP) is not directly mapped
to the network packet priority. The Best Effort priority has a PCP value
of 0. The lowest priority (Background) has a PCP value of 1.
All the values are mapped according to the following table:
+-----+-----+---------+
| PCP | PRI | Acronym |
+-----+-----+---------+
| 1 | 0 | BK |
| 0 | 1 | BE |
| 2 | 2 | EE |
| 3 | 3 | CA |
| 4 | 4 | VI |
| 5 | 5 | VO |
| 6 | 6 | IC |
| 7 | 7 | NC |
+-----+-----+---------+
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
The http.h used HTTP server defines when compiling HTTP client.
This causes compilation error.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If we have multiple network interfaces and we want to send
a IPv4 network packet to certain destination, then this new
helper can be used to figure out what network interface to use.
Note that this commit only adds support to select the correct network
interface according to destination IPv4 address. This does not enable
any automatic routing to happen.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Exposing connect, disconnect and scan for now.
In case the iface is an instance of a WiFi offload device, the way it
manages scanning, connecting and disconnecting will be specific to that
device (not the mgmt interface obviously). In such case the device will
have to export relevantly a dedicated bunch of function to serve the
mgmt interface in a generic way.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Add empty WiFi network management functions that only return -ENETDOWN.
Define management handlers for scan, connect and disconnect requests,
again without any implementation nor parameters defined.
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
First because nobody needs to know that besides net_mgmt core and
secondary to avoid possible circular dependancy on
net_mgmt.h/net_event.h.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Drivers will be directly contacted via net_if's offload attribute. No
need for a an extra layer as an L2.
Signed-off-by: Dario Pennisi <dario@iptronix.com>
Signed-off-by: Massimiliano Agneni <massimiliano.agneni@iptronix.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Make sure we are able to collect ethernet statistics and query
it via net management API.
Fixes#6899
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This will permit to tweak ethernet L2 and devices settings at runtime.
Currently, only devices settings are tweaked through this interface.
Fixes#6640
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Depending on what's supported by the device, it could be possible to
configure these at runtime such as auto-negociation, link speed, etc...
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Function should be exposed if only vlan is enabled.
Also, changing vlan_setup's signature to stay consistent with device
driver API.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Curently only link speed is exposed.
Opportunity taken to remove any post-fix enumerating the iface init
and/or the api: these must be generic and used by all the instances.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Instead of one global statistics, collect statistics information
separately for each network interface. This per interface statistics
collection is optional but turned on by default. It can be turned
off if needed, in which case only global statistics are collected.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Make sure that we return proper network statistics data if
someone asks it via network management interface.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
As the l2_data section might contain different size context elements
like "struct ethernet_context" for Ethernet and "void *" for
Dummy L2, remove the __net_l2_start and __net_l2_end variables so
that user does not accidentally try to use them as that would not work.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The DEVICE_NAME_GET() macro should be used instead of fixed
string when creating a device pointer in net_if_dev structure.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Currently the VLAN priority is the same as packet priority but
if such conversion is needed, then this function can be used
for such conversion.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This allows creation of virtual lan (VLAN) networks. VLAN support is
only available for ethernet network technology.
Fixes#3234
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The __net_if_align was removed in earlier commits but it needs
to come back as in some arch the alignment of net_if section
will be wrong.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
__packed allows the struct to be linked at a non-word size boundrary
which causes an unaligned access fault on the Cortex-M0+.
Signed-off-by: Michael Hope <mlhx@google.com>
There can be lot of traffic class threads and each will have
their own stacks. This can trigger issue when traversing the
stacks list in "net stacks" shell command. To overcome this issue,
we need to align each net_stack_info struct by 32 bytes. This is
the same issue that happened with net_if earlier.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add statistics for number of packets and bytes to each traffic
class. Print this information in net-shell.
Also make sure that we do not calculate total packet length many
times. So calculate network packet total length once and then use
that value instead of calculating it many times in a row.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
With this commit it is possible to add priority to sent or received
network packets. So user is able to send or receive higher priority
packets faster than lower level packets.
The traffic class support is activated by CONFIG_NET_TC_COUNT option.
The TC support uses work queues to separate the traffic. The
priority of the work queue thread specifies the ordering of the
network traffic. Each work queue thread handles traffic to one specific
work queue. Note that you should not enable traffic classes unless
you really need them by your application. Each TC thread needs
stack so this feature requires more memory.
It is possible to disable transmit traffic class support and keep the
receive traffic class support, or vice versa. If both RX and TX traffic
classes are enabled, then both will use the same number of queues
defined by CONFIG_NET_TC_COUNT option.
Fixes#6588
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Allow caller to create array of thread stacks using
NET_STACK_ARRAY_DEFINE() macro. This allows more debug information
to be printed by "net stacks" command.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>