View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/p2p/index.html.
argc: number of args, as passed to
main
argv: args array, as passed to
main
name: the database name
Creates a new database object. Normally there's only one object like this at a given time, it can be shared among various nodes. The database name is appended to user directory path, this allows different databases to be created, in theory.
Return value: a pointer on the newly created object.
db: the db to close
Closes a db object, memory ressources will be freed.
Return value: none.
db: the db to work on
Gives a readable representation of the db
Return value: a dynamically allocated string
argc: number of args, as passed to
main
argv: args array, as passed to
main
name: the database name
Clears the database. Simply removes the db file, in fact. Do not call while database is used...
Return value: 1 on success, 0 if failed.
Returns the default database name, should be p2p.db (this is a relative path, not an absolute path, will be appended to user dir).
Return value: the default database name, need not (must not) be freed.
db: the db object concerned (used to calculate time origin)
Returns a timestamp suitable for db usage. The reason we don't use regular timestamps is that they are 1) too accurate (msec is useless for what's involved here) and 2) too big and likely to be negative in signed mode even if converted to seconds.
Return value: a timestamp, 0 means "beginning of program" (think of it as uptime)
argc: number of args, as passed to
main
argv: args array, as passed to
main
db: the database to use
client_backends: the list of client backends to use
server_backends: the list of server backends to use
bind_ip: the IP address to bind on
bind_port: the IP port to listen on
broadcast: wether broadcast is allowed on this node
public_url: the public URL we want to show
title: the title of the node
description: the description of the node
password: the password to use
bench: the bench of the node (its power)
open_relay: act as an open relay or not
known_nodes: list of already known nodes
network_reliability: drop 1 packet out of X
trojan: act as a stupid trojan to test out automatic kick-off
Creates a new "pear to pear" node. This will fire the server and allow client access, on demand. A lot of stuff can be done in the background once this is called.
Return value: a pointer on the newly created objects.
node: the node to free
Frees a node object, all network communications will be shut.
Return value: none.
node: the node to work on
Gives a readable representation of the node
Return value: a dynamically allocated string
node: the node to poll
Polls a p2p node. This must be called on a regular basis, else network communication is stalled.
Return value: 1 on success, 0 on error.
node: the node to close
Closes a p2p node. Closing is necessary in some contexts, for instance scheme/smob instanciation when you want to release the object ressources (sockets, ports, threads...) *before* it is deleted by, for instance, a garbage collector.
Return value: 1 on success, 0 on error.
node: the node to query
Returns the node id, an id which is supposed to uniquely identify the node at run-time.
Return value: numerical id.
mode: 0 for check only, 1 for full test
Runs the
p2p
module test suite. This test can fail if one cannot bind on some network port, in a general manner it is dependent on the network environment, so it's better if there's some sort of human control on it.Return value: 1 if test is successfull, 0 on error.