Roll the loop in an accept_run() function and use it to match "rue" and
"alse" depending on the first character of the token. Use that to lex
"ull" after finding "n" as well. This reduces the code slightly.
Jira: ZEP-1607
Change-Id: Iec8ff6ae2fb79e7fe65d476d1574c5943d23e14f
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Serializing an object in JSON is quite tricky to do by hand, and with
an array of descriptor structs, there's enough information to do that
programatically.
The encoder takes a callback function, so that one can be written to
write bytes to, for instance, a struct net_buf. This way, there's no
guesswork to determine the buffer size, reducing the possibility of
overflowing the stack.
Jira: ZEP-1607
Change-Id: I5ccf1012e46c1db32fcfdf2ecee4a1ef44c927d5
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Parse arrays and nested objects.
Array parsing is limited to items of the same type, and requires an array
with fixed number of elements. Elements can be of any type supported by
the parser, including arrays and objects.
The return value of json_obj_parse() won't be that helpful: the nth bit
will only be set if the object has been fully decoded.
Jira: ZEP-1607
Change-Id: I472e402ae3f36a1bd1505decc0313f74cbfa2e07
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Add more installation details for building zephyr on Windows
including what to do with the ISSM tar.gz file that's
downloaded, proxy settings if behind a firewall, adding tar
to the dependencies (needed to extract the ISSM tar.gz file),
linking to the downloads page for the ARM toolchain, and
fixing command lines to correctly use `make BOARD=`. Verified
instructions work on a Windows 10 system.
Change-Id: I04e5f8e46df7630868568b90388dc65bb9baa4c9
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
This way we can monitor testcases for faults that should not be there;
however, in the case of these, a fault message is expected and shall
be ignored.
Change-Id: I63736723026c381c9fee7f24a751ceafc12f2a40
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Legacy APIs are to be deprecated, so getting rid of tests that have been
moved to unified kernel already.
Change-Id: I752e42bc498dfdd0ea29b0b5b7b9da1dac7b1136
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Same volatile status variable as return and being updated
in ISR would modify the variable in two context which
caused the variable to be set to a stale value.
This commit uses two different variables, one for return
value and the other to be updated by ISR.
Jira: ZEP-1941
Change-id: I19e3bdc85e15bda7891395f3f1f64c2ddbeee0c6
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
role_disable initiated through HCI commands are initiated
in thread context and controller code was using the job
mayfly caller id instead of using the correct app caller
id.
Also the XTAL retain calls being called from two different
call context used the same worker caller id and same mayfly
instead of using the correct caller ids and independent
mayfly for each caller.
This potentially could cause mayfly enqueued list to be
corrupted and enqueued mayfly could be lost.
Change-id: Ia356419462d1fb4e38f4a20c720974143f12fdb6
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
There is no transition from tentative state etc... It should directly go
to preferred.
This is fixing ND processing when DAD is disabled: source address was
never set, as tentative state is not a valid in
is_proper_ipv6_address().
Change-Id: I6f0a0fdd99dd13d28849f9749f89ec21fdd370d8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Add "net dns <hostname> [A | AAAA]" command support that can be
used to query IPv4 or IPv6 address for a given host name.
Change-Id: I86b2258efa994a67163f9b3b340f44d65767f11b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Applications should normally use these functions as then the system
wide DNS server settings are used.
Change-Id: I2c1fc7c7c881081506d21c3d37628d5c3dcc6aaa
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the config file contains DNS server addresses, then
configure the DNS resolver to use them.
Change-Id: Ie7f2bdcf7ac4bb7ee0ecf7fb5b7bd2df3379cdc3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit introduces a generic DNS resolving API that can
be used by applications. Later commits will introduce a system
level DNS support which simplifies the DNS resolving so that
DNS server names can be given from config file.
Change-Id: I60fbc81e2a44928d2ca53d51e703b9cde222b382
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Length parameter was always useless, only used in debugging, so that can
be removed.
Change-Id: If597f424840f37955202fa5fe827dd992e4cf776
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Thus the ping command is more user-friendly: at least user knows the
ping got a reply or not.
Change-Id: I740a2f77d288f6287ac04c908f3d517a49df57d2
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
As it is done for ICMPv6. This will prove to be useful for implementing
an echo reply handler in a ping for instance.
Change-Id: I969a1da60f2a4ea59eee5c9983eb6e340923e2ef
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
net_addr_pton always returns -EINVAL in case of error, so let's play with
it to factorize the code.
net_icmpv<4/6>_send_echo_request always returns -EIO in case of error.
Change-Id: I89e5ccd4b936701f7dad194089dda845fab5d738
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Refining the names around IPv6's neighbor states to differentiate them
easily from any net_nbr related names (which are not tighten to IPv6).
Change-Id: Ibc24df2a9485477a53fe5fe1c8f993f0fcd91635
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Probably some refactoring left-over.
Change-Id: I9715441a54b2e675135ce4072651dcead3216d3b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
We incorrectly changed the state from FIN_WAIT_1 to CLOSE_WAIT.
This caused ACK be sent in CLOSE_WAIT state when the connection
was closed by peer. Sending ACK in this state is not allowed
according to RFC. The connection was still closed but slightly
wrong way.
Jira: ZEP-1961
Change-Id: Ie4aa6818128d4190230b679e26ac9630c7d45d69
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
User can open a TCP connection (just one at a time) by
using "tcp connect <ip> port" command.
Data can be sent by "tcp send <data>" command.
Connection can be closed by "tcp close" command.
Change-Id: I75aedd873a30575a6f742926b716afb7dbbfb92b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
No functionality changes, use separate variable so that we do
not need to do big-endian conversion multiple times.
Change-Id: I8874b427bd39dfa2d952034a2623c47544a644fc
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The echo-server no longer uses multicast addresses itself,
so the multicast address setting can be removed from echo-client.
Change-Id: Ieab069849ced8a850ada6e6618d625695819be8e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If IPv6 router is added, then NET_EVENT_IPV6_ROUTER_ADD event
is generated. When router is removed, NET_EVENT_IPV6_ROUTER_DEL
is then generated. This is useful info if we want to have a generic
connectivity to outside of our local network.
Change-Id: Ia03958a071ceb998127894025c99ab72a8b648d5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The multicast address setting in echo-server was not really
used for anything so removing it from the app.
Change-Id: I8069c670388702fc46ae2f31506c982caa28212d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the bind port is set to 0, then return the real bind port and
show it in the debug print.
Change-Id: If75b52bdacfc916329222d0d9e8aa4669e7a7160
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This is part of a patch series to decouple TCP/IP offload, which
currently occurs at the transport layer (L4), from the data link
layer (L2).
- Rename struct net_l2_offload_ip to struct net_offload
- Rename struct field offload_ip to just offload
- Rename include/net/offload_ip.h -> include/net/net_offload.h
Change-Id: I3cd891c2b13e0e8f3ad1c66264f90b5031ae17c2
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
This is part of a patch series to decouple TCP/IP offload, which
currently occurs at the transport layer (L4), from the data link
layer (L2).
This provides a more direct call stack from the net_context APIs
to the offload driver functions, versus going through the current
offload L2 (dummy) driver.
Change-Id: Ia5a677d87f7b62f54b2702ce8ecfaf026f6f7c26
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
This is part of a patch series to decouple TCP/IP offload, which
currently occurs at the transport layer (L4), from the data link
layer (L2).
This patch simply renames the NET_L2_OFFLOAD_IP Kconfig variable
to NET_OFFLOAD.
Change-Id: Ic8b1d004cbac09b7c636475aaed75b0a31e4be1c
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
At the moment CC2520 configuration options are selected inside "TI
CC2520 Driver RAW channe" submenu like:
[*] TI CC2520 Driver support ----
[ ] TI CC2520 Driver RAW channel --->
Make RAW channel depends on TI CC2520.
Change-Id: I92879b7f4391f1842c012b6c03c78956e90b9441
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
These are copied verbatim from the echo_server sample.
Change-Id: I56d1386144967177f889e12d4a173bfb6628f18b
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
When route not found try with default router if it exists. Consider
default router as nexthop. If default router also does not exist
then drop the packet.
Change-Id: I56cc9e4a1432fc25687cbaea600bfe9cf5b1d51e
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>