Skip to content

Commit 8edf131

Browse files
authored
Merge pull request #193 from WEBcodeX1/copilot/create-xml-dtd-specifications
Add NLAP XML DTD and YANG model from protocol specs
2 parents 7c8dd4f + db89563 commit 8edf131

5 files changed

Lines changed: 668 additions & 162 deletions

File tree

specs/xml/NLAFP-XML-SPECS.md

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -5,87 +5,87 @@
55
### 2.1.1. Request (Static HTML File)
66

77
```xml
8-
<nlap>
9-
<request>
8+
<NLAP>
9+
<Request>
1010
<UUID>7ea45c8a-5193-4855-b9e8-77ae1b9d49ed</UUID>
11-
<protocol>NLAP</protocol>
12-
<version>0.1</version>
13-
<subtype>NLAFP</subtype>
14-
<header>
15-
<host>testapp1.local</host>
11+
<Protocol>NLAP</Protocol>
12+
<Version>0.1</Version>
13+
<Subtype>NLAFP</Subtype>
14+
<Header>
15+
<Host>testapp1.local</Host>
1616
<URL>/testpath/index.html</URL>
17-
<UserAgent>Falcon-Browser</UserAgent>
18-
</header>
19-
</request>
20-
</nlap>
17+
<User-Agent>Falcon-Browser</User-Agent>
18+
</Header>
19+
</Request>
20+
</NLAP>
2121
```
2222

2323
### 2.1.2. Response (Inline-HTML)
2424

2525
```xml
26-
<nlap>
27-
<response>
26+
<NLAP>
27+
<Response>
2828
<UUID>7ea45c8a-5193-4855-b9e8-77ae1b9d49ed</UUID>
29-
<protocol>NLAP</protocol>
30-
<version>0.1</version>
31-
<subtype>NLAFP</subtype>
32-
<header>
33-
<connection-close>1</connection-close>
34-
<mime-type>text/html</mime-type>
35-
<encoding>UTF-8</encoding>
36-
</header>
37-
<payload>
29+
<Protocol>NLAP</Protocol>
30+
<Version>0.1</Version>
31+
<Subtype>NLAFP</Subtype>
32+
<Header>
33+
<Connection-Close>1</Connection-Close>
34+
<Mime-Type>text/html</Mime-Type>
35+
<Encoding>UTF-8</Encoding>
36+
</Header>
37+
<Payload>
3838
<html>
3939
<body>
4040
<h1>FalconAS Server</h1>
4141
<p>Test-serving page, very old-school.</p>
4242
</body>
4343
</html>
44-
</payload>
45-
</response>
46-
</nlap>
44+
</Payload>
45+
</Response>
46+
</NLAP>
4747
```
4848

4949
## 2.2. Request / Response Encoded Files
5050

5151
### 2.2.1. Request (Static PNG Image)
5252

5353
```xml
54-
<nlap>
55-
<request>
54+
<NLAP>
55+
<Request>
5656
<UUID>9a728a72-34ac-9abc-2245-af65cbde66ff</UUID>
57-
<protocol>NLAP</protocol>
58-
<version>0.1</version>
59-
<subtype>NLAFP</subtype>
60-
<header>
61-
<host>testapp1.local</host>
57+
<Protocol>NLAP</Protocol>
58+
<Version>0.1</Version>
59+
<Subtype>NLAFP</Subtype>
60+
<Header>
61+
<Host>testapp1.local</Host>
6262
<URL>/testpath/nice-image.png</URL>
63-
<UserAgent>Falcon-Browser</UserAgent>
64-
</header>
65-
</request>
66-
</nlap>
63+
<User-Agent>Falcon-Browser</User-Agent>
64+
</Header>
65+
</Request>
66+
</NLAP>
6767
```
6868

6969
## 2.2.2. Response (Encoded File)
7070

7171
```xml
72-
<nlap>
73-
<response>
72+
<NLAP>
73+
<Response>
7474
<UUID>9a728a72-34ac-9abc-2245-af65cbde66ff</UUID>
75-
<protocol>NLAP</protocol>
76-
<version>0.1</version>
77-
<subtype>NLAFP</subtype>
78-
<header>
79-
<mime-type>image/png</mime-type>
80-
<byte-size>7342</byte-size>
81-
<compression>none</compression>
82-
<encoding>binary</encoding>
83-
</header>
84-
<payload>
75+
<Protocol>NLAP</Protocol>
76+
<Version>0.1</Version>
77+
<Subtype>NLAFP</Subtype>
78+
<Header>
79+
<Mime-Type>image/png</Mime-Type>
80+
<Byte-Size>7342</Byte-Size>
81+
<Compression>none</Compression>
82+
<Encoding>binary</Encoding>
83+
</Header>
84+
<Payload>
8585
[BINARY_PAYLOAD]
86-
</payload>
87-
</response>
88-
</nlap>
86+
</Payload>
87+
</Response>
88+
</NLAP>
8989
```
9090

9191
## 2.3. Sending Large Files In Parts
@@ -110,45 +110,45 @@ the configuration to chose between sending via `sendfile()` or NLAFP partial tra
110110
### 2.3.1. Request (Static BZIP Image)
111111

112112
```xml
113-
<nlap>
114-
<request>
113+
<NLAP>
114+
<Request>
115115
<UUID>f3477af2-1212-76af-3377-bc7721afbc7a</UUID>
116-
<protocol>NLAP</protocol>
117-
<version>0.1</version>
118-
<subtype>NLAFP</subtype>
119-
<header>
120-
<host>testapp1.local</host>
116+
<Protocol>NLAP</Protocol>
117+
<Version>0.1</Version>
118+
<Subtype>NLAFP</Subtype>
119+
<Header>
120+
<Host>testapp1.local</Host>
121121
<URL>/testpath/package.bz2</URL>
122-
<UserAgent>Falcon-Browser</UserAgent>
123-
</header>
124-
</request>
125-
</nlap>
122+
<User-Agent>Falcon-Browser</User-Agent>
123+
</Header>
124+
</Request>
125+
</NLAP>
126126
```
127127

