cddl 0.1.0 → 0.8.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/bin/cddl +80 -23
- data/cddl.gemspec +4 -2
- data/data/cddl.abnf +50 -20
- data/data/prelude.cddl +9 -3
- data/lib/cbor-pp-play.rb +13 -0
- data/lib/cbor-pp.rb +213 -0
- data/lib/cddl.rb +1001 -163
- data/test/test-cddl.rb +1620 -93
- data/test-data/7071-concise-cut.cddl +48 -0
- data/test-data/7071-concise.cddl +1 -1
- data/test-data/7071-verbose.cddl +1 -1
- data/test-data/a.cddl +9 -0
- data/test-data/ambig.cddl +2 -0
- data/test-data/b.cddl +3 -0
- data/test-data/badaddr.cddl +1 -0
- data/test-data/basic_syntax_example.cddl +7 -0
- data/test-data/cdni-ct.cddl +72 -0
- data/test-data/cose.cddl +68 -0
- data/test-data/dcaf.cddl +58 -0
- data/test-data/dcaf1.cddl +48 -0
- data/test-data/dotsize.cddl +7 -0
- data/test-data/extractor-demo.cddl +14 -0
- data/test-data/grasp-01-extract.cddl +91 -0
- data/test-data/grasp-01-test.cddl +90 -0
- data/test-data/grasp-01.cddl +90 -0
- data/test-data/grasp-09.cddl +108 -0
- data/test-data/grasp-v1.cddl +97 -0
- data/test-data/grasp-v2X.cddl +89 -0
- data/test-data/ifmap-base-2.0v17.cddl +392 -0
- data/test-data/ifmap-base-2.2v9_fh-cabo.cddl +149 -0
- data/test-data/ifmap-metadata-2.2v9_fh-cabo.cddl +239 -0
- data/test-data/ifmap2.cddl +21 -0
- data/test-data/jcr-ex.cddl +42 -0
- data/test-data/kevin5.cddl +5 -0
- data/test-data/map-group.cddl +13 -0
- data/test-data/mapkey.cddl +2 -0
- data/test-data/minimal.cddl +1 -0
- data/test-data/patch1.cddl +13 -0
- data/test-data/reused_named_group.cddl +14 -0
- data/test-data/structure.cddl +9 -0
- data/test-data/toerless0.cddl +14 -0
- data/test-data/toerless1.cddl +11 -0
- data/test-data/two_anonymous_groups.cddl +13 -0
- data/test-data/wrong1.cddl +17 -0
- data/test-data/wrong1a.cddl +23 -0
- data/test-data/wrong2.cddl +17 -0
- data/test-data/wrong2a.cddl +17 -0
- data/test-data/xmlmig.cddl +15 -0
- metadata +72 -5
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
reputation-object = {
|
|
2
|
+
application: tstr
|
|
3
|
+
reputons: [* reputon]
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
reputon = {
|
|
7
|
+
rater: tstr
|
|
8
|
+
assertion: tstr
|
|
9
|
+
rated: tstr
|
|
10
|
+
rating: float16
|
|
11
|
+
? confidence: float16
|
|
12
|
+
? normal-rating: float16
|
|
13
|
+
? sample-size: uint
|
|
14
|
+
? generated: uint
|
|
15
|
+
? expires: uint
|
|
16
|
+
* tstr => any
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
#
|
|
20
|
+
# a = b / c / d
|
|
21
|
+
# a = b / (c / d)
|
|
22
|
+
# b = "foo" ^ bar
|
|
23
|
+
# c = "bar" ^ baz
|
|
24
|
+
|
|
25
|
+
# foo: bar
|
|
26
|
+
# "foo" ^ => bar
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
# (rater: tstr // rater: uint)
|
|
30
|
+
# (rater: tstr / uint)
|
|
31
|
+
|
|
32
|
+
# (
|
|
33
|
+
# * tstr => uint
|
|
34
|
+
# rater: float16
|
|
35
|
+
# )
|
|
36
|
+
|
|
37
|
+
# a = b / c
|
|
38
|
+
# c = e / f
|
|
39
|
+
# a = b / (e / f)
|
|
40
|
+
|
|
41
|
+
# a = ( a // b )
|
|
42
|
+
# a = ( b // a )
|
|
43
|
+
|
|
44
|
+
# a = (uint .size 3) .le 100000
|
|
45
|
+
|
|
46
|
+
# name = uint .size 3
|
|
47
|
+
# reserved_name = name .le 100000
|
|
48
|
+
|
data/test-data/7071-concise.cddl
CHANGED
data/test-data/7071-verbose.cddl
CHANGED
data/test-data/a.cddl
ADDED
data/test-data/b.cddl
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
badaddr = text .regexp "[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]"
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
; draft-ietf-cdni-control-triggers-06.txt
|
|
2
|
+
|
|
3
|
+
CIT-object = CIT-command / Trigger-Status-Resource / Trigger-Collection
|
|
4
|
+
|
|
5
|
+
CIT-command ; use media type application/cdni.ci.TriggerCommand+json
|
|
6
|
+
= {
|
|
7
|
+
? trigger: Triggerspec
|
|
8
|
+
? cancel: [* URI]
|
|
9
|
+
cdn-path: [* Cdn-PID]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
Trigger-Status-Resource ; application/cdni.ci.TriggerStatus+json.
|
|
13
|
+
= {
|
|
14
|
+
trigger: Triggerspec
|
|
15
|
+
ctime: Absolute-Time
|
|
16
|
+
mtime: Absolute-Time
|
|
17
|
+
? etime: Absolute-Time
|
|
18
|
+
status: Trigger-Status
|
|
19
|
+
? errors: [* Error-Description]
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
Trigger-Collection ; application/cdni.ci.TriggerCollection+json
|
|
23
|
+
= {
|
|
24
|
+
triggers: [* URI]
|
|
25
|
+
? staleresourcetime: int ; time in seconds
|
|
26
|
+
? coll-all: URI
|
|
27
|
+
? coll-pending: URI
|
|
28
|
+
? coll-active: URI
|
|
29
|
+
? coll-complete: URI
|
|
30
|
+
? coll-failed: URI
|
|
31
|
+
? cdn-id: Cdn-PID
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
Triggerspec = { ; 5.2.1
|
|
35
|
+
type: Trigger-Type
|
|
36
|
+
? metadata.urls: [* URI]
|
|
37
|
+
? content.urls: [* URI]
|
|
38
|
+
? content.ccid: [* Ccid]
|
|
39
|
+
? metadata.patterns: [* Pattern-Match]
|
|
40
|
+
? content.patterns: [* Pattern-Match]
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
Trigger-Type = "preposition" / "invalidate" / "purge" ; 5.2.2
|
|
44
|
+
|
|
45
|
+
Trigger-Status = "pending" / "active" / "complete" / "processed"
|
|
46
|
+
/ "failed" / "cancelling" / "cancelled" ; 5.2.3
|
|
47
|
+
|
|
48
|
+
Pattern-Match = { ; 5.2.4
|
|
49
|
+
pattern: tstr
|
|
50
|
+
? case-sensitive: bool
|
|
51
|
+
? match-query-string: bool
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
Absolute-Time = number ; seconds since UNIX epoch, 5.2.5
|
|
55
|
+
|
|
56
|
+
Error-Description = { ; 5.2.6
|
|
57
|
+
error: Error-Code
|
|
58
|
+
? metadata.urls: [* URI]
|
|
59
|
+
? content.urls: [* URI]
|
|
60
|
+
? metadata.patterns: [* Pattern-Match]
|
|
61
|
+
? content.patterns: [* Pattern-Match]
|
|
62
|
+
? description: tstr
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
Error-Code = "emeta" / "econtent" / "eperm" / "ereject"
|
|
66
|
+
/ "ecdn" / "ecancelled" ; 5.2.7
|
|
67
|
+
|
|
68
|
+
Ccid = tstr ; see I-D.ietf-cdni-metadata
|
|
69
|
+
|
|
70
|
+
Cdn-PID = tstr .regexp "AS[0-9]+:[0-9]+"
|
|
71
|
+
|
|
72
|
+
URI = tstr
|
data/test-data/cose.cddl
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
COSE_MSG = [ 1, COSE_Sign ] / [2, COSE_encrypt] / [3, COSE_mac]
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
COSE_Sign = (
|
|
5
|
+
headers,
|
|
6
|
+
payload : opt<bstr>,
|
|
7
|
+
signatures: ([+[COSE_signature]] / [COSE_signature])
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
COSE_SignMessage = #6.999([ COSE_Sign ])
|
|
11
|
+
|
|
12
|
+
keys = int / tstr
|
|
13
|
+
header_map = {+ keys => any}
|
|
14
|
+
|
|
15
|
+
opt<t> = t / nil
|
|
16
|
+
|
|
17
|
+
headers = (
|
|
18
|
+
protected: opt<bstr>,
|
|
19
|
+
unprotected: opt<header_map>
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
COSE_signature = (
|
|
23
|
+
headers,
|
|
24
|
+
signaturne : bstr
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
Sig_structure = [
|
|
28
|
+
headers,
|
|
29
|
+
payload : bstr
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
COSE_encrypt = (
|
|
33
|
+
headers,
|
|
34
|
+
iv : opt<bstr>,
|
|
35
|
+
aad : opt<bstr>,
|
|
36
|
+
ciphertext : opt<bstr>,
|
|
37
|
+
recipients : ([+COSE_encrypt_a] / [COSE_encrypt] / nil)
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
COSE_encrypt_a = [COSE_encrypt]
|
|
41
|
+
|
|
42
|
+
Enc_structure = [
|
|
43
|
+
protected : opt<bstr>,
|
|
44
|
+
aad : opt<bstr>
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
COSE_mac = (
|
|
48
|
+
headers,
|
|
49
|
+
payload : bstr,
|
|
50
|
+
tag : bstr,
|
|
51
|
+
recipients : ([+COSE_encrypt_a] / [COSE_encrypt] / nil)
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
MAC_structure = [
|
|
55
|
+
protected : opt<bstr>
|
|
56
|
+
payload : bstr
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
COSE_Key = {
|
|
60
|
+
"kty" : tstr,
|
|
61
|
+
? "use" : tstr,
|
|
62
|
+
? "key_ops" : [+tstr],
|
|
63
|
+
? "alg" : tstr,
|
|
64
|
+
? "kid" : tstr,
|
|
65
|
+
* keys => values
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
COSE_KeySet = [+COSE_Key]
|
data/test-data/dcaf.cddl
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
dcaf-msg = sam-information-msg
|
|
2
|
+
/ access-request-msg
|
|
3
|
+
/ ticket-transfer-msg
|
|
4
|
+
/ ticket-grant-msg
|
|
5
|
+
|
|
6
|
+
sam-information-msg = { sam, ? full-timestamp, ? accepted-formats,
|
|
7
|
+
? piggybacked }
|
|
8
|
+
|
|
9
|
+
access-request-msg = { sam, sam-ai, full-timestamp }
|
|
10
|
+
|
|
11
|
+
ticket-transfer-msg = { face-or-encrypted, verifier }
|
|
12
|
+
face-or-encrypted = ( face // encrypted-face )
|
|
13
|
+
face = ( F => { sam-ai, limited-timestamp, lifetime, psk-gen } )
|
|
14
|
+
verifier = ( V => shared-secret )
|
|
15
|
+
shared-secret = bstr
|
|
16
|
+
F = 8
|
|
17
|
+
V = 9
|
|
18
|
+
|
|
19
|
+
encrypted-face = ( E => bstr, K => tstr )
|
|
20
|
+
E = 3
|
|
21
|
+
K = 4
|
|
22
|
+
|
|
23
|
+
ticket-grant-msg = { face-or-encrypted, verifier, ? client-info }
|
|
24
|
+
client-info = ( cam-ai, full-timestamp, lifetime)
|
|
25
|
+
|
|
26
|
+
sam = (SAM => abs-uri)
|
|
27
|
+
SAM = 0
|
|
28
|
+
abs-uri = tstr ; .regexp "______"
|
|
29
|
+
|
|
30
|
+
sam-ai = ( SAI => [* auth-info])
|
|
31
|
+
SAI = 1
|
|
32
|
+
auth-info = ( uri : tstr, mask : 0..15 )
|
|
33
|
+
|
|
34
|
+
cam-ai = ( CAI => [* auth-info])
|
|
35
|
+
CAI = 2
|
|
36
|
+
|
|
37
|
+
full-timestamp = ( TS => date)
|
|
38
|
+
TS = 5
|
|
39
|
+
date = tdate / localdate
|
|
40
|
+
localdate = uint
|
|
41
|
+
limited-timestamp = ( TS => localdate)
|
|
42
|
+
|
|
43
|
+
accepted-formats = ( A => [+ content-format] )
|
|
44
|
+
content-format = uint ; valid entry from CoAP content format registry
|
|
45
|
+
A=10
|
|
46
|
+
|
|
47
|
+
piggybacked = ( data, lifetime, nonce )
|
|
48
|
+
data = ( D => bstr )
|
|
49
|
+
nonce = ( N => bstr )
|
|
50
|
+
lifetime = ( L => period)
|
|
51
|
+
period = uint ; in seconds
|
|
52
|
+
L = 6
|
|
53
|
+
D = 11
|
|
54
|
+
N = 12
|
|
55
|
+
|
|
56
|
+
psk-gen = ( G => mac-algorithm)
|
|
57
|
+
G = 7
|
|
58
|
+
mac-algorithm = &( hmac-sha256: 0, hmac-sha384: 1, hmac-sha512: 2 )
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
dcaf-msg = sam-information-msg
|
|
2
|
+
/ access-request-msg
|
|
3
|
+
/ ticket-transfer-msg
|
|
4
|
+
/ ticket-grant-msg
|
|
5
|
+
|
|
6
|
+
sam-information-msg = { sam, ? full-timestamp }
|
|
7
|
+
|
|
8
|
+
access-request-msg = { sam, sam-ai, full-timestamp }
|
|
9
|
+
|
|
10
|
+
ticket-transfer-msg = { face, verifier }
|
|
11
|
+
face = (F => { sam-ai, limited-timestamp, lifetime, psk-gen } )
|
|
12
|
+
verifier = (V => shared-secret )
|
|
13
|
+
shared-secret = bstr
|
|
14
|
+
F = 8
|
|
15
|
+
V = 9
|
|
16
|
+
|
|
17
|
+
ticket-grant-msg = { face, verifier, ? client-info }
|
|
18
|
+
client-info = (cam-ai, full-timestamp, lifetime)
|
|
19
|
+
|
|
20
|
+
sam = (SAM => abs-uri)
|
|
21
|
+
SAM = 0
|
|
22
|
+
abs-uri = tstr ; .regexp "______"
|
|
23
|
+
|
|
24
|
+
sam-ai = (SAI => [* auth-info])
|
|
25
|
+
SAI = 1
|
|
26
|
+
auth-info = (uri : tstr, mask : 0..15 )
|
|
27
|
+
|
|
28
|
+
cam-ai = (CAI => [* auth-info])
|
|
29
|
+
CAI = 2
|
|
30
|
+
|
|
31
|
+
full-timestamp = (TS => date)
|
|
32
|
+
TS = 5
|
|
33
|
+
date = tdate / localdate
|
|
34
|
+
localdate = uint
|
|
35
|
+
limited-timestamp = (TS => localdate)
|
|
36
|
+
|
|
37
|
+
lifetime = (L => period)
|
|
38
|
+
period = uint ; in seconds
|
|
39
|
+
L = 6
|
|
40
|
+
|
|
41
|
+
psk-gen = (G => mac-algorithm)
|
|
42
|
+
G = 7
|
|
43
|
+
mac-algorithm = &( hmac-sha256: 0, hmac-sha384: 1, hmac-sha512: 2 )
|
|
44
|
+
|
|
45
|
+
; TO DO???
|
|
46
|
+
E = 3
|
|
47
|
+
K = 4
|
|
48
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
|
|
2
|
+
grasp-message = message
|
|
3
|
+
|
|
4
|
+
session-id = 0..16777215
|
|
5
|
+
; that is up to 24 bits
|
|
6
|
+
|
|
7
|
+
message /= discovery-message
|
|
8
|
+
discovery-message = [M_DISCOVERY, session-id, objective]
|
|
9
|
+
|
|
10
|
+
message /= response-message
|
|
11
|
+
response-message = [M_RESPONSE, session-id,
|
|
12
|
+
(+locator-option // divert-option // objective)]
|
|
13
|
+
|
|
14
|
+
message /= request-message
|
|
15
|
+
request-message = [M_REQUEST, session-id, objective]
|
|
16
|
+
|
|
17
|
+
message /= negotiation-message
|
|
18
|
+
negotiation-message = [M_NEGOTIATE, session-id, objective]
|
|
19
|
+
|
|
20
|
+
message /= end-message
|
|
21
|
+
end-message = [M_END, session-id, (accept-option / decline-option)]
|
|
22
|
+
|
|
23
|
+
message /= wait-message
|
|
24
|
+
wait-message = [M_WAIT, session-id, waiting-time-option]
|
|
25
|
+
|
|
26
|
+
divert-option = [O_DIVERT, +locator-option]
|
|
27
|
+
|
|
28
|
+
accept-option = [O_ACCEPT]
|
|
29
|
+
|
|
30
|
+
decline-option = [O_DECLINE]
|
|
31
|
+
|
|
32
|
+
waiting-time-option = [O_WAITING, option-waiting-time]
|
|
33
|
+
option-waiting-time = 0..4294967295 ; in milliseconds
|
|
34
|
+
|
|
35
|
+
option-device-id = [O_DEVICE_ID, bytes]
|
|
36
|
+
|
|
37
|
+
locator-option /= ipv4-locator-option
|
|
38
|
+
ipv4-locator-option = bytes .size 4
|
|
39
|
+
; this is simpler than [O_IPv4_LOCATOR, bytes .size 4]
|
|
40
|
+
|
|
41
|
+
locator-option /= ipv6-locator-option
|
|
42
|
+
ipv6-locator-option = bytes .size 16
|
|
43
|
+
|
|
44
|
+
locator-option /= fqdn-locator-option
|
|
45
|
+
fqdn-locator-option = [O_FQDN_LOCATOR, text]
|
|
46
|
+
|
|
47
|
+
locator-option /= url-locator-option
|
|
48
|
+
url-locator-option = [O_URL_LOCATOR, text]
|
|
49
|
+
|
|
50
|
+
objective-flags = uint .bits objective-flag
|
|
51
|
+
|
|
52
|
+
objective-flag = &(
|
|
53
|
+
D: 0
|
|
54
|
+
N: 1
|
|
55
|
+
S: 2
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
; D means valid for discovery only
|
|
59
|
+
; N means valid for discovery and negotiation
|
|
60
|
+
; S means valid for discovery and synchronization
|
|
61
|
+
|
|
62
|
+
objective /= generic-obj
|
|
63
|
+
generic-obj = [objective-name, objective-flags, loop-count, ?any]
|
|
64
|
+
|
|
65
|
+
objective /= vendor-obj
|
|
66
|
+
vendor-obj = [{"PEN":pen}, objective-name, objective-flags,
|
|
67
|
+
loop-count, ?any]
|
|
68
|
+
|
|
69
|
+
; A PEN is used to distinguish vendor-specific options.
|
|
70
|
+
|
|
71
|
+
pen = 0..4294967295
|
|
72
|
+
objective-name = tstr
|
|
73
|
+
loop-count = 0..255
|
|
74
|
+
|
|
75
|
+
; Constants
|
|
76
|
+
|
|
77
|
+
M_DISCOVERY = 1
|
|
78
|
+
M_RESPONSE = 2
|
|
79
|
+
M_REQUEST = 3
|
|
80
|
+
M_NEGOTIATE = 4
|
|
81
|
+
M_END = 5
|
|
82
|
+
M_WAIT = 6
|
|
83
|
+
|
|
84
|
+
O_DIVERT = 100
|
|
85
|
+
O_ACCEPT = 101
|
|
86
|
+
O_DECLINE = 102
|
|
87
|
+
O_WAITING = 103
|
|
88
|
+
O_DEVICE_ID = 104
|
|
89
|
+
O_FQDN_LOCATOR = 105
|
|
90
|
+
O_URL_LOCATOR = 106
|
|
91
|
+
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
grasp-message = message
|
|
2
|
+
|
|
3
|
+
session-id = 0..16777215
|
|
4
|
+
; that is up to 24 bits
|
|
5
|
+
|
|
6
|
+
message /= discovery-message
|
|
7
|
+
discovery-message = [M_DISCOVERY, session-id, objective]
|
|
8
|
+
|
|
9
|
+
message /= response-message
|
|
10
|
+
response-message = [M_RESPONSE, session-id,
|
|
11
|
+
(+locator-option // divert-option // objective)]
|
|
12
|
+
|
|
13
|
+
message /= request-message
|
|
14
|
+
request-message = [M_REQUEST, session-id, objective]
|
|
15
|
+
|
|
16
|
+
message /= negotiation-message
|
|
17
|
+
negotiation-message = [M_NEGOTIATE, sid: session-id, objective]
|
|
18
|
+
|
|
19
|
+
message /= end-message
|
|
20
|
+
end-message = [M_END, session-id, (accept-option / decline-option)]
|
|
21
|
+
|
|
22
|
+
message /= wait-message
|
|
23
|
+
wait-message = [M_WAIT, session-id, waiting-time-option]
|
|
24
|
+
|
|
25
|
+
divert-option = [O_DIVERT, +locator-option]
|
|
26
|
+
|
|
27
|
+
accept-option = [O_ACCEPT]
|
|
28
|
+
|
|
29
|
+
decline-option = [O_DECLINE]
|
|
30
|
+
|
|
31
|
+
waiting-time-option = [O_WAITING, option-waiting-time]
|
|
32
|
+
option-waiting-time = 0..4294967295 ; in milliseconds
|
|
33
|
+
|
|
34
|
+
option-device-id = [O_DEVICE_ID, bytes]
|
|
35
|
+
|
|
36
|
+
locator-option /= ipv4-locator-option
|
|
37
|
+
ipv4-locator-option = bytes .size 4
|
|
38
|
+
; this is simpler than [O_IPv4_LOCATOR, bytes .size 4]
|
|
39
|
+
|
|
40
|
+
locator-option /= ipv6-locator-option
|
|
41
|
+
ipv6-locator-option = bytes .size 16
|
|
42
|
+
|
|
43
|
+
locator-option /= fqdn-locator-option
|
|
44
|
+
fqdn-locator-option = [O_FQDN_LOCATOR, text]
|
|
45
|
+
|
|
46
|
+
locator-option /= url-locator-option
|
|
47
|
+
url-locator-option = [O_URL_LOCATOR, text]
|
|
48
|
+
|
|
49
|
+
objective-flags = uint .bits objective-flag
|
|
50
|
+
|
|
51
|
+
objective-flag = &(
|
|
52
|
+
D: 0
|
|
53
|
+
N: 1
|
|
54
|
+
S: 2
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
; D means valid for discovery only
|
|
58
|
+
; N means valid for discovery and negotiation
|
|
59
|
+
; S means valid for discovery and synchronization
|
|
60
|
+
|
|
61
|
+
objective /= generic-obj
|
|
62
|
+
generic-obj = [objective-name, objective-flags, loop-count, ?any]
|
|
63
|
+
|
|
64
|
+
objective /= vendor-obj
|
|
65
|
+
vendor-obj = [{"PEN":pen}, objective-name, objective-flags,
|
|
66
|
+
loop-count, ?any]
|
|
67
|
+
|
|
68
|
+
; A PEN is used to distinguish vendor-specific options.
|
|
69
|
+
|
|
70
|
+
pen = 0..4294967295
|
|
71
|
+
objective-name = tstr
|
|
72
|
+
loop-count = 0..255
|
|
73
|
+
|
|
74
|
+
; Constants
|
|
75
|
+
|
|
76
|
+
M_DISCOVERY = 1
|
|
77
|
+
|
|
78
|
+
M_RESPONSE = 2
|
|
79
|
+
M_REQUEST = 3
|
|
80
|
+
M_NEGOTIATE = 4
|
|
81
|
+
M_END = 5
|
|
82
|
+
M_WAIT = 6
|
|
83
|
+
|
|
84
|
+
O_DIVERT = 100
|
|
85
|
+
O_ACCEPT = 101
|
|
86
|
+
O_DECLINE = 102
|
|
87
|
+
O_WAITING = 103
|
|
88
|
+
O_DEVICE_ID = 104
|
|
89
|
+
O_FQDN_LOCATOR = 105
|
|
90
|
+
O_URL_LOCATOR = 106
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
grasp-message = message
|
|
2
|
+
|
|
3
|
+
session-id = 0..16777215
|
|
4
|
+
; that is up to 24 bits
|
|
5
|
+
|
|
6
|
+
message /= discovery-message
|
|
7
|
+
discovery-message = [M_DISCOVERY, session-id, objective]
|
|
8
|
+
|
|
9
|
+
message /= response-message
|
|
10
|
+
response-message = [M_RESPONSE, session-id,
|
|
11
|
+
(+locator-option // divert-option // objective)]
|
|
12
|
+
|
|
13
|
+
message /= request-message
|
|
14
|
+
request-message = [M_REQUEST, session-id, objective]
|
|
15
|
+
|
|
16
|
+
message /= negotiation-message
|
|
17
|
+
negotiation-message = [M_NEGOTIATE, session-id, objective]
|
|
18
|
+
|
|
19
|
+
message /= end-message
|
|
20
|
+
end-message = [M_END, session-id, (accept-option / decline-option)]
|
|
21
|
+
|
|
22
|
+
message /= wait-message
|
|
23
|
+
wait-message = [M_WAIT, session-id, waiting-time-option]
|
|
24
|
+
|
|
25
|
+
divert-option = [O_DIVERT, +locator-option]
|
|
26
|
+
|
|
27
|
+
accept-option = [O_ACCEPT]
|
|
28
|
+
|
|
29
|
+
decline-option = [O_DECLINE]
|
|
30
|
+
|
|
31
|
+
waiting-time-option = [O_WAITING, option-waiting-time]
|
|
32
|
+
option-waiting-time = 0..4294967295 ; in milliseconds
|
|
33
|
+
|
|
34
|
+
option-device-id = [O_DEVICE_ID, bytes]
|
|
35
|
+
|
|
36
|
+
locator-option /= ipv4-locator-option
|
|
37
|
+
ipv4-locator-option = bytes .size 4
|
|
38
|
+
; this is simpler than [O_IPv4_LOCATOR, bytes .size 4]
|
|
39
|
+
|
|
40
|
+
locator-option /= ipv6-locator-option
|
|
41
|
+
ipv6-locator-option = bytes .size 16
|
|
42
|
+
|
|
43
|
+
locator-option /= fqdn-locator-option
|
|
44
|
+
fqdn-locator-option = [O_FQDN_LOCATOR, text]
|
|
45
|
+
|
|
46
|
+
locator-option /= url-locator-option
|
|
47
|
+
url-locator-option = [O_URL_LOCATOR, text]
|
|
48
|
+
|
|
49
|
+
objective-flags = uint .bits objective-flag
|
|
50
|
+
|
|
51
|
+
objective-flag = &(
|
|
52
|
+
D: 0
|
|
53
|
+
N: 1
|
|
54
|
+
S: 2
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
; D means valid for discovery only
|
|
58
|
+
; N means valid for discovery and negotiation
|
|
59
|
+
; S means valid for discovery and synchronization
|
|
60
|
+
|
|
61
|
+
objective /= generic-obj
|
|
62
|
+
generic-obj = [objective-name, objective-flags, loop-count, ?any]
|
|
63
|
+
|
|
64
|
+
objective /= vendor-obj
|
|
65
|
+
vendor-obj = [{"PEN":pen}, objective-name, objective-flags,
|
|
66
|
+
loop-count, ?any]
|
|
67
|
+
|
|
68
|
+
; A PEN is used to distinguish vendor-specific options.
|
|
69
|
+
|
|
70
|
+
pen = 0..4294967295
|
|
71
|
+
objective-name = tstr
|
|
72
|
+
loop-count = 0..255
|
|
73
|
+
|
|
74
|
+
; Constants
|
|
75
|
+
|
|
76
|
+
M_DISCOVERY = 1
|
|
77
|
+
|
|
78
|
+
M_RESPONSE = 2
|
|
79
|
+
M_REQUEST = 3
|
|
80
|
+
M_NEGOTIATE = 4
|
|
81
|
+
M_END = 5
|
|
82
|
+
M_WAIT = 6
|
|
83
|
+
|
|
84
|
+
O_DIVERT = 100
|
|
85
|
+
O_ACCEPT = 101
|
|
86
|
+
O_DECLINE = 102
|
|
87
|
+
O_WAITING = 103
|
|
88
|
+
O_DEVICE_ID = 104
|
|
89
|
+
O_FQDN_LOCATOR = 105
|
|
90
|
+
O_URL_LOCATOR = 106
|