View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/cli/index.html.
backend: backend to use
Initializes a client backend. Must be performed before any other call.
Return value: 1 on success, 0 on failure
backend: unitialize a cli backend
Closes a cli, but does not free all ressources.
backend: backend to use
node_info: information on the current node
oob_data: data of the out-of-band request
Processes the required out-of-band tasks, this typically, for a client, includes broadcasting. Depending on parameters passed in oob_data, might actually do a broadcast or simply call a given host and see what's the answer. A typicall exchange is PING then INFO and finally LIST. It's the responsability of the client to take the OOB initiative and contact the server.
Return value: 1 on success, 0 on failure.
backend: backend to use
local_url: our local public url
remote_url: the remote url we want to connect to
remote_ip: remote IP address
remote_port: remote IP port
password: password to use (if needed)
local_id: our local id
remote_id: the remote id
dns_ok: wether the remote announced URL matches DNS information
network_reliability: network reliability (the highest, the better)
recv_callback_func: callback func to be called when data is received
recv_callback_data: pointer on additionnal data to pass to callback func
Opens a connection with a remote host. Be carefull with the implementation of
recv_callback_func
, it should be at least reentrant, and when it accesses shared data, use locks.Return value: new object.
backend: backend to use
connection: connection to use
Closes a connection, this will free the connection object.
Return value: none.
backend: backend to use
connection: connection to use
physical_ticket_sig: signature of physical sender
logical_ticket_sig: signature of logical sender
logical_from_id: id of logical sender
logical_to_id: id of logicial target
message: text of message to send
Sends a message to a peer over a given connection.
Return value: 1 on success, 0 on failure.
backend: backend to use
connection: connection to use
Performs required duty on connection, depending on the backend, this can include sending messages and/or receiving them. Must be called on a regular basis.
Return value: none.
backend: backend to use
connection: connection to represent
Gives a human readable representation of the connection.
Return value: dynamically allocated string.
public_url: the address of the distant server to test
verify_callback_func: a function which will be called when a node has been verified
verify_callback_data: additionnal data passed to the callback func
Create a new OOB structure, copying required objects. We need to make copies for this is for usage in a separate thread. The thread member is not set here since the right way to do things is first to set up data then to fire the thread.
Return value: new object
oob: the object to free
Frees an OOB structure.
Return value: none
Returns the list of the default cli backends.
Return value: comma separated string, must not be freed.
argc: argc, as passed to
main
argv: argv, as passed to
main
List available cli backends. The hash contains pairs with id and name for each backend. The id is the technical key you can use to load the backend, the name is something more readable you can display in an interface. The backend objects themselves are not instanciated by this (in fact, they are, but released on the fly) you need to load and initialize them afterwards.
Return value: hash containing id/name pairs.
argc: argc, as passed to
main
argv: argv, as passed to
main
name: string containing cli key, typically got from
lw6cli_get_backends
Creates a cli backend, this is just about loading the dynamic library if needed, and/or check cli engine is available, and connect to it. It does not perform initialization.
Return value: cli backend.