-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnlap.yang
More file actions
351 lines (293 loc) · 9.3 KB
/
Copy pathnlap.yang
File metadata and controls
351 lines (293 loc) · 9.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
module nlap {
yang-version 1.1;
namespace "urn:nlap:protocol:0.1";
prefix "nlap";
organization "NLAP Protocol Working Group";
contact "https://github.com/WEBcodeX1/http-1.2";
description
"YANG data model for the Next Level Application Protocol (NLAP).
Converted from nlap.dtd.
Sub-protocols covered:
NLAMP - Next Level Application Metadata Protocol
NLAFP - Next Level Application File Protocol
NLASP - Next Level Application Session Protocol
NLAPP - Next Level Application Proxy Protocol
NLAPS - Next Level Application Protocol Secure Extension
NOTE: result codes / enum definitions for 'Code', 'Subtype',
'Compression', 'Mime-Type' etc. are work in progress and will
be refined manually.";
revision 2026-05-12 {
description "Initial version derived from nlap.dtd.";
reference "specs/xml/nlap.dtd";
}
// ============================================================
// Typedef definitions
// ============================================================
typedef uuid-type {
type string {
pattern '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}'
+ '-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}';
}
description "RFC 4122 UUID string representation.";
}
typedef subtype-type {
type enumeration {
enum NLAMP {
description "Next Level Application Metadata Protocol.";
}
enum NLAFP {
description "Next Level Application File Protocol.";
}
enum NLASP {
description "Next Level Application Session Protocol.";
}
enum NLAPP {
description "Next Level Application Proxy Protocol.";
}
enum NLAPS {
description "Next Level Application Protocol Secure Extension.";
}
}
description "NLAP sub-protocol selector (maps to DTD element <Subtype>).";
}
typedef Compression-Type {
type enumeration {
enum none { description "No compression."; }
enum gzip { description "GZIP compression."; }
enum bzip2 { description "BZIP2 compression."; }
}
description
"Compression algorithm applied to the payload
(maps to DTD element <Compression>).
NOTE: enum values are WIP and may be extended.";
}
typedef flag-type {
type uint8 {
range "0..1";
}
description "Binary flag: 0 = disabled / false, 1 = enabled / true.";
}
// ============================================================
// Groupings
// ============================================================
grouping common-message-fields {
description "Fields common to both request and response messages.";
leaf UUID {
type uuid-type;
mandatory true;
description
"Universally unique identifier (RFC 4122) used for
request/response correlation.";
}
leaf Protocol {
type string;
default "NLAP";
description "Protocol name; always 'NLAP'.";
}
leaf Version {
type string;
description "Protocol version string, e.g. '0.1'.";
}
leaf Subtype {
type subtype-type;
mandatory true;
description "NLAP sub-protocol selector.";
}
}
grouping header-fields {
description
"Unified header containing all optional fields used across
request and response messages for all NLAP sub-protocols.";
container Header {
description "Message header (maps to DTD element <Header>).";
// --- Request header fields ---
leaf Host {
type string;
description
"Virtual host name, e.g. 'testapp1.local'
(maps to DTD element <Host>).";
}
leaf URL {
type string;
description
"Request path / resource URL, e.g. '/testpath/index.html'
(maps to DTD element <URL>).";
}
leaf User-Agent {
type string;
description
"Client identifier string, e.g. 'Falcon-Browser'
(maps to DTD element <User-Agent>).";
}
leaf user {
type string;
description
"Authenticated user identity used by NLAPS,
e.g. 'user1@domain.com'
(maps to DTD element <user>).";
}
// --- Response header fields ---
leaf Connection-Close {
type flag-type;
description
"Signal connection teardown after response:
0 = keep connection, 1 = close connection
(maps to DTD element <Connection-Close>).";
}
leaf Mime-Type {
type string;
description
"MIME type of the payload, e.g. 'text/html',
'application/json', 'image/png'
(maps to DTD element <Mime-Type>).
NOTE: enum definitions are WIP.";
}
leaf Encoding {
type string;
description
"Character or transfer encoding, e.g. 'UTF-8', 'binary'
(maps to DTD element <Encoding>).";
}
leaf Byte-Size {
type uint64;
description
"Total byte size of a single-part file payload
(maps to DTD element <Byte-Size>).";
}
// --- NLAFP multi-part transfer fields ---
leaf Byte-Size-Full {
type uint64;
description
"Total byte size of the complete file in a multi-part transfer
(maps to DTD element <Byte-Size-Full>).";
}
leaf Byte-Size-Part {
type uint64;
description
"Byte size of this individual part in a multi-part transfer
(maps to DTD element <Byte-Size-Part>).";
}
leaf Compression {
type Compression-Type;
description
"Compression algorithm applied to the payload
(maps to DTD element <Compression>).";
}
leaf file-UUID {
type uuid-type;
description
"UUID identifying the file across all parts of a multi-part
transfer (maps to DTD element <File-UUID>).";
}
leaf file-part-sum {
type uint32;
description
"Total number of parts in a multi-part transfer
(maps to DTD element <File-Part-Sum>).";
}
leaf file-part {
type uint32;
description
"Index of this part within the multi-part transfer (1-based)
(maps to DTD element <File-Part>).";
}
}
}
grouping security-fields {
description
"Security block used by the NLAPS sub-protocol
(maps to DTD element <Security>).";
container Security {
presence
"Security block is present when encryption or signing is used.";
description "NLAPS security extension fields.";
leaf Encryption {
type flag-type;
description
"Encryption flag: 0 = disabled, 1 = enabled
(maps to DTD element <Encryption>).";
}
leaf Signature {
type binary;
description
"Base64-encoded cryptographic signature of the payload
(maps to DTD element <Signature>).";
}
}
}
grouping status-fields {
description
"Result status block present in response messages
(maps to DTD element <Status>).";
container Status {
presence "Status block is included in the response.";
description "Result status of a response message.";
leaf Code {
type int32;
mandatory true;
description
"Numeric result code: 0 = success, non-zero = error
(maps to DTD element <Code>).
NOTE: full enum definitions are WIP.";
}
leaf Description {
type string;
description
"Human-readable description of the result or error condition
(maps to DTD element <Description>).";
}
leaf Exception {
type string;
description
"Exception detail string, e.g. a Python traceback line
(maps to DTD element <Exception>).";
}
}
}
// ============================================================
// Root container
// ============================================================
container NLAP {
description
"Root element of an NLAP protocol message
(maps to DTD element <NLAP>).";
choice message-type {
mandatory true;
description "A message is either a request or a response.";
case Request {
container Request {
description
"NLAP client request message
(maps to DTD element <Request>).";
uses common-message-fields;
uses header-fields;
uses security-fields;
anydata Payload {
description
"Request payload. May contain plain text (JSON, XML) or
base64-encoded binary data depending on the sub-protocol
(maps to DTD element <Payload>).";
}
}
}
case Response {
container Response {
description
"NLAP server response message
(maps to DTD element <Response>).";
uses common-message-fields;
uses header-fields;
uses security-fields;
anydata Payload {
description
"Response payload. May contain plain text (JSON,
inline HTML/XML) or base64-encoded binary data
depending on the sub-protocol
(maps to DTD element <Payload>).";
}
uses status-fields;
}
}
}
}
}