fred-mod-eppd-2.20.2
|
#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_gen.h"
#include "epp_xmlcommon.h"
Macros | |
#define | START_ELEMENT(writer, err_handler, elem) |
Wrapper around libxml's xmlTestWriterStartElement() function. More... | |
#define | WRITE_ELEMENT(writer, err_handler, elem, str) |
Wrapper around libxml's xmlTestWriterWriteElement() function. More... | |
#define | WRITE_STRING(writer, err_handler, str) |
Wrapper around libxml's xmlTestWriterWriteString() function. More... | |
#define | WRITE_ATTRIBUTE(writer, err_handler, attr_name, attr_value) |
Wrapper around libxml's xmlTestWriterWriteAttribute() function. More... | |
#define | END_ELEMENT(writer, err_handler) |
Wrapper around libxml's xmlTestWriterEndElement() function. More... | |
Functions | |
gen_status | epp_gen_greeting (void *pool, const char *svid, const char *date, const eppd_server_xml_conf *xml_schema, char **greeting) |
Routine makes up epp greeting frame. More... | |
static unsigned char | does_enabled_discloseflag_differ_from_default_policy (unsigned char is_enabled, epp_PrivacyPolicy discloseflag, epp_PrivacyPolicy default_policy) |
static char | gen_info_contact (xmlTextWriterPtr writer, epps_info_contact *info_contact, const eppd_server_xml_conf *xml_schema) |
This is assistant function for generating info contact <resData> xml subtree. More... | |
static char | gen_info_domain (xmlTextWriterPtr writer, epps_info_domain *info_domain) |
This is assistant function for generating info domain <resData> xml subtree. More... | |
static char | gen_info_nsset (xmlTextWriterPtr writer, epps_info_nsset *info_nsset) |
This is assistant function for generating info nsset <resData> xml subtree. More... | |
static char | gen_info_keyset (xmlTextWriterPtr writer, epps_info_keyset *info_keyset) |
This is assistant function for generating info keyset <resData> xml subtree. More... | |
static char | gen_poll_message (xmlTextWriterPtr writer, epps_poll_req *msgdata, const eppd_server_xml_conf *xml_schema) |
This is assistant function for generating poll message. More... | |
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. More... | |
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. More... | |
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, | ||
const eppd_server_xml_conf * | xml_schema, | ||
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. |
xml_schema | Entities enabled in xml schemas. |
greeting | Greeting string. |
References END_ELEMENT, GEN_EBUFFER, GEN_EWRITER, eppd_server_xml_conf::has_contact_mailing_address_extension, LOC_EPP, NS_CONTACT, NS_DOMAIN, NS_ENUMVAL, NS_EPP, NS_EXTRAADDR, NS_KEYSET, NS_NSSET, START_ELEMENT, WRITE_ATTRIBUTE, WRITE_ELEMENT, and XSI.
Referenced by epp_process_connection().
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 qhead::body, GEN_EBUFFER, GEN_EWRITER, LOC_EPP, NS_EPP, epp_command_data::rc, START_ELEMENT, WRITE_ATTRIBUTE, and XSI.
Referenced by gen_response().
|
static |
This is assistant function for generating info contact <resData> xml subtree.
writer | XML writer. |
info_contact | Data needed to generate XML. |
References epps_info_contact::authInfo, epp_postalInfo::cc, epp_postalInfo::city, epps_info_contact::clID, epps_info_contact::crDate, epps_info_contact::crID, epps_info_contact::email, END_ELEMENT, epps_info_contact::fax, epps_info_contact::handle, LOC_CONTACT, epp_postalInfo::name, NS_CONTACT, epp_postalInfo::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, epps_info_contact::voice, WRITE_ATTRIBUTE, WRITE_ELEMENT, and WRITE_STRING.
Referenced by gen_poll_message().
|
static |
This is assistant function for generating info domain <resData> xml subtree.
writer | XML writer. |
info_domain | 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 gen_poll_message().
|
static |
This is assistant function for generating info keyset <resData> xml subtree.
writer | XML writer. |
info_keyset | 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 gen_poll_message().
|
static |
This is assistant function for generating info nsset <resData> xml subtree.
writer | XML writer. |
info_nsset | 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 gen_poll_message().
|
static |
This is assistant function for generating poll message.
writer | XML writer. |
msgdata | Message data plus its type. |
References END_ELEMENT, gen_info_contact(), 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_contact, 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::upc, epps_poll_req::upd, epps_poll_req::upk, epps_poll_req::upn, WRITE_ATTRIBUTE, and WRITE_ELEMENT.
|
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_error::spec.