Commit Graph

10 Commits

Author SHA1 Message Date
Bjorn Andersson
0ec649d4e6 qrtr: Backport future qrtr.h uapi
The uapi qrtr.h is extended with additional types and constants. Drop
the local qrtr.h to use the one from linux-headers and extend it
conditionally while we're waiting for the updated file.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-01-31 05:53:49 +00:00
Bjorn Andersson
b65e63045f libqrtr: Don't enforce server port to be bound
When sending a new_server message to the qrtr-ns the node and port in
the packet is ignored (to not allow clients spoofing the information),
so there's no reason to have this artificial check in the
qrtr_new_server() implementation either.

The socket will be bound to a port automatically when the new_server
message is sent out.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-11-09 10:22:28 -08:00
Bjorn Andersson
dfae11b03a libqrtr: Don't require socket to be bound for lookup
There's no reason to require that the socket to be bound to a specific
port in order to register a lookup, the transmission of the lookup
request will autobind the socket to a port for us.

Also drop the node and port from the payload, as qrtr-ns will register
the lookup on the source sq, rather than the passed port.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-10-30 21:38:47 -07:00
Bjorn Andersson
ba500a4d3d lib: Fix endian handling and add new/del server
Fix up the handling of endian translation and add support for decoding
new and del server messages.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-06-07 10:00:28 -07:00
Bjorn Andersson
577328a8ab lib: Add helpers for handling control messages
The two added functions can be used by an application to check if a
sockaddr is from the control port and for parsing the control messages
that is passed to registered clients.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-06-07 10:00:28 -07:00
Bjorn Andersson
0bc03abb43 ns: Remove the ns service
Now that we have moved all operations to the control socket we can
remove the ns handler. The query function in the library is racy, as
there might be non-response messages in our incoming buffer when we
start reading, so this is dropped too - rather than just being
translated to the new interface.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-06-06 21:50:54 -07:00
Bjorn Andersson
326aad23ae ns: Introduce lookup registration
Introduce a subscription based lookup model, in order for a client to be
able to listen to a future spawning service. The client can register any
number of queries with the ns and the ns will post lookup-results as
services are registred.

As a special case the list of lookup-results that is sent out as a
result of the registration of a new lookup will be finished by an empty
lookup response, allowing tools like qrtr-lookup to terminate as the
entire list of currently registed services is received.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-06-06 21:49:30 -07:00
Bjorn Andersson
e377bc8e84 lib: Replace qrtr_publish() and qrtr_bye() implementations
Replace the implementation of the two library functions with calls to
the new APIs, so that we can remove the server-side implementation of
the previous messages.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-06-06 21:47:00 -07:00
Bjorn Andersson
ff29fb17a3 lib: Provide new API for clients to register services
Add a new set of operations to libqrtr for sending registration events
to the control service, rather than using the nameservice port.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-06-06 21:16:54 -07:00
Bjorn Andersson
18fc98b858 libqrtr: Extract the lib from the src directory
Extract the libqrtr source and header file to a separate directory,
making it more convinient to include the header file from other
projects.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-02-07 22:01:57 -08:00