fred-mod-eppd-2.20.2
epp_xmlcommon.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2018 CZ.NIC, z. s. p. o.
3  *
4  * This file is part of FRED.
5  *
6  * FRED is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * FRED is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with FRED. If not, see <https://www.gnu.org/licenses/>.
18  */
26 #ifndef EPP_XMLCOMMON_H
27 #define EPP_XMLCOMMON_H
28 
29 #include <libxml/tree.h>
30 #include <libxml/xmlschemas.h>
31 
33 #define NS_EPP "urn:ietf:params:xml:ns:epp-1.0"
34 
35 #define NS_CONTACT "http://www.nic.cz/xml/epp/contact-1.6"
36 
37 #define NS_DOMAIN "http://www.nic.cz/xml/epp/domain-1.4"
38 
39 #define NS_NSSET "http://www.nic.cz/xml/epp/nsset-1.2"
40 
41 #define NS_KEYSET "http://www.nic.cz/xml/epp/keyset-1.3"
42 
43 #define NS_FRED "http://www.nic.cz/xml/epp/fred-1.5"
44 
45 #define NS_ENUMVAL "http://www.nic.cz/xml/epp/enumval-1.2"
46 
47 #define NS_EXTRAADDR "http://www.nic.cz/xml/epp/extra-addr-1.0"
48 
49 
51 #define LOC_EPP NS_EPP " epp-1.0.xsd"
52 
53 #define LOC_CONTACT NS_CONTACT " contact-1.6.1.xsd"
54 
55 #define LOC_DOMAIN NS_DOMAIN " domain-1.4.1.xsd"
56 
57 #define LOC_NSSET NS_NSSET " nsset-1.2.1.xsd"
58 
59 #define LOC_KEYSET NS_KEYSET " keyset-1.3.1.xsd"
60 
61 #define LOC_FRED NS_FRED " fred-1.5.0.xsd"
62 
63 #define LOC_ENUMVAL NS_ENUMVAL " enumval-1.2.0.xsd"
64 
65 #define LOC_EXTRAADDR NS_EXTRAADDR " extra-addr-1.0.xsd"
66 
70 typedef enum {
75 } valid_status;
76 
86 valid_status validate_doc(void *pool, xmlSchemaPtr schema, xmlDocPtr doc, qhead *err_list);
87 
101 char *epp_getSubtree(void *pool, epp_command_data *cdata, const char *xpath_expr, int position);
102 
103 #endif /* EPP_XMLCOMMON_H */
epp_getSubtree
char * epp_getSubtree(void *pool, epp_command_data *cdata, const char *xpath_expr, int position)
Get subtree of XML document based on xpath expression.
Definition: epp_xmlcommon.c:169
VAL_EINTERNAL
@ VAL_EINTERNAL
Internal error (malloc failed).
Definition: epp_xmlcommon.h:74
epp_error::reason
char * reason
Human readable reason of error.
Definition: epp_common.h:221
epp_strdup
char * epp_strdup(void *pool, const char *str)
Duplicate string from argument, the memory will be allocated from memory pool.
Definition: mod_eppd.c:404
valerr_ctx::doc
xmlDocPtr doc
XML document.
Definition: epp_xmlcommon.c:39
VAL_NOT_VALID
@ VAL_NOT_VALID
Document does not validate.
Definition: epp_xmlcommon.h:72
valid_status
valid_status
Enumaration of statuses returned by validator.
Definition: epp_xmlcommon.h:70
epp_error::spec
epp_errorspec spec
Specification of surrounding XML tags.
Definition: epp_common.h:212
valerr_ctx
This struct gathers context parameters used by error handler of libxml's validator.
Definition: epp_xmlcommon.c:35
epp_xmlcommon.h
VAL_ESCHEMA
@ VAL_ESCHEMA
Error when loading or parsing schema.
Definition: epp_xmlcommon.h:73
epp_malloc
void * epp_malloc(void *pool, unsigned size)
Allocate memory from memory pool.
epp_error::value
char * value
Client provided input which caused the error.
Definition: epp_common.h:206
qhead
Queue structure used on countless places throughout the program.
Definition: epp_common.h:309
valerr_ctx::pool
void * pool
Pool to allocate memory from.
Definition: epp_xmlcommon.c:37
epp_error
The struct represents one epp error in ExtValue element.
Definition: epp_common.h:203
validate_doc
valid_status validate_doc(void *pool, xmlSchemaPtr schema, xmlDocPtr doc, qhead *err_list)
Function for validating xml document.
Definition: epp_xmlcommon.c:136
epp_command_data::parsed_doc
void * parsed_doc
Parsed XML document tree.
Definition: epp_common.h:918
VAL_OK
@ VAL_OK
Document is valid.
Definition: epp_xmlcommon.h:71
valerr_ctx::err_list
qhead * err_list
List of encountered errors.
Definition: epp_xmlcommon.c:38
epp_command_data
This structure is central to the concept of the whole module.
Definition: epp_common.h:909
epp_common.h
epp_command_data::xpath_ctx
void * xpath_ctx
XPath context.
Definition: epp_common.h:919
q_add
int q_add(void *pool, qhead *head, void *data)
Add new item to a queue (the item will be enqueued at the end of queue).
Definition: epp_common.c:31