fred-mod-eppd-2.14.2
Data Structures | Macros | Typedefs | Functions | Variables
epp_parser.c File Reference

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...
 

Macros

#define HASH_SIZE_CMD   30
 Size of hash table used for hashing command names. More...
 
#define XML_IN_ENC   "UTF-8"
 Encoding for input xml in epp_command_data structure.
 
#define XERR_OK   0
 OK status. More...
 
#define XERR_LIBXML   1
 Error in function from libxml library. More...
 
#define XERR_ALLOC   2
 Memory allocation failed. More...
 
#define XERR_CONSTR   3
 Constraints given by caller were not fulfilled. More...
 
#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. More...
 

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. More...
 
static char * get_attr (xmlNodePtr node, const char *name)
 This function returns specified attribute value of given node. More...
 
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. More...
 
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. More...
 
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. More...
 
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). More...
 
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. More...
 
int parse_boolean (char *str)
 Parse a boolean value entered either as a number or as a string (true/false) More...
 
static unsigned char get_cmd_hash (const char *key)
 Function for hashing of command name. More...
 
static char cmd_hash_insert (const char *key, epp_command_type type)
 Function inserts command in hash table. More...
 
static epp_command_type cmd_hash_lookup (const char *key)
 This routine does traditional lookup on hash table containing commands. More...
 
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. More...
 
void epp_parser_init_cleanup (void *schema)
 This will cleanup command hash table, libxml's parser and release parsed xml schema. More...
 
void epp_parser_request_cleanup (void *cdata_arg)
 This will cleanup xpath context and parsed document tree. More...
 
static int new_error_item (void *pool, qhead *errors, epp_errorspec errspec)
 Create and enqueue new error item of specified type. More...
 
