fred-mod-eppd-2.12.0
|
Component for generating greeting frame and responses to EPP commands in form of xml documents. More...
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <libxml/parser.h>
#include <libxml/xmlschemas.h>
#include <libxml/xmlwriter.h>
#include "epp_common.h"
#include "epp_xmlcommon.h"
#include "epp_gen.h"
Defines | |
#define | START_ELEMENT(writer, err_handler, elem) |
Wrapper around libxml's xmlTestWriterStartElement() function. | |
#define | WRITE_ELEMENT(writer, err_handler, elem, str) |
Wrapper around libxml's xmlTestWriterWriteElement() function. | |
#define | WRITE_STRING(writer, err_handler, str) |
Wrapper around libxml's xmlTestWriterWriteString() function. | |
#define | WRITE_ATTRIBUTE(writer, err_handler, attr_name, attr_value) |
Wrapper around libxml's xmlTestWriterWriteAttribute() function. | |
#define | END_ELEMENT(writer, err_handler) |
Wrapper around libxml's xmlTestWriterEndElement() function. | |
Functions | |
gen_status | epp_gen_greeting (void *pool, const char *svid, const char *date, char **greeting) |
Routine makes up epp greeting frame. | |
static char | gen_info_contact (xmlTextWriterPtr writer, epp_command_data *cdata) |
This is assistant function for generating info contact <resData> xml subtree. | |
static char | gen_info_domain (xmlTextWriterPtr writer, epps_info_domain *info_domain) |
This is assistant function for generating info domain <resData> xml subtree. | |
static char | gen_info_nsset (xmlTextWriterPtr writer, epps_info_nsset *info_nsset) |
This is assistant function for generating info nsset <resData> xml subtree. | |
static char | gen_info_keyset (xmlTextWriterPtr writer, epps_info_keyset *info_keyset) |
This is assistant function for generating info keyset <resData> xml subtree. | |
static char | gen_poll_message (xmlTextWriterPtr writer, epps_poll_req *msgdata) |
This is assistant function for generating poll message. | |
static char * | get_bad_xml (void *pool, epp_command_data *cdata, epp_error *e) |
Function gets element (including its content) from input XML document which caused an error. | |
gen_status | epp_gen_response (epp_context *epp_ctx, int validate, void *schema, epp_lang lang, epp_command_data *cdata, char **response, qhead *valerr) |
Generate command response in XML format. |
Component for generating greeting frame and responses to EPP commands in form of xml documents.
Result of generator is the generated string and validation errors if validation of responses is turned on. Greeting frame is not validated, therefore only string is returned (without the list of validation errors).
gen_status epp_gen_greeting | ( | void * | pool, |
const char * | svid, | ||
const char * | date, | ||
char ** | greeting | ||
) |
Routine makes up epp greeting frame.
pool | Pool to allocate memory from. |
svid | Part of server ID used in svid tag. |
date | Current date as returned from server. |
greeting | Greeting string. |
References END_ELEMENT, epp_strdup(), GEN_EBUFFER, GEN_EBUILD, GEN_EWRITER, GEN_OK, LOC_EPP, NS_CONTACT, NS_DOMAIN, NS_ENUMVAL, NS_EPP, NS_KEYSET, NS_NSSET, START_ELEMENT, WRITE_ATTRIBUTE, WRITE_ELEMENT, and XSI.
Referenced by epp_process_connection(), and epp_request_loop().
gen_status epp_gen_response | ( | epp_context * | epp_ctx, |
int | validate, | ||
void * | schema, | ||
epp_lang | lang, | ||
epp_command_data * | cdata, | ||
char ** | response, | ||
qhead * | valerr | ||
) |
Generate command response in XML format.
There is option that response can be validated, the validation errors are then returned together with generated string in form of a list.
epp_ctx | Epp context (session id, connection and pool). |
validate | Tells if response should be validated or not (boolean). |
schema | Schema against which to validate. |
lang | Language selected by the client. |
cdata | Input values |
response | Result of generation phase = generated string. |
valerr | List of validation errors if validation is turned on. |
References epp_avail::avail, epps_check::avails, qhead::body, epp_command_data::clTRID, epps_poll_req::count, epps_poll_ack::count, epps_info::count, epps_create_contact::crDate, epps_create_domain::crDate, epps_create_nsset::crDate, epps_create_keyset::crDate, epp_zonecredit::credit, epp_command_data::data, END_ELEMENT, epp_strdup(), epp_command_data::errors, epps_create_domain::exDate, epps_renew::exDate, epp_ext_item::ext, epp_ext_item::ext_enum, epp_ext_enum::ext_enumval, epps_info_domain::extensions, epp_ext_item::extType, GEN_EBUFFER, GEN_EBUILD, GEN_EINTERNAL, GEN_ESCHEMA, GEN_EWRITER, gen_info_contact(), gen_info_domain(), gen_info_keyset(), gen_info_nsset(), GEN_NOT_VALID, GEN_NOT_XML, GEN_OK, gen_poll_message(), get_bad_xml(), epps_list::handles, epps_create_contact::id, epps_create_nsset::id, epps_create_keyset::id, epps_check::ids, LOC_CONTACT, LOC_DOMAIN, LOC_ENUMVAL, LOC_EPP, LOC_FRED, LOC_KEYSET, LOC_NSSET, epp_command_data::msg, epps_poll_req::msgid, epps_create_domain::name, epps_renew::name, epps_poll_ack::newmsgid, epp_command_data::noresdata, NS_CONTACT, NS_DOMAIN, NS_ENUMVAL, NS_EPP, NS_FRED, NS_KEYSET, NS_NSSET, epp_context::pool, epp_ext_enum::publish, q_content, q_foreach, q_next, q_reset, epps_poll_req::qdate, epp_command_data::rc, epp_error::reason, epp_avail::reason, epp_error::spec, START_ELEMENT, epp_command_data::svTRID, epp_command_data::type, VAL_EINTERNAL, VAL_ESCHEMA, VAL_NOT_VALID, VAL_OK, epp_error::value, WRITE_ATTRIBUTE, WRITE_ELEMENT, WRITE_STRING, XSI, epp_zonecredit::zone, and epps_creditInfo::zonecredits.
Referenced by gen_response().
static char gen_info_contact | ( | xmlTextWriterPtr | writer, |
epp_command_data * | cdata | ||
) | [static] |
This is assistant function for generating info contact <resData> xml subtree.
writer | XML writer. |
cdata | Data needed to generate XML. |
References epp_discl::addr, epps_info_contact::authInfo, epp_postalInfo::cc, epp_postalInfo::city, epps_info_contact::clID, epps_info_contact::crDate, epps_info_contact::crID, epp_command_data::data, epps_info_contact::discl, epp_discl::email, epps_info_contact::email, END_ELEMENT, epp_discl::fax, epps_info_contact::fax, epp_discl::flag, epps_info_contact::handle, epp_discl::ident, epps_info_contact::ident, ident_BIRTHDAY, ident_ICO, ident_MPSV, ident_OP, ident_PASSPORT, epps_info_contact::identtype, LOC_CONTACT, epp_postalInfo::name, epp_discl::name, epps_info_contact::notify_email, epp_discl::notifyEmail, NS_CONTACT, epp_postalInfo::org, epp_discl::org, epp_postalInfo::pc, epps_info_contact::pi, q_content, q_foreach, epps_info_contact::roid, epp_postalInfo::sp, START_ELEMENT, epps_info_contact::status, epp_postalInfo::streets, epp_status::text, epps_info_contact::trDate, epps_info_contact::upDate, epps_info_contact::upID, epp_status::value, epp_discl::vat, epps_info_contact::vat, epp_discl::voice, epps_info_contact::voice, WRITE_ATTRIBUTE, WRITE_ELEMENT, and WRITE_STRING.
Referenced by epp_gen_response().
static char gen_info_domain | ( | xmlTextWriterPtr | writer, |
epps_info_domain * | info_domain | ||
) | [static] |
This is assistant function for generating info domain <resData> xml subtree.
writer | XML writer. |
cdata | Data needed to generate XML. |
References epps_info_domain::admin, epps_info_domain::authInfo, epps_info_domain::clID, epps_info_domain::crDate, epps_info_domain::crID, END_ELEMENT, epps_info_domain::exDate, epps_info_domain::handle, epps_info_domain::keyset, LOC_DOMAIN, NS_DOMAIN, epps_info_domain::nsset, q_content, q_foreach, epps_info_domain::registrant, epps_info_domain::roid, START_ELEMENT, epps_info_domain::status, epp_status::text, epps_info_domain::tmpcontact, epps_info_domain::trDate, epps_info_domain::upDate, epps_info_domain::upID, epp_status::value, WRITE_ATTRIBUTE, WRITE_ELEMENT, and WRITE_STRING.
Referenced by epp_gen_response(), and gen_poll_message().
static char gen_info_keyset | ( | xmlTextWriterPtr | writer, |
epps_info_keyset * | info_keyset | ||
) | [static] |
This is assistant function for generating info keyset <resData> xml subtree.
writer | XML writer. |
cdata | Data needed to generate XML. |
References epp_dnskey::alg, epps_info_keyset::authInfo, epps_info_keyset::clID, epps_info_keyset::crDate, epps_info_keyset::crID, END_ELEMENT, epp_dnskey::flags, epps_info_keyset::handle, epps_info_keyset::keys, LOC_KEYSET, NS_KEYSET, epp_dnskey::protocol, epp_dnskey::public_key, q_content, q_foreach, epps_info_keyset::roid, START_ELEMENT, epps_info_keyset::status, epps_info_keyset::tech, epp_status::text, epps_info_keyset::trDate, epps_info_keyset::upDate, epps_info_keyset::upID, epp_status::value, WRITE_ATTRIBUTE, WRITE_ELEMENT, and WRITE_STRING.
Referenced by epp_gen_response(), and gen_poll_message().
static char gen_info_nsset | ( | xmlTextWriterPtr | writer, |
epps_info_nsset * | info_nsset | ||
) | [static] |
This is assistant function for generating info nsset <resData> xml subtree.
writer | XML writer. |
cdata | Data needed to generate XML. |
References epp_ns::addr, epps_info_nsset::authInfo, epps_info_nsset::clID, epps_info_nsset::crDate, epps_info_nsset::crID, END_ELEMENT, epps_info_nsset::handle, epps_info_nsset::level, LOC_NSSET, epp_ns::name, epps_info_nsset::ns, NS_NSSET, q_content, q_foreach, epps_info_nsset::roid, START_ELEMENT, epps_info_nsset::status, epps_info_nsset::tech, epp_status::text, epps_info_nsset::trDate, epps_info_nsset::upDate, epps_info_nsset::upID, epp_status::value, WRITE_ATTRIBUTE, WRITE_ELEMENT, and WRITE_STRING.
Referenced by epp_gen_response(), and gen_poll_message().
static char gen_poll_message | ( | xmlTextWriterPtr | writer, |
epps_poll_req * | msgdata | ||
) | [static] |
This is assistant function for generating poll message.
writer | XML writer. |
msgdata | Message data plus its type. |
References END_ELEMENT, gen_info_domain(), gen_info_keyset(), gen_info_nsset(), epps_poll_req::hd, epps_poll_req::hdt, epps_poll_req::lc, LOC_CONTACT, LOC_DOMAIN, LOC_ENUMVAL, LOC_FRED, LOC_KEYSET, LOC_NSSET, epps_poll_req::msg, NS_CONTACT, NS_DOMAIN, NS_ENUMVAL, NS_FRED, NS_KEYSET, NS_NSSET, pt_delete_contact, pt_delete_domain, pt_delete_keyset, pt_delete_nsset, pt_expiration, pt_impexpiration, pt_impvalidation, pt_lowcredit, pt_outzone, pt_request_fee_info, pt_techcheck, pt_transfer_contact, pt_transfer_domain, pt_transfer_keyset, pt_transfer_nsset, pt_update_domain, pt_update_keyset, pt_update_nsset, pt_validation, q_content, q_foreach, epps_poll_req::rfi, START_ELEMENT, epps_poll_req::tc, epps_poll_req::type, epps_poll_req::upd, epps_poll_req::upk, epps_poll_req::upn, WRITE_ATTRIBUTE, and WRITE_ELEMENT.
Referenced by epp_gen_response().
static char* get_bad_xml | ( | void * | pool, |
epp_command_data * | cdata, | ||
epp_error * | e | ||
) | [static] |
Function gets element (including its content) from input XML document which caused an error.
This must be done according to EPP standard.
pool | Pool to allocate memory from. |
cdata | Command data containing xpath context and parsed document. |
e | Error specification. |
References epp_strdup(), epp_error::position, and epp_error::spec.
Referenced by epp_gen_response().