fred-mod-eppd-2.20.0
|
Interface to component which parses xml documents and returns document's content in form of a structure. More...
Go to the source code of this file.
Enumerations | |
enum | parser_status { PARSER_CMD_LOGIN, PARSER_CMD_LOGOUT, PARSER_CMD_OTHER, PARSER_NOT_VALID, PARSER_HELLO, PARSER_NOT_COMMAND, PARSER_NOT_XML, PARSER_ESCHEMA, PARSER_EINTERNAL } |
EPP parser status values. More... | |
enum | epp_red_command_type { EPP_RED_UNKNOWN_CMD, EPP_RED_LOGIN, EPP_RED_LOGOUT, EPP_RED_CHECK, EPP_RED_INFO, EPP_RED_POLL, EPP_RED_TRANSFER, EPP_RED_CREATE, EPP_RED_DELETE, EPP_RED_RENEW, EPP_RED_UPDATE, EPP_RED_EXTCMD, EPP_RED_HELLO } |
Enumeration of all implemented EPP commands as defined in rfc. More... | |
Functions | |
void * | epp_parser_init (const char *url_schema) |
This routine initializes libxml's parser, hash table for command recognition and parses xml schema, which is returned. More... | |
void | epp_parser_init_cleanup (void *schema) |
This will cleanup command hash table, libxml's parser and release parsed xml schema. More... | |
parser_status | epp_parse_command (epp_context *epp_ctx, int loggedin, void *schema, const char *request, unsigned bytes, epp_command_data **cdata, const eppd_server_xml_conf *xml_schema, epp_red_command_type *cmd_type) |
This is the main workhorse of parser component. More... | |
void | epp_parser_request_cleanup (void *cdata_arg) |
This will cleanup xpath context and parsed document tree. More... | |
Interface to component which parses xml documents and returns document's content in form of a structure.
enum epp_red_command_type |
Enumeration of all implemented EPP commands as defined in rfc.
It is REDuced form - without object suffix. And is used as hash value in command hash table for fast recognition of commands.
enum parser_status |
EPP parser status values.
The ordering of items in enumeration is important, because relation greater, smaller is used for resolution between cases when connection should be closed and when it shouldn't.
parser_status epp_parse_command | ( | epp_context * | epp_ctx, |
int | loggedin, | ||
void * | schema, | ||
const char * | request, | ||
unsigned | bytes, | ||
epp_command_data ** | cdata, | ||
const eppd_server_xml_conf * | xml_schema, | ||
epp_red_command_type * | cmd_type | ||
) |
This is the main workhorse of parser component.
It's task is to parse request and get data saved in structure.
epp_ctx | Epp context (pool, connection and session id). |
loggedin | True if client is logged in. |
schema | Parsed xml schema used for validation. |
request | Request to be processed. |
bytes | Length of the request. |
cdata | Output of parsing stage (xml data converted to structure). |
cmd_type | Output of commnad type (used also by logging) |
References epp_calloc(), epp_malloc(), epp_command_data::errors, NS_CONTACT, NS_DOMAIN, NS_ENUMVAL, NS_EPP, NS_EXTRAADDR, NS_FRED, NS_KEYSET, NS_NSSET, parse_command(), parse_extension(), epp_command_data::parsed_doc, PARSER_CMD_OTHER, PARSER_EINTERNAL, PARSER_ESCHEMA, PARSER_HELLO, PARSER_NOT_COMMAND, PARSER_NOT_VALID, PARSER_NOT_XML, epp_context::pool, epp_command_data::rc, epp_command_data::type, VAL_EINTERNAL, VAL_ESCHEMA, VAL_NOT_VALID, validate_doc(), epp_command_data::xml_in, XML_IN_ENC, epp_command_data::xml_schema, and epp_command_data::xpath_ctx.
Referenced by epp_request_loop().
void* epp_parser_init | ( | const char * | url_schema | ) |
This routine initializes libxml's parser, hash table for command recognition and parses xml schema, which is returned.
url_schema | XML schema location. |
References cmd_hash_clean(), and cmd_hash_insert().
Referenced by set_schema().
void epp_parser_init_cleanup | ( | void * | schema | ) |
This will cleanup command hash table, libxml's parser and release parsed xml schema.
schema | Parsed xml schema. |
References cmd_hash_clean().
Referenced by epp_cleanup_xml().
void epp_parser_request_cleanup | ( | void * | cdata_arg | ) |
This will cleanup xpath context and parsed document tree.
cdata_arg | cdata structure containing items to be cleaned up. |
References epp_command_data::parsed_doc, and epp_command_data::xpath_ctx.
Referenced by epp_cleanup_request().