fred-mod-eppd-2.14.1
|
Component for parsing EPP requests in form of xml documents. More...
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <ctype.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxml/xmlmemory.h>
#include <libxml/xmlschemas.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#include "epp_common.h"
#include "epp_xmlcommon.h"
#include "epp_parser.h"
Data Structures | |
struct | cmd_hash_item_t |
Item of command hash table used for fast command recognition. More... | |
Defines | |
#define | HASH_SIZE_CMD 30 |
Size of hash table used for hashing command names. | |
#define | XML_IN_ENC "UTF-8" |
Encoding for input xml in epp_command_data structure. | |
#define | XERR_OK 0 |
OK status. | |
#define | XERR_LIBXML 1 |
Error in function from libxml library. | |
#define | XERR_ALLOC 2 |
Memory allocation failed. | |
#define | XERR_CONSTR 3 |
Constraints given by caller were not fulfilled. | |
#define | CHK_XERR(_var, _label) if ((_var) != XERR_OK) goto _label |
Macro checks given variable for an error, if the variable has error status, a flow of a program is redirected to given label. | |
#define | RESET_XERR(_var) ((_var) = XERR_OK) |
Macro checks given variable for an error, if the variable has error status, a flow of a program is redirected to given label. | |
#define | TEXT_CONTENT(_xpathObj, _i) ((char *) ((xmlXPathNodeSetItem((_xpathObj)->nodesetval, (_i))->xmlChildrenNode) ? (xmlXPathNodeSetItem((_xpathObj)->nodesetval, (_i))->xmlChildrenNode)->content : NULL)) |
Get text content of an element. | |
Typedefs | |
typedef struct cmd_hash_item_t | cmd_hash_item |
Functions | |
int | read_epp_dnskey (void *pool, xmlXPathContextPtr xpathCtx, epp_dnskey *key) |
Read DNSKEY information from xml into epp_dnskey structure. | |
static char * | get_attr (xmlNodePtr node, const char *name) |
This function returns specified attribute value of given node. | |
static xmlNodePtr | xpath_chroot (xmlXPathContextPtr ctx, const char *expr, int index, int *xerr) |
Function changes relative root of xpath context to node described by xpath expression. | |
static int | xpath_count (xmlXPathContextPtr ctx, const char *expr, int *xerr) |
Sometimes we want to know how many elements satisfying xpath expression are there or just to know if there is any or not. | |
static char * | xpath_get1 (void *pool, xmlXPathContextPtr ctx, const char *expr, int req, int *xerr) |
A content of element described by xpath expression is returned. | |
static void | xpath_getn (void *pool, qhead *list, xmlXPathContextPtr ctx, const char *expr, int *xerr) |
List is filled by content of elements described by xpath expression (There may be more elements matching xpath expression). | |
static char * | xpath_get_attr (void *pool, xmlXPathContextPtr ctx, const char *expr, const char *attr, int req, int *xerr) |
A value of attribute of node described by xpath expression is returned. | |
int | parse_boolean (char *str) |
Parse a boolean value entered either as a number or as a string (true/false) | |
static unsigned char | get_cmd_hash (const char *key) |
Function for hashing of command name. | |
static char | cmd_hash_insert (const char *key, epp_command_type type) |
Function inserts command in hash table. | |
static epp_command_type | cmd_hash_lookup (const char *key) |
This routine does traditional lookup on hash table containing commands. | |
static void | cmd_hash_clean (void) |
Function releases all items in command hash table. | |
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. | |
void | epp_parser_init_cleanup (void *schema) |
This will cleanup command hash table, libxml's parser and release parsed xml schema. | |
void | epp_parser_request_cleanup (void *cdata_arg) |
This will cleanup xpath context and parsed document tree. | |
static int | new_error_item (void *pool, qhead *errors, epp_errorspec errspec) |
Create and enqueue new error item of specified type. | |
static void | parse_login (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of EPP login command. | |
static void | parse_check (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of EPP check command. | |
static void | parse_info (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of EPP info command + list command. | |
static void | parse_poll (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of EPP poll command. | |
static void | parse_create_domain (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of EPP create-domain command. | |
static epp_identType | string2identtype (const char *str) |
Routine converts string to ident type. | |
static void | parse_create_contact (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of EPP create-contact command. | |
static void | parse_create_nsset (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of EPP create-nsset command. | |
static void | parse_create_keyset (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of EPP create-keyset command. | |
static void | parse_create (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of EPP create command. | |
static void | parse_delete (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of EPP delete command. | |
static void | parse_renew (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of EPP renew command. | |
static void | parse_update_domain (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of EPP update-domain command. | |
static void | parse_update_contact (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of EPP update-contact command. | |
static void | parse_update_keyset (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of EPP update-keyset command. | |
static void | parse_update_nsset (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of EPP update-nsset command. | |
static void | parse_update (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of EPP update command. | |
static void | parse_transfer (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of EPP transfer command. | |
static void | parse_sendAuthInfo (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of command sendAuthInfo. | |
static void | parse_infoKey (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata, const char *key) |
Parametrized parser of commands domainsByNsset, domainsByContact, nssetsByContact and nssetsByNs. | |
static void | parse_test (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of command test. | |
static void | parse_ext_enumval_create (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of enumval extension in context of create domain command. | |
static void | parse_ext_enumval_update (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of enumval extension in context of update domain command. | |
static void | parse_ext_enumval_renew (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata) |
Parser of enumval extension in context of renew domain command. | |
static parser_status | parse_command (void *pool, int loggedin, epp_command_data *cdata, epp_red_command_type *cmd, xmlXPathContextPtr xpathCtx) |
Generic parser of EPP command section. | |
static parser_status | parse_extension (void *pool, epp_command_data *cdata, xmlXPathContextPtr xpathCtx) |
Generic parser of EPP extension section. | |
parser_status | epp_parse_command (epp_context *epp_ctx, int loggedin, void *schema, const char *request, unsigned bytes, epp_command_data **cdata_arg, epp_red_command_type *cmd_type) |
This is the main workhorse of parser component. | |
Variables | |
static cmd_hash_item * | hash_cmd [HASH_SIZE_CMD] |
Hash table of epp commands used for fast command lookup. |
Component for parsing EPP requests in form of xml documents.
The product is a data structure which contains data from xml document. This file also contains routine which handles deallocation of this structure. Currently the component is based on libxml library.
#define HASH_SIZE_CMD 30 |
Size of hash table used for hashing command names.
The size is tradeof between size of hash table and lookup speed, it should be less than 255 since hash value is unsigned char.
Referenced by cmd_hash_clean(), and get_cmd_hash().
#define TEXT_CONTENT | ( | _xpathObj, | |
_i | |||
) | ((char *) ((xmlXPathNodeSetItem((_xpathObj)->nodesetval, (_i))->xmlChildrenNode) ? (xmlXPathNodeSetItem((_xpathObj)->nodesetval, (_i))->xmlChildrenNode)->content : NULL)) |
Get text content of an element.
You have to copy the string from returned pointer if you want to manipulate with string. Note that if element is empty (e.g.
the child of this element is not empty string but NULL. This makes macro a bit more complicated.
Referenced by xpath_get1(), and xpath_getn().
static char cmd_hash_insert | ( | const char * | key, |
epp_command_type | type | ||
) | [static] |
Function inserts command in hash table.
key | Input key for hash algorithm |
type | Command type associated with given key |
References get_cmd_hash(), cmd_hash_item_t::key, cmd_hash_item_t::next, and cmd_hash_item_t::val.
Referenced by epp_parser_init().
static epp_command_type cmd_hash_lookup | ( | const char * | key | ) | [static] |
This routine does traditional lookup on hash table containing commands.
key | Command name. |
References get_cmd_hash(), cmd_hash_item_t::key, cmd_hash_item_t::next, and cmd_hash_item_t::val.
Referenced by parse_command().
parser_status epp_parse_command | ( | epp_context * | epp_ctx, |
int | loggedin, | ||
void * | schema, | ||
const char * | request, | ||
unsigned | bytes, | ||
epp_command_data ** | cdata, | ||
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_DEBUG, epp_malloc(), epplog(), epp_command_data::errors, NS_CONTACT, NS_DOMAIN, NS_ENUMVAL, NS_EPP, 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, epp_command_data::xml_in, XML_IN_ENC, 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().
static char* get_attr | ( | xmlNodePtr | node, |
const char * | name | ||
) | [static] |
This function returns specified attribute value of given node.
You have to make your own copy if you want to edit the returned string.
node | XPath object. |
name | Name of attribute. |
Referenced by parse_create_contact(), parse_poll(), parse_transfer(), parse_update_contact(), and xpath_get_attr().
static unsigned char get_cmd_hash | ( | const char * | key | ) | [static] |
Function for hashing of command name.
Function makes xor of first 4 bytes of command name, which is sufficient since first 4 letters are unique for all EPP commands. It is both simple and fast. We assume that command names are at least 4 bytes long and that there are no 2 command with the same first four letters - that's true for EPP commands.
key | Command name. |
References HASH_SIZE_CMD.
Referenced by cmd_hash_insert(), and cmd_hash_lookup().
static int new_error_item | ( | void * | pool, |
qhead * | errors, | ||
epp_errorspec | errspec | ||
) | [static] |
Create and enqueue new error item of specified type.
pool | Pool for memory allocations. |
errors | Error list where new error should be enqueued. |
errspec | Specific code of an error. |
References epp_malloc(), q_add(), epp_error::reason, epp_error::spec, and epp_error::value.
Referenced by parse_poll(), parse_transfer(), and parse_update_contact().
static void parse_check | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of EPP check command.
pool | Pool for memory allocations. |
xpathCtx | XPath context. |
cdata | Output of parsing stage. |
References CHK_XERR, epp_command_data::data, epp_calloc(), epps_check::ids, epp_command_data::rc, RESET_XERR, epp_command_data::type, XERR_CONSTR, XERR_OK, xpath_chroot(), and xpath_getn().
Referenced by parse_command().
static parser_status parse_command | ( | void * | pool, |
int | loggedin, | ||
epp_command_data * | cdata, | ||
epp_red_command_type * | cmd, | ||
xmlXPathContextPtr | xpathCtx | ||
) | [static] |
Generic parser of EPP command section.
From this function are further called dedicated parser handlers for individual commands.
pool | Memory pool. |
loggedin | True if user is logged in. |
cdata | Command data. |
cmd | Command type - output parameter |
xpathCtx | XPath context. |
References epp_command_data::clTRID, cmd_hash_lookup(), NS_ENUMVAL, parse_check(), parse_create(), parse_delete(), parse_ext_enumval_create(), parse_ext_enumval_renew(), parse_ext_enumval_update(), parse_info(), parse_login(), parse_poll(), parse_renew(), parse_transfer(), parse_update(), PARSER_CMD_LOGIN, PARSER_CMD_LOGOUT, PARSER_CMD_OTHER, PARSER_EINTERNAL, epp_command_data::rc, RESET_XERR, epp_command_data::type, XERR_OK, and xpath_get1().
Referenced by epp_parse_command().
static void parse_create | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of EPP create command.
pool | Pool for memory allocations. |
xpathCtx | XPath context. |
cdata | Output of parsing stage. |
References parse_create_contact(), parse_create_domain(), parse_create_keyset(), parse_create_nsset(), epp_command_data::rc, RESET_XERR, epp_command_data::type, XERR_CONSTR, XERR_OK, and xpath_chroot().
Referenced by parse_command().
static void parse_create_contact | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of EPP create-contact command.
pool | Pool for memory allocations. |
xpathCtx | XPath context. |
cdata | Output of parsing stage. |
References epp_discl::addr, epps_create_contact::authInfo, epp_postalInfo::cc, CHK_XERR, epp_postalInfo::city, epp_command_data::data, epps_create_contact::discl, epp_discl::email, epps_create_contact::email, epp_calloc(), epp_discl::fax, epps_create_contact::fax, epp_discl::flag, get_attr(), epps_create_contact::id, epp_discl::ident, epps_create_contact::ident, ident_UNKNOWN, epps_create_contact::identtype, epp_postalInfo::name, epp_discl::name, epps_create_contact::notify_email, epp_discl::notifyEmail, epp_postalInfo::org, epp_discl::org, parse_boolean(), epp_postalInfo::pc, epps_create_contact::pi, epp_command_data::rc, RESET_XERR, epp_postalInfo::sp, epp_postalInfo::streets, string2identtype(), epp_command_data::type, epp_discl::vat, epps_create_contact::vat, epp_discl::voice, epps_create_contact::voice, XERR_LIBXML, XERR_OK, xpath_chroot(), xpath_count(), xpath_get1(), xpath_get_attr(), and xpath_getn().
Referenced by parse_create().
static void parse_create_domain | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of EPP create-domain command.
pool | Pool for memory allocations. |
xpathCtx | XPath context. |
cdata | Output of parsing stage. |
References epps_create_domain::admin, epps_create_domain::authInfo, CHK_XERR, epp_command_data::data, epp_calloc(), epps_create_domain::keyset, epps_create_domain::name, epps_create_domain::nsset, epps_create_domain::period, epp_command_data::rc, epps_create_domain::registrant, RESET_XERR, epp_command_data::type, epps_create_domain::unit, xpath_get1(), and xpath_getn().
Referenced by parse_create().
static void parse_create_keyset | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of EPP create-keyset command.
pool | Pool for memory allocations. |
xpathCtx | XPath context. |
cdata | Output of parsing stage. |
References epps_create_keyset::authInfo, CHK_XERR, epp_command_data::data, epp_calloc(), epps_create_keyset::id, epps_create_keyset::keys, q_add(), epp_command_data::rc, read_epp_dnskey(), RESET_XERR, epps_create_keyset::tech, epp_command_data::type, xpath_get1(), and xpath_getn().
Referenced by parse_create().
static void parse_create_nsset | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of EPP create-nsset command.
pool | Pool for memory allocations. |
xpathCtx | XPath context. |
cdata | Output of parsing stage. |
References epp_ns::addr, epps_create_nsset::authInfo, CHK_XERR, epp_command_data::data, epp_calloc(), epps_create_nsset::id, epps_create_nsset::level, epp_ns::name, epps_create_nsset::ns, q_add(), epp_command_data::rc, RESET_XERR, epps_create_nsset::tech, epp_command_data::type, xpath_get1(), and xpath_getn().
Referenced by parse_create().
static void parse_delete | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of EPP delete command.
pool | Pool for memory allocations. |
xpathCtx | XPath context. |
cdata | Output of parsing stage. |
References CHK_XERR, epp_command_data::data, epp_calloc(), epp_command_data::rc, RESET_XERR, epp_command_data::type, XERR_CONSTR, XERR_OK, xpath_chroot(), and xpath_get1().
Referenced by parse_command().
static void parse_ext_enumval_create | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of enumval extension in context of create domain command.
pool | Pool for memory allocations. |
xpathCtx | XPath context. |
cdata | Output of parsing stage. |
References CHK_XERR, epp_command_data::data, epp_calloc(), epp_ext_item::ext, epp_ext_item::ext_enum, epp_ext_enum::ext_enumval, epps_create_domain::extensions, epp_ext_item::extType, parse_boolean(), epp_ext_enum::publish, q_add(), epp_command_data::rc, RESET_XERR, epp_command_data::type, and xpath_get1().
Referenced by parse_command().
static void parse_ext_enumval_renew | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of enumval extension in context of renew domain command.
pool | Pool for memory allocations. |
xpathCtx | XPath context. |
cdata | Output of parsing stage. |
References CHK_XERR, epp_command_data::data, epp_calloc(), epp_ext_item::ext, epp_ext_item::ext_enum, epp_ext_enum::ext_enumval, epps_renew::extensions, epp_ext_item::extType, parse_boolean(), epp_ext_enum::publish, q_add(), epp_command_data::rc, RESET_XERR, epp_command_data::type, and xpath_get1().
Referenced by parse_command().
static void parse_ext_enumval_update | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of enumval extension in context of update domain command.
pool | Pool for memory allocations. |
xpathCtx | XPath context. |
cdata | Output of parsing stage. |
References CHK_XERR, epp_command_data::data, epp_calloc(), epp_ext_item::ext, epp_ext_item::ext_enum, epp_ext_enum::ext_enumval, epps_update_domain::extensions, epp_ext_item::extType, parse_boolean(), epp_ext_enum::publish, q_add(), epp_command_data::rc, RESET_XERR, epp_command_data::type, and xpath_get1().
Referenced by parse_command().
static parser_status parse_extension | ( | void * | pool, |
epp_command_data * | cdata, | ||
xmlXPathContextPtr | xpathCtx | ||
) | [static] |
Generic parser of EPP extension section.
From this function are further called dedicated parser handlers for individual extensions.
pool | Memory pool. |
cdata | Command data. |
xpathCtx | XPath context. |
References epp_command_data::clTRID, epp_command_data::data, epp_calloc(), parse_infoKey(), parse_sendAuthInfo(), parse_test(), PARSER_CMD_OTHER, PARSER_EINTERNAL, epp_command_data::rc, RESET_XERR, epp_command_data::type, XERR_CONSTR, XERR_LIBXML, XERR_OK, xpath_chroot(), and xpath_get1().
Referenced by epp_parse_command().
static void parse_info | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of EPP info command + list command.
List command is a non-standard command for listing of registered objects. This makes info command very special since it may contain two different commands. Authinfo tag is ignored in info command.
pool | Pool for memory allocations. |
xpathCtx | XPath context. |
cdata | Output of parsing stage. |
References CHK_XERR, epp_command_data::data, epp_calloc(), epps_info_contact::id, epps_info_nsset::id, epps_info_keyset::id, epps_info_domain::name, epp_command_data::rc, RESET_XERR, epp_command_data::type, XERR_CONSTR, XERR_OK, xpath_chroot(), xpath_count(), and xpath_get1().
Referenced by parse_command().
static void parse_infoKey | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata, | ||
const char * | key | ||
) | [static] |
Parametrized parser of commands domainsByNsset, domainsByContact, nssetsByContact and nssetsByNs.
pool | Pool to allocate memory from. |
xpathCtx | Xpath context. |
cdata | Parsed data. |
key | Key used for search (for domain and ns it is name, otherwise it is id). |
References CHK_XERR, epp_command_data::data, epp_calloc(), epps_info::handle, epp_command_data::rc, RESET_XERR, epp_command_data::type, and xpath_get1().
Referenced by parse_extension().
static void parse_login | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of EPP login command.
pool | Pool for memory allocations. |
xpathCtx | XPath context. |
cdata | Output of parsing stage. |
References CHK_XERR, epps_login::clID, epp_command_data::data, epp_calloc(), epps_login::exturi, epps_login::lang, epps_login::newPW, epps_login::objuri, epps_login::pw, epp_command_data::rc, RESET_XERR, epp_command_data::type, xpath_get1(), and xpath_getn().
Referenced by parse_command().
static void parse_poll | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of EPP poll command.
This is for both poll variants - req and ack.
pool | Pool for memory allocations. |
xpathCtx | XPath context. |
cdata | Output of parsing stage. |
References epp_command_data::data, epp_calloc(), epp_strdup(), epp_command_data::errors, get_attr(), epps_poll_ack::msgid, new_error_item(), epp_command_data::rc, and epp_command_data::type.
Referenced by parse_command().
static void parse_renew | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of EPP renew command.
pool | Pool for memory allocations. |
xpathCtx | XPath context. |
cdata | Output of parsing stage. |
References CHK_XERR, epps_renew::curExDate, epp_command_data::data, epp_calloc(), epps_renew::name, epps_renew::period, epp_command_data::rc, RESET_XERR, epp_command_data::type, epps_renew::unit, xpath_chroot(), and xpath_get1().
Referenced by parse_command().
static void parse_sendAuthInfo | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of command sendAuthInfo.
pool | Pool to allocate memory from. |
xpathCtx | Xpath context. |
cdata | Parsed data. |
References CHK_XERR, epp_command_data::data, epp_calloc(), epps_sendAuthInfo::id, epp_command_data::rc, RESET_XERR, epp_command_data::type, XERR_LIBXML, XERR_OK, xpath_chroot(), and xpath_get1().
Referenced by parse_extension().
static void parse_test | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of command test.
pool | Pool to allocate memory from. |
xpathCtx | Xpath context. |
cdata | Parsed data. |
References CHK_XERR, epp_command_data::data, epp_calloc(), epps_test::id, epps_test::level, epps_test::names, epp_command_data::rc, RESET_XERR, epp_command_data::type, XERR_LIBXML, XERR_OK, xpath_chroot(), xpath_get1(), and xpath_getn().
Referenced by parse_extension().
static void parse_transfer | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of EPP transfer command.
pool | Pool for memory allocations. |
xpathCtx | XPath context. |
cdata | Output of parsing stage. |
References epps_transfer::authInfo, CHK_XERR, epp_command_data::data, epp_calloc(), epp_command_data::errors, get_attr(), epps_transfer::id, new_error_item(), epp_command_data::rc, RESET_XERR, epp_command_data::type, XERR_LIBXML, XERR_OK, xpath_chroot(), and xpath_get1().
Referenced by parse_command().
static void parse_update | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of EPP update command.
pool | Pool for memory allocations. |
xpathCtx | XPath context. |
cdata | Output of parsing stage. |
References parse_update_contact(), parse_update_domain(), parse_update_keyset(), parse_update_nsset(), epp_command_data::rc, RESET_XERR, epp_command_data::type, XERR_LIBXML, XERR_OK, and xpath_chroot().
Referenced by parse_command().
static void parse_update_contact | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of EPP update-contact command.
pool | Pool for memory allocations. |
xpathCtx | XPath context. |
cdata | Output of parsing stage. |
References epp_discl::addr, epps_update_contact::authInfo, epp_postalInfo::cc, CHK_XERR, epp_postalInfo::city, epp_command_data::data, epps_update_contact::discl, epp_discl::email, epps_update_contact::email, epp_calloc(), epp_command_data::errors, epp_discl::fax, epps_update_contact::fax, epp_discl::flag, get_attr(), epps_update_contact::id, epp_discl::ident, epps_update_contact::ident, ident_UNKNOWN, epps_update_contact::identtype, epp_postalInfo::name, epp_discl::name, new_error_item(), epps_update_contact::notify_email, epp_discl::notifyEmail, epp_postalInfo::org, epp_discl::org, epp_postalInfo::pc, epps_update_contact::pi, epp_command_data::rc, RESET_XERR, epp_postalInfo::sp, epp_postalInfo::streets, string2identtype(), epp_command_data::type, epp_discl::vat, epps_update_contact::vat, epp_discl::voice, epps_update_contact::voice, XERR_CONSTR, XERR_LIBXML, XERR_OK, xpath_chroot(), xpath_count(), xpath_get1(), xpath_get_attr(), and xpath_getn().
Referenced by parse_update().
static void parse_update_domain | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of EPP update-domain command.
pool | Pool for memory allocations. |
xpathCtx | XPath context. |
cdata | Output of parsing stage. |
References epps_update_domain::add_admin, epps_update_domain::authInfo, CHK_XERR, epp_command_data::data, epp_calloc(), epps_update_domain::keyset, epps_update_domain::name, epps_update_domain::nsset, epp_command_data::rc, epps_update_domain::registrant, epps_update_domain::rem_admin, epps_update_domain::rem_tmpcontact, RESET_XERR, epp_command_data::type, XERR_LIBXML, XERR_OK, xpath_chroot(), xpath_get1(), and xpath_getn().
Referenced by parse_update().
static void parse_update_keyset | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of EPP update-keyset command.
pool | Pool for memory allocations. |
xpathCtx | XPath context. |
cdata | Output of parsing stage. |
References epps_update_keyset::add_dnskey, epps_update_keyset::add_tech, epps_update_keyset::authInfo, CHK_XERR, epp_command_data::data, epp_calloc(), epps_update_keyset::id, q_add(), epp_command_data::rc, read_epp_dnskey(), epps_update_keyset::rem_dnskey, epps_update_keyset::rem_tech, RESET_XERR, epp_command_data::type, XERR_LIBXML, XERR_OK, xpath_chroot(), xpath_get1(), and xpath_getn().
Referenced by parse_update().
static void parse_update_nsset | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_command_data * | cdata | ||
) | [static] |
Parser of EPP update-nsset command.
pool | Pool for memory allocations. |
xpathCtx | XPath context. |
cdata | Output of parsing stage. |
References epps_update_nsset::add_ns, epps_update_nsset::add_tech, epp_ns::addr, epps_update_nsset::authInfo, CHK_XERR, epp_command_data::data, epp_calloc(), epps_update_nsset::id, epps_update_nsset::level, epp_ns::name, q_add(), epp_command_data::rc, epps_update_nsset::rem_ns, epps_update_nsset::rem_tech, RESET_XERR, epp_command_data::type, XERR_LIBXML, XERR_OK, xpath_chroot(), xpath_get1(), and xpath_getn().
Referenced by parse_update().
int read_epp_dnskey | ( | void * | pool, |
xmlXPathContextPtr | xpathCtx, | ||
epp_dnskey * | key | ||
) |
Read DNSKEY information from xml into epp_dnskey structure.
pool | Pool for allocating memory |
xpathCtx | XML parsing context |
key | DNSKEY structure filled with data |
References epp_dnskey::alg, CHK_XERR, epp_dnskey::flags, epp_dnskey::protocol, epp_dnskey::public_key, RESET_XERR, and xpath_get1().
Referenced by parse_create_keyset(), and parse_update_keyset().
static epp_identType string2identtype | ( | const char * | str | ) | [static] |
Routine converts string to ident type.
str | String to be compared and categorized. |
References ident_BIRTHDAY, ident_ICO, ident_MPSV, ident_OP, ident_PASSPORT, and ident_UNKNOWN.
Referenced by parse_create_contact(), and parse_update_contact().
cmd_hash_item* hash_cmd[HASH_SIZE_CMD] [static] |
Hash table of epp commands used for fast command lookup.
Once the table is initialized, it is read-only. There for it is thread-safe eventhough it is declared as static and not protected by a lock.