Creating a dummy macro that is used when debugging is disabled.
Change-Id: I8171463451ef428f1f06fa845d7af6b78c7c5910
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Changing the IP address type to const as the functions do not
modify the IP address.
Change-Id: I176d84af5f05843226a954f91b6bb3bba6596863
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Network interface multicast address was missing information
about the protocol family.
Change-Id: I8d7b0514ec351efddb6997965c940f62fc08a37a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
No need to print debug prints if debugging is not activated.
Change-Id: I42a6453b4f3e11106119561b580ebea41e56452d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Using network interface index instead of net_if pointer can
save 3 bytes of memory. So these utilities help to convert
pointer to index and vice versa.
Change-Id: I8743a06e0935d48798b19526154058be385550af
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
When checking the IP address from network interface, return
also the used network interface.
Change-Id: If7b8385193da4cb1b469f697e219cfae3b6477dd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
We do not need any header files from legacy IP stack.
Change-Id: I0c78fe500bec37593e66e8a237a3f92b79cbaf85
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
IPv4/6 functions follows this scheme: net_if_ipv<4/6>_<name>.
Applying that to net_if_set_gw/net_if_set_netmask which are IPv4
functions.
Change-Id: I2dcbb16ce81cfdffbfbb5cae24ad76ddf2b9919a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Reducing the amount of #if defined(CONFIG_NET_IPV<4/6>) for a clearer
code and to lower compiler's stress.
Change-Id: Iffbfbda4409c6cbf48a3057ea1b9e43309cd84e7
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
IPv6 packets with UDP header are compressed and decompressed
as per RFC 6282 (IPHC). Context based compression not implemented.
Change-Id: I8020da26b8d40fdc80e75cba56ef28a01a36159e
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Utility verifies given address is based on link layer address
or not.
Change-Id: I2b89e498fa2481051ec9a47ada8b4a5e8e38ad7a
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
If the link layer address is short address, create interface ID based on
short address.
Change-Id: I49e150cc20a0bf973880d27f418762f68f2d9139
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
While reusing buffers and passing those parameters might have
already some garbage. So just clear first and create iid.
Change-Id: I5774de157e0c39e7e7b1313a598557c58a4c63b0
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Using macros does not let the compiler verifying about the type we are
providing, which usually give an error easier to understand.
Also, this will let the compiler deciding how to actually optimize
(inline or not) the code.
Change-Id: Iba49590b620ef0a1bd0ed5621453524fcfea747c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This make sure we will found all relevant headers in the right location.
Change-Id: I37fe978ed2af09d921c48df6986a8df9041ddc3f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
NET_BUF might be used alone. Also Bluetooth does not necessarily needs
an IP stack to run. Changing titles names for better understanding.
Change-Id: Iabfd7bf0689e79d27cc7897856a528f0dc5740f7
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
net_context.h is missing and one variable had a wrong name.
Change-Id: I4aac2f5c12cea39553fb86d1bd497c88f0ef1963
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Without these, test case will fail miserably.
Change-Id: Ib46d167b8782c33362ac6edb9d8c50abc25908c0
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Debug function that will print individual fragments and their sizes.
Change-Id: I84ce144230fb099bb44ed383075564ebf377998f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Disable IPv6 DAD and ND for IP address test as there is
no need to do neighbor discovery in the test. We also
would like to see network interface debugging and use
dummy L2 driver instead of ethernet one.
Change-Id: Ia9f218c8d4c13afa1482302691d2ef72af4a7b13
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The driver_api pointer was set to NULL and send() pointer
was missing which caused a crash in TX fiber.
Change-Id: I7204c975691476dd9ab2c61bfd11b7664343e47c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The earlier Kconfig entries for IPv6 DAD and ND were confusing.
This commit will clarify this so DAD is activated by
CONFIG_NET_IPV6_DAD and ND is activated by CONFIG_NET_IPV6_ND.
These are settings are enabled by default.
Change-Id: If6245e3425489bc454a0d75113770c4f797a4017
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
ARP is IPv4 only so no need to have IPv6 functionality.
Change-Id: Ie70242f5763ba4945c311898643414851f7e8660
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
These tests will verify that we can successfully insert
some space in front of the net_buf fragment chain.
Change-Id: Idf52ed56c52d66268783fb4fecd44b70fc852734
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Provide an utility function that pushes data down in the fragment
chain which means that there would be some free space before the
first fragment.
Change-Id: I491ac4e8cbf633f86f2351cad48d683e829bda63
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Provide a function that checks if there is any free space
in the individual fragment and remove such slack. If there
are fragments that would become empty, then those fragments
are removed from the fragment list and freed to the fragment
pool.
Change-Id: Ieb1c953a1458622c4552c23ef38e330873cd27c3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The driver_api pointer was set to NULL which will cause
a crash in TX fiber.
Change-Id: If1c9a1e44904970f3a0019741eaaad4bf62d2c73
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Catch UDP network traffic and call the corresponding handler when
UDP network packet is received. If there is no handler for such
a traffic then ICMP error message is sent to network peer.
Change-Id: I71721deb9ca0f8d3bdb00db43e5555e5b96ae2d2
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Create a handler for catching UDP network traffic. This commit
is only providing infrastructure for UDP management.
Change-Id: Ia6f8de62773a85f7b637b73bfe3c89197cc2abb1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The connection handling will provide an API where caller can
register a callback which is called when desired UDP or TCP
network packet is received.
Change-Id: I9a80e8b30e92c4f2e9238ff58c24ac4648aad8ea
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Provide an API to send ICMPv4 error message. This can be used
for example in UDP and TCP to inform peer that there is no one
listening a certain port.
Change-Id: I915139be402892a9148e28f9c0883f7da8eb5b80
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Provide an API to send ICMPv6 error message. This can be used
for example in UDP and TCP to inform peer that there is no one
listening a certain port.
Change-Id: Ied682901f7fc406ba383293cb7c338ea21114b0d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Added define for minimum IPv6 MTU value (1280 bytes)
Change-Id: Ia81d8b3df079a2bb9bfb0a05e297d94423ba0fc5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Changed the net_is_ipv6_addr_unspecified() and
net_is_ipv6_addr_solicited_node() to use const IPv6 address
as those function do not change the address.
Change-Id: I1222bf946c371433a8468fa71054b93346e2ae4e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
User can set the initial value for time-to-live option in Kconfig.
The TTL option is only used in IPv4.
Change-Id: I57677e65a2adee4aa4dc16d1504f848d1218c6c1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The tests will make sure net_nbuf_copy() works as expected.
Change-Id: I48dc3b794c70ec4d6436feb76508952c88bbf09b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This function will copy desired amount of bytes from one
fragment list to another. Caller can specify amount of
bytes reserved in front of the new fragment list.
Change-Id: Ie3344b285a47c79f116fbcff500d383a99d28bf9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This helps also to split uIP and native stacks properly.
Next thing that should be done will be to isolate debug
options for native stack out of uIP tree.
Change-Id: I4ff856b5a4bb57f3773e1852f84f658baf26858f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
It is possible to turn of IPv6 neighbor discovery if it is
not used in order to save some memory.
Change-Id: I20159dd452b7bac6962532a91e844c33f3da2dfb
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>