Developping a frontend for NuConntrack
Since NuConntrack works over a XML-RPC server, you can develop a frontend in any technology you want, using the XML-RPC client API provided for the programming langage you want to use.
Here are described available remote procedures served by NuConntrack.
"login" procedure
- prototype: login(mixed arguments) returns session ID : String;
First procedure to call for authenticating the client. Arguments depend on authentication backend. If using no modules, it does not need any argument ; if using auth_sha.py, it requires 2 arguments :
login(username: String, password: String)
The procedure returns a String which represents a session id to give as a first argument in each future procedure calls. The created session time out after 10 seconds.
"view" procedure
- prototype: view(session_id: String) returns connection set : Struct;
Gets a connections tracked by netfilter_conntrack.
"kill" procedure
- prototype: kill(session_id: String, connection_ids: Array of Integer) returns nothing;
Kills all connections identified by an element of connection_ids. Connection IDs are given in the result of view procedure.
"change" procedure
- prototype: change(session_id: String, field_name: String, connection_id: Integer, field_value: variable type) returns nothing;
Changes a connection's field. Presently only 2 fields can be modified :
- field_name="mark": Can be set to change the connmark of a connection. field_value must be an unsigned integer.
- field_name="timeout": Can be set to change the timeout (in seconds) of a connection : timeout becomes fixed for this connection ; field_value must be an unsigned integer.
