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
pub const JSON_SCHEMA: &str = r#"
{
"id": "schemaTemplate",
"type" : "object",
"properties" : {
"name" : {
"type" : "string",
"minLength" : 1,
"maxLength" : 32
},
"endianness" : {
"type" : "string",
"enum" : ["little", "big"]
},
"connection" : {
"type" : "object",
"properties" : {
"protocol" : {
"type" : "string",
"enum" : [ "udp", "tcp" ]
},
"ports" : {
"type" : "array",
"UniqueItems" : true,
"minItems" : 1,
"items" : {
"type" : "number",
"minimum" : 1,
"maximum" : 65535
}
}
},
"required" : ["protocol", "ports"]
},
"data" : {
"type" : "array",
"minItems" : 1,
"items" : {
"type" : "object",
"properties" : {
"name" : {
"type" : "string",
"minLength" : 1,
"maxLength" : 32
},
"format" : {
"type" : "string",
"enum" : ["bool", "char", "uint8", "uint16", "uint24", "uint32", "uint64", "int8", "int16", "int24", "int32", "int64", "float", "double", "absolute_time", "relative_time", "ether", "bytes", "ipv4", "ipv6", "guid", "oid", "none"]
},
"base" : {
"type" : "string",
"enum" : ["NONE", "DEC", "HEX", "OCT", "DEC_HEX", "HEX_DEC", "UTC", "LOCAL", "DOY_UTC", "DOT", "DASH", "COLON", "SPACE"]
},
"offset" : {
"type" : "number"
},
"size" : {
"type" : "number"
},
"valstr" : {
"type": "array",
"minItems" : 1,
"items" : {
"type" : "object",
"properties" : {
"value" : {
"type" : "number"
},
"string" : {
"type" : "string",
"minLength" : 1,
"maxLength" : 32
}
},
"required" : ["value", "string"]
}
}
},
"required" : ["name", "format", "base", "offset", "size"]
}
}
},
"required" : ["name", "endianness", "connection", "data"]
}
"#;