Functions
dispatch_rpc()
This function processes an XMLRPC request, found in the body of
the request.
It should be used only in a route specified using the
"route" module parameter or if the request method
is GET or POST (using it for other request methods will not have
adverse side-effects, but it will probably not work).
dispatch_rpc() extracts the XML-RPC document from the body of the
request to determine the name of the RPC method to be called and then
it searches through the list of all the RPC functions to find a
function with matching name. If such a function is found then
dispatch_rpc() will pass control to the function to handle the
request.
dispatch_rpc usage
#...
modparam("xmlrpc", "route", "XMLRPC");
#...
route[XMLRPC]{
if search("^User-Agent:.*xmlrpclib"))
set_reply_close();
set_reply_no_connect(); # optional
dispatch_rpc();
}
xmlrpc_reply(code, reason)
This function can be called from the config script to directly
generate an XML-RPC reply.
xmlrpc_reply usage
#...
modparam("xmlrpc", "route", "XMLRPC");
#...
route[XMLRPC]{
# allow XMLRPC requests only on TLS and only if the client
# certificate is valid
if (proto!=TLS){
xmlrpc_reply("400", "xmlrpc allowed only over TLS");
return;
}
if (@tls.peer.verified!=""){
xmlrpc_reply("400", "Unauthorized");
return;
}
if search("^User-Agent:.*xmlrpclib"))
set_reply_close();
set_reply_no_connect(); # optional
dispatch_rpc();
}