static void parse_login (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of EPP login command. More...
 
static void parse_check (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of EPP check command. More...
 
static void parse_info (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of EPP info command + list command. More...
 
static void parse_poll (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of EPP poll command. More...
 
static void parse_create_domain (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of EPP create-domain command. More...
 
static epp_identType string2identtype (const char *str)
 Routine converts string to ident type. More...
 
static void parse_create_contact (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of EPP create-contact command. More...
 
static void parse_create_nsset (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of EPP create-nsset command. More...
 
static void parse_create_keyset (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of EPP create-keyset command. More...
 
static void parse_create (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of EPP create command. More...
 
static void parse_delete (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of EPP delete command. More...
 
static void parse_renew (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of EPP renew command. More...
 
static void parse_update_domain (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of EPP update-domain command. More...
 
static void parse_update_contact (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of EPP update-contact command. More...
 
static void parse_update_keyset (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of EPP update-keyset command. More...
 
static void parse_update_nsset (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of EPP update-nsset command. More...
 
static void parse_update (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of EPP update command. More...
 
static void parse_transfer (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of EPP transfer command. More...
 
static void parse_sendAuthInfo (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of command sendAuthInfo. More...
 
static void parse_infoKey (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata, const char *key)
 Parametrized parser of commands domainsByNsset, domainsByContact, nssetsByContact and nssetsByNs. More...
 
static void parse_test (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of command test. More...
 
static void parse_ext_enumval_create (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of enumval extension in context of create domain command. More...
 
static void parse_ext_enumval_update (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of enumval extension in context of update domain command. More...
 
static void parse_ext_enumval_renew (void *pool, xmlXPathContextPtr xpathCtx, epp_command_data *cdata)
 Parser of enumval extension in context of renew domain command. More...
 
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. More...
 
static parser_status parse_extension (void *pool, epp_command_data *cdata, xmlXPathContextPtr xpathCtx)
 Generic parser of EPP extension section. More...
 
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. More...
 

Variables

static cmd_hash_itemhash_cmd [HASH_SIZE_CMD]
 Hash table of epp commands used for fast command lookup. More...
 

Detailed Description

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.

Macro Definition Documentation

#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().

Function Documentation

static char cmd_hash_insert ( const char *  key,
epp_command_type  type 
)
static

Function inserts command in hash table.

Parameters
keyInput key for hash algorithm
typeCommand type associated with given key
Returns
0 in case of success, 1 in case of failure (Theese non-standard return values are due to the way of their processing in epp_parser_init()).

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.

Parameters
keyCommand name.
Returns
Command type, if command is not found in hash table, value EPP_UNKNOWN_CMD is returned.

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.

Parameters
epp_ctxEpp context (pool, connection and session id).
loggedinTrue if client is logged in.
schemaParsed xml schema used for validation.
requestRequest to be processed.
bytesLength of the request.
cdataOutput of parsing stage (xml data converted to structure).
cmd_typeOutput of commnad type (used also by logging)
Returns
Status of parsing.

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, validate_doc(), 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.

Parameters
url_schemaXML schema location.
Returns
Parsed xml schema.

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.

Parameters
schemaParsed 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.

Parameters
cdata_argcdata 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.

Parameters
nodeXPath object.
nameName of attribute.
Returns
Pointer to attribute's value.

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.

Parameters
keyCommand name.
Returns
Hash value.

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.

Parameters
poolPool for memory allocations.
errorsError list where new error should be enqueued.
errspecSpecific code of an error.
Returns
0 in case of success otherwise 1.

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.

Parameters
poolPool for memory allocations.
xpathCtxXPath context.
cdataOutput 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.

Parameters
poolMemory pool.
loggedinTrue if user is logged in.
cdataCommand data.
cmdCommand type - output parameter
xpathCtxXPath context.
Returns
Status.

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.

Parameters
poolPool for memory allocations.
xpathCtxXPath context.
cdataOutput 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
static void parse_create_domain ( void *  pool,
xmlXPathContextPtr  xpathCtx,
epp_command_data cdata 
)
static
static void parse_create_keyset ( void *  pool,
xmlXPathContextPtr  xpathCtx,
epp_command_data cdata 
)
static

Parser of EPP create-keyset command.

Parameters
poolPool for memory allocations.
xpathCtxXPath context.
cdataOutput 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.

Parameters
poolPool for memory allocations.
xpathCtxXPath context.
cdataOutput 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.

Parameters
poolPool for memory allocations.
xpathCtxXPath context.
cdataOutput 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.

Parameters
poolPool for memory allocations.
xpathCtxXPath context.
cdataOutput 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.

Parameters
poolPool for memory allocations.
xpathCtxXPath context.
cdataOutput 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.

Parameters
poolPool for memory allocations.
xpathCtxXPath context.
cdataOutput 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.

Parameters
poolMemory pool.
cdataCommand data.
xpathCtxXPath context.
Returns
Status.

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.

Parameters
poolPool for memory allocations.
xpathCtxXPath context.
cdataOutput 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.

Parameters
poolPool to allocate memory from.
xpathCtxXpath context.
cdataParsed data.
keyKey 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.

Parameters
poolPool for memory allocations.
xpathCtxXPath context.
cdataOutput 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.

Parameters
poolPool for memory allocations.
xpathCtxXPath context.
cdataOutput 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.

Parameters
poolPool for memory allocations.
xpathCtxXPath context.
cdataOutput 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.

Parameters
poolPool to allocate memory from.
xpathCtxXpath context.
cdataParsed 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.

Parameters
poolPool to allocate memory from.
xpathCtxXpath context.
cdataParsed 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.

Parameters
poolPool for memory allocations.
xpathCtxXPath context.
cdataOutput 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.

Parameters
poolPool for memory allocations.
xpathCtxXPath context.
cdataOutput 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
static void parse_update_domain ( void *  pool,
xmlXPathContextPtr  xpathCtx,
epp_command_data cdata 
)
static
static void parse_update_keyset ( void *  pool,
xmlXPathContextPtr  xpathCtx,
epp_command_data cdata 
)
static
static void parse_update_nsset ( void *  pool,
xmlXPathContextPtr  xpathCtx,
epp_command_data cdata 
)
static
int read_epp_dnskey ( void *  pool,
xmlXPathContextPtr  xpathCtx,
epp_dnskey key 
)

Read DNSKEY information from xml into epp_dnskey structure.

Parameters
poolPool for allocating memory
xpathCtxXML parsing context
keyDNSKEY structure filled with data
Returns
1 on success, 0 on failure (goto error in other functions

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.

Parameters
strString to be compared and categorized.
Returns
If string is not matched, ident_UNKNOWN is returned.

References ident_BIRTHDAY, ident_ICO, ident_MPSV, ident_OP, ident_PASSPORT, and ident_UNKNOWN.

Referenced by parse_create_contact(), and parse_update_contact().

Variable Documentation

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.