added first draft of SMP relax-ng schema
[strongswan.git] / src / charon / control / interfaces / xml_interface.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!-- strongSwan Managment Protocol (SMP) V1.0 -->
4
5 <!--
6 Copyright (C) 2007 Martin Willi
7 Copyright (C) 2006 Andreas Eigenmann, Joël Stillhart
8 Hochschule fuer Technik Rapperswil
9
10 This program is free software; you can redistribute it and/or modify it
11 under the terms of the GNU General Public License as published by the
12 Free Software Foundation; either version 2 of the License, or (at your
13 option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
14
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 for more details.
19 -->
20
21 <grammar xmlns="http://relaxng.org/ns/structure/1.0"
22 datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
23 ns="http://www.strongswan.org/smp/1.0">
24 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
25 <!-- Message -->
26 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
27 <start>
28 <element name="message">
29 <choice>
30 <group>
31 <attribute name="type">
32 <value>request</value>
33 </attribute>
34 <optional>
35 <element name="query">
36 <optional>
37 <ref name="QueryRequestIkesa"/>
38 </optional>
39 <!-- others -->
40 </element>
41 </optional>
42 <!-- others -->
43 </group>
44 <group>
45 <attribute name="type">
46 <value>response</value>
47 </attribute>
48 <choice>
49 <element name="error">
50 <attribute name="code">
51 <data type="string"/>
52 </attribute>
53 </element>
54 <group>
55 <optional>
56 <element name="query">
57 <optional>
58 <ref name="QueryResponseIkesa"/>
59 </optional>
60 <!-- others -->
61 </element>
62 </optional>
63 <!-- others -->
64 </group>
65 </choice>
66 </group>
67 </choice>
68 </element>
69 </start>
70 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
71 <!-- IKE SA query -->
72 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
73 <define name="QueryRequestIkesa">
74 <element name="ikesalist">
75 <empty/>
76 </element>
77 </define>
78 <define name="QueryResponseIkesa">
79 <element name="ikesalist">
80 <zeroOrMore>
81 <element name="ikesa">
82 <element name="id">
83 <data type="positiveInteger"/>
84 </element>
85 <element name="status">
86 <choice>
87 <value type="string">created</value>
88 <value type="string">connecting</value>
89 <value type="string">established</value>
90 <value type="string">rekeying</value>
91 <value type="string">deleting</value>
92 </choice>
93 </element>
94 <element name="role">
95 <choice>
96 <value type="string">initiator</value>
97 <value type="string">responder</value>
98 </choice>
99 </element>
100 <element name="peerconfig">
101 <data type="string"/>
102 </element>
103 <element name="local">
104 <ref name="endPoint"/>
105 </element>
106 <element name="remote">
107 <ref name="endPoint"/>
108 </element>
109 </element>
110 </zeroOrMore>
111 </element>
112 </define>
113 <define name="endPoint">
114 <element name="spi">
115 <data type="hexBinary" />
116 </element>
117 <element name="identification">
118 <ref name="identification"/>
119 </element>
120 <element name="address">
121 <ref name="address"/>
122 </element>
123 <element name="port">
124 <data type="nonNegativeInteger">
125 <param name="maxInclusive">65535</param>
126 </data>
127 </element>
128 <optional>
129 <element name="nat">
130 <data type="boolean"/>
131 </element>
132 </optional>
133 </define>
134 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
135 <!-- identification and address -->
136 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
137 <define name="identification">
138 <choice>
139 <group>
140 <attribute name="type">
141 <value>any</value>
142 </attribute>
143 <empty/>
144 </group>
145 <group>
146 <attribute name="type">
147 <value>ipv4</value>
148 </attribute>
149 <ref name="ipv4"/>
150 </group>
151 <group>
152 <attribute name="type">
153 <value>ipv6</value>
154 </attribute>
155 <ref name="ipv6"/>
156 </group>
157 <group>
158 <attribute name="type">
159 <value>fqdn</value>
160 </attribute>
161 <ref name="fqdn"/>
162 </group>
163 <group>
164 <attribute name="type">
165 <value>email</value>
166 </attribute>
167 <ref name="email"/>
168 </group>
169 <group>
170 <attribute name="type">
171 <value>asn1gn</value>
172 </attribute>
173 <data type="string"/>
174 </group>
175 <group>
176 <attribute name="type">
177 <value>asn1dn</value>
178 </attribute>
179 <data type="string"/>
180 </group>
181 <group>
182 <attribute name="type">
183 <value>keyid</value>
184 </attribute>
185 <data type="base64Binary"/>
186 </group>
187 </choice>
188 </define>
189 <define name="address">
190 <choice>
191 <group>
192 <attribute name="type">
193 <value>ipv4</value>
194 </attribute>
195 <ref name="ipv4"/>
196 </group>
197 <group>
198 <attribute name="type">
199 <value>ipv6</value>
200 </attribute>
201 <ref name="ipv6"/>
202 </group>
203 </choice>
204 </define>
205 <define name="ipv4">
206 <data type="string">
207 <param name="pattern">(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(/([0-9]|[1-2][0-9]|3[0-2]))?</param>
208 </data>
209 </define>
210 <define name="ipv6">
211 <data type="string">
212 <param name="pattern">([0-9a-fA-F]{1,4}:|:){1,7}([0-9a-fA-F]{1,4}|:)(/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8]))?</param>
213 </data>
214 </define>
215 <define name="fqdn">
216 <data type="string">
217 <param name="pattern">[a-z0-9\-](\.[a-z0-9\-]+)*</param>
218 </data>
219 </define>
220 <define name="email">
221 <data type="string">
222 <param name="pattern">[a-zA-Z0-9_\-\.]+@(([a-z0-9\-](\.[a-z0-9\-]+)*)|(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]))</param>
223 </data>
224 </define>
225 </grammar>