Functions
<function>dispatch_rpc()</function> 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. <function>dispatch_rpc</function> usage #... modparam("xmlrpc", "route", "XMLRPC"); #... route[XMLRPC]{ if search("^User-Agent:.*xmlrpclib")) set_reply_close(); set_reply_no_connect(); # optional dispatch_rpc(); }
<function>xmlrpc_reply(code, reason)</function> This function can be called from the config script to directly generate an XML-RPC reply. <function>xmlrpc_reply</function> 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(); }