128128
## 2.3.2. Partial Response (First Part)
129129

130130
```xml
131-
<nlap>
132-
<response>
131+
<NLAP>
132+
<Response>
133133
<UUID>f3477af2-1212-76af-3377-bc7721afbc7a</UUID>
134-
<protocol>NLAP</protocol>
135-
<version>0.1</version>
136-
<subtype>NLAFP</subtype>
137-
<header>
138-
<mime-type>application/bzip2</mime-type>
139-
<byte-size-full>3432132</byte-size-full>
140-
<byte-size-part>100000</byte-size-part>
141-
<compression>none</compression>
142-
<encoding>binary</encoding>
134+
<Protocol>NLAP</Protocol>
135+
<Version>0.1</Version>
136+
<Subtype>NLAFP</Subtype>
137+
<Header>
138+
<Mime-Type>application/bzip2</Mime-Type>
139+
<Byte-Size-Full>3432132</Byte-Size-Full>
140+
<Byte-Size-Part>100000</Byte-Size-Part>
141+
<Compression>none</Compression>
142+
<Encoding>binary</Encoding>
143143
<File-UUID>f3477af2-1212-76af-3377-bc7721afbc7a</File-UUID>
144144
<File-Part-Sum>35</File-Part-Sum>
145145
<File-Part>1</File-Part>
146-
</header>
147-
<payload>
146+
</Header>
147+
<Payload>
148148
[BINARY_PAYLOAD]
149-
</payload>
150-
</response>
151-
</nlap>
149+
</Payload>
150+
</Response>
151+
</NLAP>
152152
```
153153

154154
## 2.4. Signing Requests / Responses

specs/xml/NLAMP-XML-SPECS.md

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,69 +5,69 @@
55
### 1.1.1. Application Request (JSON)
66

77
```xml
8-
<nlap>
9-
<request>
8+
<NLAP>
9+
<Request>
1010
<UUID>9b327afe-27ae-2367-aef2-e42445e5b23a</UUID>
11-
<protocol>NLAP</protocol>
12-
<version>0.1</version>
13-
<subtype>NLAMP</subtype>
14-
<header>
15-
<host>testapp2.local</host>
11+
<Protocol>NLAP</Protocol>
12+
<Version>0.1</Version>
13+
<Subtype>NLAMP</Subtype>
14+
<Header>
15+
<Host>testapp2.local</Host>
1616
<URL>/python/service1</URL>
17-
<UserAgent>Falcon-Python-Client</UserAgent>
18-
</header>
19-
<payload>
17+
<User-Agent>Falcon-Python-Client</User-Agent>
18+
</Header>
19+
<Payload>
2020
{
2121
"param1": "string1",
2222
"param2": "string2",
2323
"param3": 100
2424
}
25-
</payload>
26-
</request>
27-
</nlap>
25+
</Payload>
26+
</Request>
27+
</NLAP>
2828
```
2929

3030
### 1.1.2. Data Response (JSON)
3131

3232
```xml
33-
<nlap>
34-
<response>
33+
<NLAP>
34+
<Response>
3535
<UUID>9b327afe-27ae-2367-aef2-e42445e5b23a</UUID>
36-
<protocol>NLAP</protocol>
37-
<version>0.1</version>
38-
<subtype>NLAMP</subtype>
39-
<header>
40-
<mime-type>application/json</mime-type>
41-
<encoding>UTF-8</encoding>
42-
</header>
43-
<payload>
36+
<Protocol>NLAP</Protocol>
37+
<Version>0.1</Version>
38+
<Subtype>NLAMP</Subtype>
39+
<Header>
40+
<Mime-Type>application/json</Mime-Type>
41+
<Encoding>UTF-8</Encoding>
42+
</Header>
43+
<Payload>
4444
{ "Result": 100 }
45-
</payload>
46-
<status>
47-
<code>0</code>
48-
</status>
49-
</response>
50-
</nlap>
45+
</Payload>
46+
<Status>
47+
<Code>0</Code>
48+
</Status>
49+
</Response>
50+
</NLAP>
5151
```
5252

5353
### 1.1.3. Failure Response
5454

5555
```xml
56-
<nlap>
57-
<response>
56+
<NLAP>
57+
<Response>
5858
<UUID>9b327afe-27ae-2367-aef2-e42445e5b23a</UUID>
59-
<protocol>NLAP</protocol>
60-
<version>0.1</version>
61-
<subtype>NLAMP</subtype>
62-
<header>
63-
<mime-type>application/xml</mime-type>
64-
<encoding>UTF-8</encoding>
65-
</header>
66-
<status>
67-
<code>10</code>
68-
<description>Application Exception</description>
69-
<exception>NameError: name 'test' is not defined</exception>
70-
</status>
71-
</response>
72-
</nlap>
59+
<Protocol>NLAP</Protocol>
60+
<Version>0.1</Version>
61+
<Subtype>NLAMP</Subtype>
62+
<Header>
63+
<Mime-Type>application/xml</Mime-Type>
64+
<Encoding>UTF-8</Encoding>
65+
</Header>
66+
<Status>
67+
<Code>10</Code>
68+
<Description>Application Exception</Description>
69+
<Exception>NameError: name 'test' is not defined</Exception>
70+
</Status>
71+
</Response>
72+
</NLAP>
7373
```

0 commit comments

Comments
 (0)