5 <meta http-equiv=
"X-UA-Compatible" content=
"IE=edge">
6 <meta name=
"viewport" content=
"width=device-width, initial-scale=1.0">
7 <meta name=
"generator" content=
"Asciidoctor 2.0.10">
8 <meta name=
"author" content=
"Philippe Proulx">
9 <title>CTF2-SPECRC-
3.0: Common Trace Format version
 2 release candidate
</title>
10 <link rel=
"stylesheet" href=
"https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700">
12 /* Asciidoctor default stylesheet | MIT License | https://asciidoctor.org */
13 /* Uncomment @import statement to use as custom stylesheet */
14 /*@import
"https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700";*/
15 article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}
16 audio,video{display:inline-block}
17 audio:not([controls]){display:none;height:
0}
18 html{font-family:sans-serif;-ms-text-size-adjust:
100%;-webkit-text-size-adjust:
100%}
20 a:focus{outline:thin dotted}
21 a:active,a:hover{outline:
0}
22 h1{font-size:
2em;margin:
.67em
0}
23 abbr[title]{border-bottom:
1px dotted}
24 b,strong{font-weight:bold}
25 dfn{font-style:italic}
26 hr{-moz-box-sizing:content-box;box-sizing:content-box;height:
0}
27 mark{background:#ff0;color:#
000}
28 code,kbd,pre,samp{font-family:monospace;font-size:
1em}
29 pre{white-space:pre-wrap}
30 q{quotes:
"\201C" "\201D" "\2018" "\2019"}
32 sub,sup{font-size:
75%;line-height:
0;position:relative;vertical-align:baseline}
36 svg:not(:root){overflow:hidden}
38 fieldset{border:
1px solid silver;margin:
0 2px;padding:
.35em
.625em
.75em}
39 legend{border:
0;padding:
0}
40 button,input,select,textarea{font-family:inherit;font-size:
100%;margin:
0}
41 button,input{line-height:normal}
42 button,select{text-transform:none}
43 button,html input[
type=
"button"],input[
type=
"reset"],input[
type=
"submit"]{-webkit-appearance:button;cursor:pointer}
44 button[disabled],html input[disabled]{cursor:default}
45 input[
type=
"checkbox"],input[
type=
"radio"]{box-sizing:border-box;padding:
0}
46 button::-moz-focus-inner,input::-moz-focus-inner{border:
0;padding:
0}
47 textarea{overflow:auto;vertical-align:top}
48 table{border-collapse:collapse;border-spacing:
0}
49 *,*::before,*::after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}
50 html,body{font-size:
100%}
51 body{background:#fff;color:rgba(
0,
0,
0,
.8);padding:
0;margin:
0;font-family:
"Noto Serif",
"DejaVu Serif",serif;font-weight:
400;font-style:normal;line-height:
1;position:relative;cursor:auto;tab-size:
4;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}
52 a:hover{cursor:pointer}
53 img,object,embed{max-width:
100%;height:auto}
54 object,embed{height:
100%}
55 img{-ms-interpolation-mode:bicubic}
56 .left{float:left!important}
57 .right{float:right!important}
58 .text-left{text-align:left!important}
59 .text-right{text-align:right!important}
60 .text-center{text-align:center!important}
61 .text-justify{text-align:justify!important}
63 img,object,svg{display:inline-block;vertical-align:middle}
64 textarea{height:auto;min-height:
50px}
66 .center{margin-left:auto;margin-right:auto}
68 .subheader,.admonitionblock td.content
>.title,.audioblock
>.title,.exampleblock
>.title,.imageblock
>.title,.listingblock
>.title,.literalblock
>.title,.stemblock
>.title,.openblock
>.title,.paragraph
>.title,.quoteblock
>.title,table.tableblock
>.title,.verseblock
>.title,.videoblock
>.title,.dlist
>.title,.olist
>.title,.ulist
>.title,.qlist
>.title,.hdlist
>.title{line-height:
1.45;color:#
7a2518;font-weight:
400;margin-top:
0;margin-bottom:
.25em}
69 div,dl,dt,dd,ul,ol,li,h1,h2,h3,#toctitle,.sidebarblock
>.content
>.title,h4,h5,h6,pre,form,p,blockquote,th,td{margin:
0;padding:
0;direction:ltr}
70 a{color:#
2156a5;text-decoration:underline;line-height:inherit}
71 a:hover,a:focus{color:#
1d4b8f}
73 p{font-family:inherit;font-weight:
400;font-size:
1em;line-height:
1.6;margin-bottom:
1.25em;text-rendering:optimizeLegibility}
74 p aside{font-size:
.875em;line-height:
1.35;font-style:italic}
75 h1,h2,h3,#toctitle,.sidebarblock
>.content
>.title,h4,h5,h6{font-family:
"Open Sans",
"DejaVu Sans",sans-serif;font-weight:
300;font-style:normal;color:#ba3925;text-rendering:optimizeLegibility;margin-top:
1em;margin-bottom:
.5em;line-height:
1.0125em}
76 h1 small,h2 small,h3 small,#toctitle small,.sidebarblock
>.content
>.title small,h4 small,h5 small,h6 small{font-size:
60%;color:#e99b8f;line-height:
0}
78 h2{font-size:
1.6875em}
79 h3,#toctitle,.sidebarblock
>.content
>.title{font-size:
1.375em}
80 h4,h5{font-size:
1.125em}
82 hr{border:solid #dddddf;border-width:
1px
0 0;clear:both;margin:
1.25em
0 1.1875em;height:
0}
83 em,i{font-style:italic;line-height:inherit}
84 strong,b{font-weight:bold;line-height:inherit}
85 small{font-size:
60%;line-height:inherit}
86 code{font-family:
"Droid Sans Mono",
"DejaVu Sans Mono",monospace;font-weight:
400;color:rgba(
0,
0,
0,
.9)}
87 ul,ol,dl{font-size:
1em;line-height:
1.6;margin-bottom:
1.25em;list-style-position:outside;font-family:inherit}
88 ul,ol{margin-left:
1.5em}
89 ul li ul,ul li ol{margin-left:
1.25em;margin-bottom:
0;font-size:
1em}
90 ul.square li ul,ul.circle li ul,ul.disc li ul{list-style:inherit}
91 ul.square{list-style-type:square}
92 ul.circle{list-style-type:circle}
93 ul.disc{list-style-type:disc}
94 ol li ul,ol li ol{margin-left:
1.25em;margin-bottom:
0}
95 dl dt{margin-bottom:
.3125em;font-weight:bold}
96 dl dd{margin-bottom:
1.25em}
97 abbr,acronym{text-transform:uppercase;font-size:
90%;color:rgba(
0,
0,
0,
.8);border-bottom:
1px dotted #ddd;cursor:help}
98 abbr{text-transform:none}
99 blockquote{margin:
0 0 1.25em;padding:
.5625em
1.25em
0 1.1875em;border-left:
1px solid #ddd}
100 blockquote cite{display:block;font-size:
.9375em;color:rgba(
0,
0,
0,
.6)}
101 blockquote cite::before{content:
"\2014 \0020"}
102 blockquote cite a,blockquote cite a:visited{color:rgba(
0,
0,
0,
.6)}
103 blockquote,blockquote p{line-height:
1.6;color:rgba(
0,
0,
0,
.85)}
104 @media screen and (min-width:
768px){h1,h2,h3,#toctitle,.sidebarblock
>.content
>.title,h4,h5,h6{line-height:
1.2}
106 h2{font-size:
2.3125em}
107 h3,#toctitle,.sidebarblock
>.content
>.title{font-size:
1.6875em}
108 h4{font-size:
1.4375em}}
109 table{background:#fff;margin-bottom:
1.25em;border:solid
1px #dedede}
110 table thead,table tfoot{background:#f7f8f7}
111 table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:
.5em
.625em
.625em;font-size:inherit;color:rgba(
0,
0,
0,
.8);text-align:left}
112 table tr th,table tr td{padding:
.5625em
.625em;font-size:inherit;color:rgba(
0,
0,
0,
.8)}
113 table tr.even,table tr.alt{background:#f8f8f7}
114 table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{display:table-cell;line-height:
1.6}
115 h1,h2,h3,#toctitle,.sidebarblock
>.content
>.title,h4,h5,h6{line-height:
1.2;word-spacing:-
.05em}
116 h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock
>.content
>.title strong,h4 strong,h5 strong,h6 strong{font-weight:
400}
117 .clearfix::before,.clearfix::after,.float-group::before,.float-group::after{content:
" ";display:table}
118 .clearfix::after,.float-group::after{clear:both}
119 :not(pre):not([class^=L])
>code{font-size:
.9375em;font-style:normal!important;letter-spacing:
0;padding:
.1em
.5ex;word-spacing:-
.15em;background:#f7f7f8;-webkit-border-radius:
4px;border-radius:
4px;line-height:
1.45;text-rendering:optimizeSpeed;word-wrap:break-word}
120 :not(pre)
>code.nobreak{word-wrap:normal}
121 :not(pre)
>code.nowrap{white-space:nowrap}
122 pre{color:rgba(
0,
0,
0,
.9);font-family:
"Droid Sans Mono",
"DejaVu Sans Mono",monospace;line-height:
1.45;text-rendering:optimizeSpeed}
123 pre code,pre pre{color:inherit;font-size:inherit;line-height:inherit}
124 pre
>code{display:block}
125 pre.nowrap,pre.nowrap pre{white-space:pre;word-wrap:normal}
126 em em{font-style:normal}
127 strong strong{font-weight:
400}
128 .keyseq{color:rgba(
51,
51,
51,
.8)}
129 kbd{font-family:
"Droid Sans Mono",
"DejaVu Sans Mono",monospace;display:inline-block;color:rgba(
0,
0,
0,
.8);font-size:
.65em;line-height:
1.45;background:#f7f7f7;border:
1px solid #ccc;-webkit-border-radius:
3px;border-radius:
3px;-webkit-box-shadow:
0 1px
0 rgba(
0,
0,
0,
.2),
0 0 0 .1em white inset;box-shadow:
0 1px
0 rgba(
0,
0,
0,
.2),
0 0 0 .1em #fff inset;margin:
0 .15em;padding:
.2em
.5em;vertical-align:middle;position:relative;top:-
.1em;white-space:nowrap}
130 .keyseq kbd:first-child{margin-left:
0}
131 .keyseq kbd:last-child{margin-right:
0}
132 .menuseq,.menuref{color:#
000}
133 .menuseq b:not(.caret),.menuref{font-weight:inherit}
134 .menuseq{word-spacing:-
.02em}
135 .menuseq b.caret{font-size:
1.25em;line-height:
.8}
136 .menuseq i.caret{font-weight:bold;text-align:center;width:
.45em}
137 b.button::before,b.button::after{position:relative;top:-
1px;font-weight:
400}
138 b.button::before{content:
"[";padding:
0 3px
0 2px}
139 b.button::after{content:
"]";padding:
0 2px
0 3px}
140 p a
>code:hover{color:rgba(
0,
0,
0,
.9)}
141 #header,#content,#footnotes,#footer{width:
100%;margin-left:auto;margin-right:auto;margin-top:
0;margin-bottom:
0;max-width:
62.5em;*zoom:
1;position:relative;padding-left:
.9375em;padding-right:
.9375em}
142 #header::before,#header::after,#content::before,#content::after,#footnotes::before,#footnotes::after,#footer::before,#footer::after{content:
" ";display:table}
143 #header::after,#content::after,#footnotes::after,#footer::after{clear:both}
144 #content{margin-top:
1.25em}
145 #content::before{content:none}
146 #header
>h1:first-child{color:rgba(
0,
0,
0,
.85);margin-top:
2.25rem;margin-bottom:
0}
147 #header
>h1:first-child+#toc{margin-top:
8px;border-top:
1px solid #dddddf}
148 #header
>h1:only-child,body.toc2 #header
>h1:nth-last-child(
2){border-bottom:
1px solid #dddddf;padding-bottom:
8px}
149 #header .details{border-bottom:
1px solid #dddddf;line-height:
1.45;padding-top:
.25em;padding-bottom:
.25em;padding-left:
.25em;color:rgba(
0,
0,
0,
.6);display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-flow:row wrap;-webkit-flex-flow:row wrap;flex-flow:row wrap}
150 #header .details span:first-child{margin-left:-
.125em}
151 #header .details span.email a{color:rgba(
0,
0,
0,
.85)}
152 #header .details br{display:none}
153 #header .details br+span::before{content:
"\00a0\2013\00a0"}
154 #header .details br+span.author::before{content:
"\00a0\22c5\00a0";color:rgba(
0,
0,
0,
.85)}
155 #header .details br+span#revremark::before{content:
"\00a0|\00a0"}
156 #header #revnumber{text-transform:capitalize}
157 #header #revnumber::after{content:
"\00a0"}
158 #content
>h1:first-child:not([class]){color:rgba(
0,
0,
0,
.85);border-bottom:
1px solid #dddddf;padding-bottom:
8px;margin-top:
0;padding-top:
1rem;margin-bottom:
1.25rem}
159 #toc{border-bottom:
1px solid #e7e7e9;padding-bottom:
.5em}
160 #toc
>ul{margin-left:
.125em}
161 #toc ul.sectlevel0
>li
>a{font-style:italic}
162 #toc ul.sectlevel0 ul.sectlevel1{margin:
.5em
0}
163 #toc ul{font-family:
"Open Sans",
"DejaVu Sans",sans-serif;list-style-type:none}
164 #toc li{line-height:
1.3334;margin-top:
.3334em}
165 #toc a{text-decoration:none}
166 #toc a:active{text-decoration:underline}
167 #toctitle{color:#
7a2518;font-size:
1.2em}
168 @media screen and (min-width:
768px){#toctitle{font-size:
1.375em}
169 body.toc2{padding-left:
15em;padding-right:
0}
170 #toc.toc2{margin-top:
0!important;background:#f8f8f7;position:fixed;width:
15em;left:
0;top:
0;border-right:
1px solid #e7e7e9;border-top-width:
0!important;border-bottom-width:
0!important;z-index:
1000;padding:
1.25em
1em;height:
100%;overflow:auto}
171 #toc.toc2 #toctitle{margin-top:
0;margin-bottom:
.8rem;font-size:
1.2em}
172 #toc.toc2
>ul{font-size:
.9em;margin-bottom:
0}
173 #toc.toc2 ul ul{margin-left:
0;padding-left:
1em}
174 #toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:
0;margin-top:
.5em;margin-bottom:
.5em}
175 body.toc2.toc-right{padding-left:
0;padding-right:
15em}
176 body.toc2.toc-right #toc.toc2{border-right-width:
0;border-left:
1px solid #e7e7e9;left:auto;right:
0}}
177 @media screen and (min-width:
1280px){body.toc2{padding-left:
20em;padding-right:
0}
178 #toc.toc2{width:
20em}
179 #toc.toc2 #toctitle{font-size:
1.375em}
180 #toc.toc2
>ul{font-size:
.95em}
181 #toc.toc2 ul ul{padding-left:
1.25em}
182 body.toc2.toc-right{padding-left:
0;padding-right:
20em}}
183 #content #toc{border-style:solid;border-width:
1px;border-color:#e0e0dc;margin-bottom:
1.25em;padding:
1.25em;background:#f8f8f7;-webkit-border-radius:
4px;border-radius:
4px}
184 #content #toc
>:first-child{margin-top:
0}
185 #content #toc
>:last-child{margin-bottom:
0}
186 #footer{max-width:
100%;background:rgba(
0,
0,
0,
.8);padding:
1.25em}
187 #footer-text{color:rgba(
255,
255,
255,
.8);line-height:
1.44}
188 #content{margin-bottom:
.625em}
189 .sect1{padding-bottom:
.625em}
190 @media screen and (min-width:
768px){#content{margin-bottom:
1.25em}
191 .sect1{padding-bottom:
1.25em}}
192 .sect1:last-child{padding-bottom:
0}
193 .sect1+.sect1{border-top:
1px solid #e7e7e9}
194 #content h1
>a.anchor,h2
>a.anchor,h3
>a.anchor,#toctitle
>a.anchor,.sidebarblock
>.content
>.title
>a.anchor,h4
>a.anchor,h5
>a.anchor,h6
>a.anchor{position:absolute;z-index:
1001;width:
1.5ex;margin-left:-
1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:
400}
195 #content h1
>a.anchor::before,h2
>a.anchor::before,h3
>a.anchor::before,#toctitle
>a.anchor::before,.sidebarblock
>.content
>.title
>a.anchor::before,h4
>a.anchor::before,h5
>a.anchor::before,h6
>a.anchor::before{content:
"\00A7";font-size:
.85em;display:block;padding-top:
.1em}
196 #content h1:hover
>a.anchor,#content h1
>a.anchor:hover,h2:hover
>a.anchor,h2
>a.anchor:hover,h3:hover
>a.anchor,#toctitle:hover
>a.anchor,.sidebarblock
>.content
>.title:hover
>a.anchor,h3
>a.anchor:hover,#toctitle
>a.anchor:hover,.sidebarblock
>.content
>.title
>a.anchor:hover,h4:hover
>a.anchor,h4
>a.anchor:hover,h5:hover
>a.anchor,h5
>a.anchor:hover,h6:hover
>a.anchor,h6
>a.anchor:hover{visibility:visible}
197 #content h1
>a.link,h2
>a.link,h3
>a.link,#toctitle
>a.link,.sidebarblock
>.content
>.title
>a.link,h4
>a.link,h5
>a.link,h6
>a.link{color:#ba3925;text-decoration:none}
198 #content h1
>a.link:hover,h2
>a.link:hover,h3
>a.link:hover,#toctitle
>a.link:hover,.sidebarblock
>.content
>.title
>a.link:hover,h4
>a.link:hover,h5
>a.link:hover,h6
>a.link:hover{color:#a53221}
199 details,.audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:
1.25em}
200 details
>summary:first-of-type{cursor:pointer;display:list-item;outline:none;margin-bottom:
.75em}
201 .admonitionblock td.content
>.title,.audioblock
>.title,.exampleblock
>.title,.imageblock
>.title,.listingblock
>.title,.literalblock
>.title,.stemblock
>.title,.openblock
>.title,.paragraph
>.title,.quoteblock
>.title,table.tableblock
>.title,.verseblock
>.title,.videoblock
>.title,.dlist
>.title,.olist
>.title,.ulist
>.title,.qlist
>.title,.hdlist
>.title{text-rendering:optimizeLegibility;text-align:left;font-family:
"Noto Serif",
"DejaVu Serif",serif;font-size:
1rem;font-style:italic}
202 table.tableblock.fit-content
>caption.title{white-space:nowrap;width:
0}
203 .paragraph.lead
>p,#preamble
>.sectionbody
>[
class=
"paragraph"]:first-of-type p{font-size:
1.21875em;line-height:
1.6;color:rgba(
0,
0,
0,
.85)}
204 table.tableblock #preamble
>.sectionbody
>[
class=
"paragraph"]:first-of-type p{font-size:inherit}
205 .admonitionblock
>table{border-collapse:separate;border:
0;background:none;width:
100%}
206 .admonitionblock
>table td.icon{text-align:center;width:
80px}
207 .admonitionblock
>table td.icon img{max-width:none}
208 .admonitionblock
>table td.icon .title{font-weight:bold;font-family:
"Open Sans",
"DejaVu Sans",sans-serif;text-transform:uppercase}
209 .admonitionblock
>table td.content{padding-left:
1.125em;padding-right:
1.25em;border-left:
1px solid #dddddf;color:rgba(
0,
0,
0,
.6)}
210 .admonitionblock
>table td.content
>:last-child
>:last-child{margin-bottom:
0}
211 .exampleblock
>.content{border-style:solid;border-width:
1px;border-color:#e6e6e6;margin-bottom:
1.25em;padding:
1.25em;background:#fff;-webkit-border-radius:
4px;border-radius:
4px}
212 .exampleblock
>.content
>:first-child{margin-top:
0}
213 .exampleblock
>.content
>:last-child{margin-bottom:
0}
214 .sidebarblock{border-style:solid;border-width:
1px;border-color:#dbdbd6;margin-bottom:
1.25em;padding:
1.25em;background:#f3f3f2;-webkit-border-radius:
4px;border-radius:
4px}
215 .sidebarblock
>:first-child{margin-top:
0}
216 .sidebarblock
>:last-child{margin-bottom:
0}
217 .sidebarblock
>.content
>.title{color:#
7a2518;margin-top:
0;text-align:center}
218 .exampleblock
>.content
>:last-child
>:last-child,.exampleblock
>.content .olist
>ol
>li:last-child
>:last-child,.exampleblock
>.content .ulist
>ul
>li:last-child
>:last-child,.exampleblock
>.content .qlist
>ol
>li:last-child
>:last-child,.sidebarblock
>.content
>:last-child
>:last-child,.sidebarblock
>.content .olist
>ol
>li:last-child
>:last-child,.sidebarblock
>.content .ulist
>ul
>li:last-child
>:last-child,.sidebarblock
>.content .qlist
>ol
>li:last-child
>:last-child{margin-bottom:
0}
219 .literalblock pre,.listingblock
>.content
>pre{-webkit-border-radius:
4px;border-radius:
4px;word-wrap:break-word;overflow-x:auto;padding:
1em;font-size:
.8125em}
220 @media screen and (min-width:
768px){.literalblock pre,.listingblock
>.content
>pre{font-size:
.90625em}}
221 @media screen and (min-width:
1280px){.literalblock pre,.listingblock
>.content
>pre{font-size:
1em}}
222 .literalblock pre,.listingblock
>.content
>pre:not(.highlight),.listingblock
>.content
>pre[
class=
"highlight"],.listingblock
>.content
>pre[class^=
"highlight "]{background:#f7f7f8}
223 .literalblock.output pre{color:#f7f7f8;background:rgba(
0,
0,
0,
.9)}
224 .listingblock
>.content{position:relative}
225 .listingblock code[data-lang]::before{display:none;content:attr(data-lang);position:absolute;font-size:
.75em;top:
.425rem;right:
.5rem;line-height:
1;text-transform:uppercase;color:inherit;opacity:
.5}
226 .listingblock:hover code[data-lang]::before{display:block}
227 .listingblock.terminal pre .command::before{content:attr(data-prompt);padding-right:
.5em;color:inherit;opacity:
.5}
228 .listingblock.terminal pre .command:not([data-prompt])::before{content:
"$"}
229 .listingblock pre.highlightjs{padding:
0}
230 .listingblock pre.highlightjs
>code{padding:
1em;-webkit-border-radius:
4px;border-radius:
4px}
231 .listingblock pre.prettyprint{border-width:
0}
232 .prettyprint{background:#f7f7f8}
233 pre.prettyprint .linenums{line-height:
1.45;margin-left:
2em}
234 pre.prettyprint li{background:none;list-style-type:inherit;padding-left:
0}
235 pre.prettyprint li code[data-lang]::before{opacity:
1}
236 pre.prettyprint li:not(:first-child) code[data-lang]::before{display:none}
237 table.linenotable{border-collapse:separate;border:
0;margin-bottom:
0;background:none}
238 table.linenotable td[class]{color:inherit;vertical-align:top;padding:
0;line-height:inherit;white-space:normal}
239 table.linenotable td.code{padding-left:
.75em}
240 table.linenotable td.linenos{border-right:
1px solid currentColor;opacity:
.35;padding-right:
.5em}
241 pre.pygments .lineno{border-right:
1px solid currentColor;opacity:
.35;display:inline-block;margin-right:
.75em}
242 pre.pygments .lineno::before{content:
"";margin-right:-
.125em}
243 .quoteblock{margin:
0 1em
1.25em
1.5em;display:table}
244 .quoteblock:not(.excerpt)
>.title{margin-left:-
1.5em;margin-bottom:
.75em}
245 .quoteblock blockquote,.quoteblock p{color:rgba(
0,
0,
0,
.85);font-size:
1.15rem;line-height:
1.75;word-spacing:
.1em;letter-spacing:
0;font-style:italic;text-align:justify}
246 .quoteblock blockquote{margin:
0;padding:
0;border:
0}
247 .quoteblock blockquote::before{content:
"\201c";float:left;font-size:
2.75em;font-weight:bold;line-height:
.6em;margin-left:-
.6em;color:#
7a2518;text-shadow:
0 1px
2px rgba(
0,
0,
0,
.1)}
248 .quoteblock blockquote
>.paragraph:last-child p{margin-bottom:
0}
249 .quoteblock .attribution{margin-top:
.75em;margin-right:
.5ex;text-align:right}
250 .verseblock{margin:
0 1em
1.25em}
251 .verseblock pre{font-family:
"Open Sans",
"DejaVu Sans",sans;font-size:
1.15rem;color:rgba(
0,
0,
0,
.85);font-weight:
300;text-rendering:optimizeLegibility}
252 .verseblock pre strong{font-weight:
400}
253 .verseblock .attribution{margin-top:
1.25rem;margin-left:
.5ex}
254 .quoteblock .attribution,.verseblock .attribution{font-size:
.9375em;line-height:
1.45;font-style:italic}
255 .quoteblock .attribution br,.verseblock .attribution br{display:none}
256 .quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-
.025em;color:rgba(
0,
0,
0,
.6)}
257 .quoteblock.abstract blockquote::before,.quoteblock.excerpt blockquote::before,.quoteblock .quoteblock blockquote::before{display:none}
258 .quoteblock.abstract blockquote,.quoteblock.abstract p,.quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{line-height:
1.6;word-spacing:
0}
259 .quoteblock.abstract{margin:
0 1em
1.25em;display:block}
260 .quoteblock.abstract
>.title{margin:
0 0 .375em;font-size:
1.15em;text-align:center}
261 .quoteblock.excerpt
>blockquote,.quoteblock .quoteblock{padding:
0 0 .25em
1em;border-left:
.25em solid #dddddf}
262 .quoteblock.excerpt,.quoteblock .quoteblock{margin-left:
0}
263 .quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{color:inherit;font-size:
1.0625rem}
264 .quoteblock.excerpt .attribution,.quoteblock .quoteblock .attribution{color:inherit;text-align:left;margin-right:
0}
265 table.tableblock{max-width:
100%;border-collapse:separate}
266 p.tableblock:last-child{margin-bottom:
0}
267 td.tableblock
>.content
>:last-child{margin-bottom:-
1.25em}
268 td.tableblock
>.content
>:last-child.sidebarblock{margin-bottom:
0}
269 table.tableblock,th.tableblock,td.tableblock{border:
0 solid #dedede}
270 table.grid-all
>thead
>tr
>.tableblock,table.grid-all
>tbody
>tr
>.tableblock{border-width:
0 1px
1px
0}
271 table.grid-all
>tfoot
>tr
>.tableblock{border-width:
1px
1px
0 0}
272 table.grid-cols
>*
>tr
>.tableblock{border-width:
0 1px
0 0}
273 table.grid-rows
>thead
>tr
>.tableblock,table.grid-rows
>tbody
>tr
>.tableblock{border-width:
0 0 1px}
274 table.grid-rows
>tfoot
>tr
>.tableblock{border-width:
1px
0 0}
275 table.grid-all
>*
>tr
>.tableblock:last-child,table.grid-cols
>*
>tr
>.tableblock:last-child{border-right-width:
0}
276 table.grid-all
>tbody
>tr:last-child
>.tableblock,table.grid-all
>thead:last-child
>tr
>.tableblock,table.grid-rows
>tbody
>tr:last-child
>.tableblock,table.grid-rows
>thead:last-child
>tr
>.tableblock{border-bottom-width:
0}
277 table.frame-all{border-width:
1px}
278 table.frame-sides{border-width:
0 1px}
279 table.frame-topbot,table.frame-ends{border-width:
1px
0}
280 table.stripes-all tr,table.stripes-odd tr:nth-of-type(odd),table.stripes-even tr:nth-of-type(even),table.stripes-hover tr:hover{background:#f8f8f7}
281 th.halign-left,td.halign-left{text-align:left}
282 th.halign-right,td.halign-right{text-align:right}
283 th.halign-center,td.halign-center{text-align:center}
284 th.valign-top,td.valign-top{vertical-align:top}
285 th.valign-bottom,td.valign-bottom{vertical-align:bottom}
286 th.valign-middle,td.valign-middle{vertical-align:middle}
287 table thead th,table tfoot th{font-weight:bold}
288 tbody tr th{display:table-cell;line-height:
1.6;background:#f7f8f7}
289 tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(
0,
0,
0,
.8);font-weight:bold}
290 p.tableblock
>code:only-child{background:none;padding:
0}
291 p.tableblock{font-size:
1em}
292 ol{margin-left:
1.75em}
293 ul li ol{margin-left:
1.5em}
294 dl dd{margin-left:
1.125em}
295 dl dd:last-child,dl dd:last-child
>:last-child{margin-bottom:
0}
296 ol
>li p,ul
>li p,ul dd,ol dd,.olist .olist,.ulist .ulist,.ulist .olist,.olist .ulist{margin-bottom:
.625em}
297 ul.checklist,ul.none,ol.none,ul.no-bullet,ol.no-bullet,ol.unnumbered,ul.unstyled,ol.unstyled{list-style-type:none}
298 ul.no-bullet,ol.no-bullet,ol.unnumbered{margin-left:
.625em}
299 ul.unstyled,ol.unstyled{margin-left:
0}
300 ul.checklist{margin-left:
.625em}
301 ul.checklist li
>p:first-child
>.fa-square-o:first-child,ul.checklist li
>p:first-child
>.fa-check-square-o:first-child{width:
1.25em;font-size:
.8em;position:relative;bottom:
.125em}
302 ul.checklist li
>p:first-child
>input[
type=
"checkbox"]:first-child{margin-right:
.25em}
303 ul.inline{display:-ms-flexbox;display:-webkit-box;display:flex;-ms-flex-flow:row wrap;-webkit-flex-flow:row wrap;flex-flow:row wrap;list-style:none;margin:
0 0 .625em -
1.25em}
304 ul.inline
>li{margin-left:
1.25em}
305 .unstyled dl dt{font-weight:
400;font-style:normal}
306 ol.arabic{list-style-type:decimal}
307 ol.decimal{list-style-type:decimal-leading-zero}
308 ol.loweralpha{list-style-type:lower-alpha}
309 ol.upperalpha{list-style-type:upper-alpha}
310 ol.lowerroman{list-style-type:lower-roman}
311 ol.upperroman{list-style-type:upper-roman}
312 ol.lowergreek{list-style-type:lower-greek}
313 .hdlist
>table,.colist
>table{border:
0;background:none}
314 .hdlist
>table
>tbody
>tr,.colist
>table
>tbody
>tr{background:none}
315 td.hdlist1,td.hdlist2{vertical-align:top;padding:
0 .625em}
316 td.hdlist1{font-weight:bold;padding-bottom:
1.25em}
317 .literalblock+.colist,.listingblock+.colist{margin-top:-
.5em}
318 .colist td:not([class]):first-child{padding:
.4em
.75em
0;line-height:
1;vertical-align:top}
319 .colist td:not([class]):first-child img{max-width:none}
320 .colist td:not([class]):last-child{padding:
.25em
0}
321 .thumb,.th{line-height:
0;display:inline-block;border:solid
4px #fff;-webkit-box-shadow:
0 0 0 1px #ddd;box-shadow:
0 0 0 1px #ddd}
322 .imageblock.left{margin:
.25em
.625em
1.25em
0}
323 .imageblock.right{margin:
.25em
0 1.25em
.625em}
324 .imageblock
>.title{margin-bottom:
0}
325 .imageblock.thumb,.imageblock.th{border-width:
6px}
326 .imageblock.thumb
>.title,.imageblock.th
>.title{padding:
0 .125em}
327 .image.left,.image.right{margin-top:
.25em;margin-bottom:
.25em;display:inline-block;line-height:
0}
328 .image.left{margin-right:
.625em}
329 .image.right{margin-left:
.625em}
330 a.image{text-decoration:none;display:inline-block}
331 a.image object{pointer-events:none}
332 sup.footnote,sup.footnoteref{font-size:
.875em;position:static;vertical-align:super}
333 sup.footnote a,sup.footnoteref a{text-decoration:none}
334 sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline}
335 #footnotes{padding-top:
.75em;padding-bottom:
.75em;margin-bottom:
.625em}
336 #footnotes hr{width:
20%;min-width:
6.25em;margin:-
.25em
0 .75em;border-width:
1px
0 0}
337 #footnotes .footnote{padding:
0 .375em
0 .225em;line-height:
1.3334;font-size:
.875em;margin-left:
1.2em;margin-bottom:
.2em}
338 #footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none;margin-left:-
1.05em}
339 #footnotes .footnote:last-of-type{margin-bottom:
0}
340 #content #footnotes{margin-top:-
.625em;margin-bottom:
0;padding:
.75em
0}
341 .gist .file-data
>table{border:
0;background:#fff;width:
100%;margin-bottom:
0}
342 .gist .file-data
>table td.line-data{width:
99%}
343 div.unbreakable{page-break-inside:avoid}
344 .big{font-size:larger}
345 .small{font-size:smaller}
346 .underline{text-decoration:underline}
347 .overline{text-decoration:overline}
348 .line-through{text-decoration:line-through}
350 .aqua-background{background:#
00fafa}
352 .black-background{background:#
000}
354 .blue-background{background:#
0000fa}
355 .fuchsia{color:#bf00bf}
356 .fuchsia-background{background:#fa00fa}
358 .gray-background{background:#
7d7d7d}
359 .green{color:#
006000}
360 .green-background{background:#
007d00}
362 .lime-background{background:#
00fa00}
363 .maroon{color:#
600000}
364 .maroon-background{background:#
7d0000}
366 .navy-background{background:#
00007d}
367 .olive{color:#
606000}
368 .olive-background{background:#
7d7d00}
369 .purple{color:#
600060}
370 .purple-background{background:#
7d007d}
372 .red-background{background:#fa0000}
373 .silver{color:#
909090}
374 .silver-background{background:#bcbcbc}
376 .teal-background{background:#
007d7d}
377 .white{color:#bfbfbf}
378 .white-background{background:#fafafa}
379 .yellow{color:#bfbf00}
380 .yellow-background{background:#fafa00}
381 span.icon
>.fa{cursor:default}
382 a span.icon
>.fa{cursor:inherit}
383 .admonitionblock td.icon [class^=
"fa icon-"]{font-size:
2.5em;text-shadow:
1px
1px
2px rgba(
0,
0,
0,
.5);cursor:default}
384 .admonitionblock td.icon .icon-note::before{content:
"\f05a";color:#
19407c}
385 .admonitionblock td.icon .icon-tip::before{content:
"\f0eb";text-shadow:
1px
1px
2px rgba(
155,
155,
0,
.8);color:#
111}
386 .admonitionblock td.icon .icon-warning::before{content:
"\f071";color:#bf6900}
387 .admonitionblock td.icon .icon-caution::before{content:
"\f06d";color:#bf3400}
388 .admonitionblock td.icon .icon-important::before{content:
"\f06a";color:#bf0000}
389 .conum[data-value]{display:inline-block;color:#fff!important;background:rgba(
0,
0,
0,
.8);-webkit-border-radius:
100px;border-radius:
100px;text-align:center;font-size:
.75em;width:
1.67em;height:
1.67em;line-height:
1.67em;font-family:
"Open Sans",
"DejaVu Sans",sans-serif;font-style:normal;font-weight:bold}
390 .conum[data-value] *{color:#fff!important}
391 .conum[data-value]+b{display:none}
392 .conum[data-value]::after{content:attr(data-value)}
393 pre .conum[data-value]{position:relative;top:-
.125em}
394 b.conum *{color:inherit!important}
395 .conum:not([data-value]):empty{display:none}
396 dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
397 h1,h2,p,td.content,span.alt{letter-spacing:-
.01em}
398 p strong,td.content strong,div.footnote strong{letter-spacing:-
.005em}
399 p,blockquote,dt,td.content,span.alt{font-size:
1.0625rem}
400 p{margin-bottom:
1.25rem}
401 .sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:
1em}
402 .exampleblock
>.content{background:#fffef7;border-color:#e0e0dc;-webkit-box-shadow:
0 1px
4px #e0e0dc;box-shadow:
0 1px
4px #e0e0dc}
403 .print-only{display:none!important}
404 @page{margin:
1.25cm
.75cm}
405 @media print{*{-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:none!important}
407 a{color:inherit!important;text-decoration:underline!important}
408 a.bare,a[href^=
"#"],a[href^=
"mailto:"]{text-decoration:none!important}
409 a[href^=
"http:"]:not(.bare)::after,a[href^=
"https:"]:not(.bare)::after{content:
"(" attr(href)
")";display:inline-block;font-size:
.875em;padding-left:
.25em}
410 abbr[title]::after{content:
" (" attr(title)
")"}
411 pre,blockquote,tr,img,object,svg{page-break-inside:avoid}
412 thead{display:table-header-group}
414 p,blockquote,dt,td.content{font-size:
1em;orphans:
3;widows:
3}
415 h2,h3,#toctitle,.sidebarblock
>.content
>.title{page-break-after:avoid}
416 #toc,.sidebarblock,.exampleblock
>.content{background:none!important}
417 #toc{border-bottom:
1px solid #dddddf!important;padding-bottom:
0!important}
418 body.book #header{text-align:center}
419 body.book #header
>h1:first-child{border:
0!important;margin:
2.5em
0 1em}
420 body.book #header .details{border:
0!important;display:block;padding:
0!important}
421 body.book #header .details span:first-child{margin-left:
0!important}
422 body.book #header .details br{display:block}
423 body.book #header .details br+span::before{content:none!important}
424 body.book #toc{border:
0!important;text-align:left!important;padding:
0!important;margin:
0!important}
425 body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1
>h2{page-break-before:always}
426 .listingblock code[data-lang]::before{display:block}
427 #footer{padding:
0 .9375em}
428 .hide-on-print{display:none!important}
429 .print-only{display:block!important}
430 .hide-for-print{display:none!important}
431 .show-for-print{display:inherit!important}}
432 @media print,amzn-kf8{#header
>h1:first-child{margin-top:
1.25rem}
433 .sect1{padding:
0!important}
434 .sect1+.sect1{border:
0}
435 #footer{background:none}
436 #footer-text{color:rgba(
0,
0,
0,
.6);font-size:
.9em}}
437 @media amzn-kf8{#header,#content,#footnotes,#footer{padding:
0}}
439 <link rel=
"stylesheet" href=
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
441 <body class=
"article toc2 toc-left">
443 <h1><strong>CTF2-SPECRC-
3.0</strong>: Common Trace Format version
 2 release candidate
</h1>
444 <div class=
"details">
445 <span id=
"author" class=
"author">Philippe Proulx
</span><br>
446 <span id=
"email" class=
"email"><a href=
"mailto:pproulx@efficios.com">pproulx@efficios.com
</a></span><br>
447 <span id=
"revnumber">version
3.0,
</span>
448 <span id=
"revdate">17 December
2021</span>
450 <div id=
"toc" class=
"toc2">
451 <div id=
"toctitle">Table of Contents
</div>
452 <ul class=
"sectlevel1">
453 <li><a href=
"#_revision_history">1. Revision history
</a></li>
454 <li><a href=
"#_whats_ctf2">2. What
’s CTF
 2?
</a></li>
455 <li><a href=
"#_common_definitions">3. Common definitions
</a></li>
456 <li><a href=
"#trace">4. Trace composition
</a>
457 <ul class=
"sectlevel2">
458 <li><a href=
"#metadata-stream-overview">4.1. Metadata stream (overview)
</a></li>
459 <li><a href=
"#ds">4.2. Data stream
</a>
460 <ul class=
"sectlevel3">
461 <li><a href=
"#pkt">4.2.1. Packet
</a></li>
462 <li><a href=
"#er">4.2.2. Event record
</a></li>
465 <li><a href=
"#aux-stream">4.3. Auxiliary stream
</a>
466 <ul class=
"sectlevel3">
467 <li><a href=
"#env">4.3.1. Trace environment
</a></li>
472 <li><a href=
"#metadata-stream">5. Metadata stream
</a>
473 <ul class=
"sectlevel2">
474 <li><a href=
"#uuid">5.1. UUID
</a></li>
475 <li><a href=
"#ext">5.2. Extensions
</a></li>
476 <li><a href=
"#user-attrs">5.3. User attributes
</a></li>
477 <li><a href=
"#fc">5.4. Field classes
</a>
478 <ul class=
"sectlevel3">
479 <li><a href=
"#field-loc">5.4.1. Field location
</a></li>
480 <li><a href=
"#int-range-set">5.4.2. Integer range set
</a></li>
481 <li><a href=
"#roles">5.4.3. Roles
</a></li>
482 <li><a href=
"#fl-ba-fc">5.4.4. Fixed-length bit array field class
</a></li>
483 <li><a href=
"#fl-bool-fc">5.4.5. Fixed-length boolean field class
</a></li>
484 <li><a href=
"#int-fc">5.4.6. Abstract integer field class
</a></li>
485 <li><a href=
"#fl-int-fc">5.4.7. Fixed-length integer field class
</a></li>
486 <li><a href=
"#enum-fc">5.4.8. Abstract enumeration field class
</a></li>
487 <li><a href=
"#fl-enum-fc">5.4.9. Fixed-length enumeration field class
</a></li>
488 <li><a href=
"#fl-fp-fc">5.4.10. Fixed-length floating point number field class
</a></li>
489 <li><a href=
"#vl-ba-fc">5.4.11. Variable-length bit array field class
</a></li>
490 <li><a href=
"#vl-int-fc">5.4.12. Variable-length integer field class
</a></li>
491 <li><a href=
"#vl-enum-fc">5.4.13. Variable-length enumeration field class
</a></li>
492 <li><a href=
"#str-fc">5.4.14. Null-terminated string field class
</a></li>
493 <li><a href=
"#sl-str-fc">5.4.15. Static-length string field class
</a></li>
494 <li><a href=
"#dl-str-fc">5.4.16. Dynamic-length string field class
</a></li>
495 <li><a href=
"#blob-fc">5.4.17. Abstract BLOB field class
</a></li>
496 <li><a href=
"#sl-blob-fc">5.4.18. Static-length BLOB field class
</a></li>
497 <li><a href=
"#dl-blob-fc">5.4.19. Dynamic-length BLOB field class
</a></li>
498 <li><a href=
"#struct-fc">5.4.20. Structure field class
</a></li>
499 <li><a href=
"#array-fc">5.4.21. Abstract array field class
</a></li>
500 <li><a href=
"#sl-array-fc">5.4.22. Static-length array field class
</a></li>
501 <li><a href=
"#dl-array-fc">5.4.23. Dynamic-length array field class
</a></li>
502 <li><a href=
"#opt-fc">5.4.24. Optional field class
</a></li>
503 <li><a href=
"#var-fc">5.4.25. Variant field class
</a></li>
506 <li><a href=
"#preamble-frag">5.5. Preamble fragment
</a></li>
507 <li><a href=
"#tc-frag">5.6. Trace class fragment
</a>
508 <ul class=
"sectlevel3">
509 <li><a href=
"#_roles">5.6.1. Roles
</a></li>
512 <li><a href=
"#cc-frag">5.7. Clock class fragment
</a>
513 <ul class=
"sectlevel3">
514 <li><a href=
"#clock-offset">5.7.1. Clock offset
</a></li>
517 <li><a href=
"#dsc-frag">5.8. Data stream class fragment
</a>
518 <ul class=
"sectlevel3">
519 <li><a href=
"#_roles_2">5.8.1. Roles
</a></li>
522 <li><a href=
"#erc-frag">5.9. Event record class fragment
</a></li>
525 <li><a href=
"#ds-dec">6. Data stream decoding procedure
</a>
526 <ul class=
"sectlevel2">
527 <li><a href=
"#pkt-dec">6.1. Packet decoding procedure
</a></li>
528 <li><a href=
"#er-dec">6.2. Event record decoding procedure
</a>
529 <ul class=
"sectlevel3">
530 <li><a href=
"#clk-val-update">6.2.1. Clock value update procedure
</a></li>
533 <li><a href=
"#field-dec">6.3. Field decoding procedure
</a>
534 <ul class=
"sectlevel3">
535 <li><a href=
"#align-dec">6.3.1. Alignment procedure
</a></li>
536 <li><a href=
"#field-loc-dec">6.3.2. Field location procedure
</a></li>
537 <li><a href=
"#fl-ba-field-dec">6.3.3. Fixed-length bit array field decoding procedure
</a></li>
538 <li><a href=
"#fl-bool-field-dec">6.3.4. Fixed-length boolean field decoding procedure
</a></li>
539 <li><a href=
"#fl-uint-field-dec">6.3.5. Fixed-length unsigned integer field decoding procedure
</a></li>
540 <li><a href=
"#fl-sint-field-dec">6.3.6. Fixed-length signed integer field decoding procedure
</a></li>
541 <li><a href=
"#fl-fp-field-dec">6.3.7. Fixed-length floating point number field decoding procedure
</a></li>
542 <li><a href=
"#vl-ba-field-dec">6.3.8. Variable-length bit array field decoding procedure
</a></li>
543 <li><a href=
"#vl-uint-field-dec">6.3.9. Variable-length unsigned integer field decoding procedure
</a></li>
544 <li><a href=
"#vl-sint-field-dec">6.3.10. Variable-length signed integer field decoding procedure
</a></li>
545 <li><a href=
"#str-field-dec">6.3.11. Null-terminated string field decoding procedure
</a></li>
546 <li><a href=
"#sl-str-field-dec">6.3.12. Static-length string field decoding procedure
</a></li>
547 <li><a href=
"#sl-blob-field-dec">6.3.13. Static-length BLOB field decoding procedure
</a></li>
548 <li><a href=
"#dl-str-field-dec">6.3.14. Dynamic-length string field decoding procedure
</a></li>
549 <li><a href=
"#dl-blob-field-dec">6.3.15. Dynamic-length BLOB field decoding procedure
</a></li>
550 <li><a href=
"#struct-field-dec">6.3.16. Structure field decoding procedure
</a></li>
551 <li><a href=
"#sl-array-field-dec">6.3.17. Static-length array field decoding procedure
</a></li>
552 <li><a href=
"#dl-array-field-dec">6.3.18. Dynamic-length array field decoding procedure
</a></li>
553 <li><a href=
"#opt-field-dec">6.3.19. Optional field decoding procedure
</a></li>
554 <li><a href=
"#var-field-dec">6.3.20. Variant field decoding procedure
</a></li>
564 <div class=
"sectionbody">
565 <div class=
"paragraph">
566 <p>This document is a release candidate of the Common Trace Format (CTF)
567 version
 2 specification (
<em><strong>CTF2-SPEC-
2.0</strong></em>).
</p>
569 <div class=
"admonitionblock important">
573 <i class=
"fa icon-important" title=
"Important"></i>
576 <div class=
"title">RFC
2119</div>
577 The key words
<em>MUST
</em>,
<em>MUST
 NOT
</em>,
<em>REQUIRED
</em>,
578 <em>SHOULD
</em>,
<em>SHOULD
 NOT
</em>,
<em>MAY
</em>, and
<em>OPTIONAL
</em> in this document, when
579 emphasized, are to be interpreted as described in
580 <a href=
"https://www.ietf.org/rfc/rfc2119.txt">RFC
 2119</a>.
588 <h2 id=
"_revision_history">1. Revision history
</h2>
589 <div class=
"sectionbody">
590 <table class=
"tableblock frame-all grid-all fit-content">
591 <caption class=
"title">Table
1. Revision history.
</caption>
599 <th class=
"tableblock halign-left valign-top">Document
</th>
600 <th class=
"tableblock halign-left valign-top">Publication date
</th>
601 <th class=
"tableblock halign-left valign-top">Changes
</th>
606 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>CTF2-SPECRC-
3.0</strong></em></p></td>
607 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">17 December
2021</p></td>
608 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
609 <p>Add the optional
<code>minimum-alignment
</code> property to the
610 <a href=
"#array-fc">abstract array field class
</a>.
</p>
612 <div class=
"paragraph">
613 <p>Such a minimum alignment is needed when the
<a href=
"#align-dec">alignment
614 requirement
</a> of contained array field elements wouldn
’t be enough. For
615 example, a
<a href=
"#producer-def">producer
</a> could write a single
616 32-bit-aligned,
32-bit little-endian integer value, but use the
617 following
<a href=
"#sl-array-fc">static-length array field class
</a> for
<a href=
"#consumer-def">consumers
</a>:
</p>
619 <div class=
"listingblock">
620 <div class=
"content">
621 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
622 "type":
"static-length-array",
624 "minimum-alignment":
32,
625 "element-field-class": {
626 "type":
"fixed-length-boolean",
628 "byte-order":
"little-endian"
633 <div class=
"paragraph">
634 <p>While the producer writes a single integer value, consumers decode said
635 datum as an array of
32 individual flags (booleans).
</p>
637 <div class=
"paragraph">
638 <p>Update the
<a href=
"#align-dec">Alignment procedure
</a> section accordingly.
</p>
642 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>CTF2
‑SPECRC
‑2.0</strong></em></p></td>
643 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">9 December
2021</p></td>
644 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"ulist">
647 <p>Describe how to use a
<a href=
"#field-loc">field location
</a> with a procedure in
648 a new
<a href=
"#field-loc-dec">Field location procedure
</a> section to make constraints easier to
652 <p>Rename the
<code>members
</code> property of a
<a href=
"#struct-fc">structure field class
</a> to
<code>member-classes
</code>
653 as this JSON array contains
654 <a href=
"#struct-member-cls">structure field member classes
</a>.
</p>
657 <p>Make an
<a href=
"#opt-fc">optional field
</a> require that
<em>all
</em> its
658 possible selector fields be boolean fields, unsigned integer fields,
659 or signed integer fields.
</p>
660 <div class=
"paragraph">
661 <p>Correspondingly, make a
<a href=
"#var-fc">variant field
</a> require that
<em>all
</em> its
662 possible selector fields be either unsigned integer fields or signed
665 <div class=
"paragraph">
666 <p>This constraint exists to accomodate some consumer implementations, in
667 particular the ones with limited integer types.
</p>
671 <p>Add the
“nil
” <a href=
"#dec-val-type">decoding value type
</a> so that
672 <a href=
"#opt-field-dec">decoding an optional field
</a> always generates a value.
</p>
675 <p>Specify that an
“array
” decoding value contains a sequence of values,
676 whatever their types.
</p>
677 <div class=
"paragraph">
678 <p>Indeed, an
<a href=
"#array-fc">array field
</a> <em>MAY
</em> contain
<a href=
"#var-fc">variant
679 fields
</a>, making it possible for a resulting array value to contain
680 values having different types.
</p>
687 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>CTF2
‑SPECRC
‑1.0</strong></em></p></td>
688 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">25 November
2021</p></td>
689 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
690 <p>Initial CTF
 2 specification release candidate.
</p>
698 <h2 id=
"_whats_ctf2">2. What
’s CTF
 2?
</h2>
699 <div class=
"sectionbody">
700 <div class=
"paragraph">
701 <p>The
<em><strong>Common Trace Format
</strong></em> version
 2 is a binary
702 <a href=
"https://en.wikipedia.org/wiki/Tracing_(software)">trace
</a> format designed
703 to be very fast to write without compromising great flexibility.
</p>
705 <div class=
"paragraph">
706 <p>The intention of CTF
 2 is that applications written in any programming
707 language, and running on any system (be it Linux or bare metal, for
708 example), can generate traces natively.
</p>
710 <div class=
"paragraph">
711 <p>A CTF
 2 trace has all its
<a href=
"#ds">data streams
</a> described by a
712 <a href=
"#metadata-stream-overview">metadata stream
</a>. Given the rich set of
713 supported
<a href=
"#fc">data field types
</a>, this makes it possible for a CTF
 2
714 <a href=
"#producer-def">producer
</a> to append data structures as is to data
715 streams without further
“data massaging
”. Indeed, the size, alignment,
716 and byte order of fixed-length fields are all configurable parameters
717 within the metadata stream.
</p>
719 <div class=
"paragraph">
720 <p>CTF
 2 is transport agnostic: this document doesn
’t specify how to
721 transport or store CTF
 2 streams. Other documents can specify such
722 conventions, and conform CTF
 2 producers and
<a href=
"#consumer-def">consumers
</a>
723 may or may not adhere to them.
</p>
725 <div class=
"paragraph">
726 <p>CTF
 2 is a major revision of
<a href=
"https://diamon.org/ctf/v1.8.3/">CTF
 1</a>, bringing many improvements, such
732 <p>Using JSON text sequences for the metadata stream.
</p>
735 <p>Adding
<a href=
"#aux-stream">auxiliary streams
</a> (also JSON text sequences).
</p>
738 <p>Simplifying the metadata stream.
</p>
741 <p>Adding new
<a href=
"#fc">field classes
</a>.
</p>
744 <p>Using
<a href=
"#roles">roles
</a> instead of reserved structure member names to
745 identify
“special
” fields.
</p>
749 <div class=
"paragraph">
750 <p>and more, while remaining backward compatible at the data stream level.
</p>
755 <h2 id=
"_common_definitions">3. Common definitions
</h2>
756 <div class=
"sectionbody">
757 <div class=
"paragraph">
758 <p>Common CTF
 2 definitions:
</p>
762 <dt class=
"hdlist1"><a id=
"byte-def"></a> <a href=
"#byte-def">Byte
</a></dt>
764 <p>A group of eight
<a href=
"https://en.wikipedia.org/wiki/Bit">bits
</a> operated on
766 <div class=
"paragraph">
767 <p>The bits are indexed such that, if the byte represents an
8-bit unsigned
768 integer, bit
 0 is the
769 <a href=
"https://en.wikipedia.org/wiki/Bit_numbering#Least_significant_bit">least
770 significant
</a> and bit
 7 is the
771 <a href=
"https://en.wikipedia.org/wiki/Bit_numbering#Most_significant_bit">most
775 <dt class=
"hdlist1"><a id=
"class-def"></a> <a href=
"#class-def">Class
</a></dt>
777 <p>A set of values (instances) which share common properties.
</p>
778 <div class=
"paragraph">
779 <p>For example, a
<a href=
"#fl-int-fc">fixed-length unsigned integer field class
</a> with an
8-bit length property is the set of
780 the all the fixed-length unsigned integer fields from binary
<code>00000000</code> to
<code>11111111</code>
781 (integers
0 to
 255).
</p>
783 <div class=
"paragraph">
784 <p>This specification often states that some class
<em>describes
</em> instances.
785 For example, an
<a href=
"#erc-frag">event record class
</a> describes
<a href=
"#er">event
789 <dt class=
"hdlist1"><a id=
"consumer-def"></a> <a href=
"#consumer-def">Consumer
</a></dt>
791 <p>A software or hardware system which consumes (reads) the streams of
792 a
<a href=
"#trace">trace
</a>.
</p>
793 <div class=
"paragraph">
794 <p>A trace consumer is often a
<em>trace viewer
</em> or a
<em>trace analyzer
</em>.
</p>
797 <dt class=
"hdlist1"><a id=
"ns-def"></a> <a href=
"#ns-def">Namespace
</a></dt>
799 <p>A string of which the purpose is to avoid naming conflicts.
</p>
800 <div class=
"paragraph">
801 <p>This document doesn
’t specify the format of a namespace. A producer
802 <em>SHOULD
</em> use a URI, or at least include a domain name owned by the
803 organization defining the objects under a namespace.
</p>
805 <div class=
"admonitionblock important">
809 <i class=
"fa icon-important" title=
"Important"></i>
812 The
<code>std
</code> namespace is reserved for the CTF
 2 specification.
818 <dt class=
"hdlist1"><a id=
"producer-def"></a> <a href=
"#producer-def">Producer
</a></dt>
820 <p>A software or hardware system which produces (writes) the streams of
821 a
<a href=
"#trace">trace
</a>.
</p>
822 <div class=
"paragraph">
823 <p>A trace producer is often a
<em>tracer
</em>.
</p>
826 <dt class=
"hdlist1"><a id=
"seq-def"></a> <a href=
"#seq-def">Sequence
</a></dt>
828 <p>A set of related items which follow each other in a particular
831 <dt class=
"hdlist1"><a id=
"stream-def"></a> <a href=
"#stream-def">Stream
</a></dt>
833 <p>A
<a href=
"#seq-def">sequence
</a> of
<a href=
"#byte-def">bytes
</a>.
</p>
840 <h2 id=
"trace">4. Trace composition
</h2>
841 <div class=
"sectionbody">
842 <div class=
"paragraph">
848 <p>One
<a href=
"#metadata-stream-overview">metadata stream
</a>.
</p>
851 <p>One or more
<a href=
"#data-stream">data streams
</a>.
</p>
854 <p>Zero or more
<a href=
"#aux-stream">auxiliary streams
</a>.
</p>
858 <div class=
"paragraph">
859 <p>As a reminder, this specification defines a
<a href=
"#stream-def">stream
</a> as a
860 sequence of bytes.
</p>
862 <div class=
"admonitionblock note">
866 <i class=
"fa icon-note" title=
"Note"></i>
869 This document doesn
’t specify how to transport or store CTF
 2
870 streams. A
<a href=
"#producer-def">producer
</a> could serialize all streams as a
871 single file on the file system, or it could send the streams over the
872 network using TCP, to name a few examples.
878 <h3 id=
"metadata-stream-overview">4.1. Metadata stream (overview)
</h3>
879 <div class=
"paragraph">
880 <p>A metadata stream describes trace
<a href=
"#ds">data streams
</a> with JSON objects.
</p>
882 <div class=
"paragraph">
883 <p>A metadata stream describes things such as:
</p>
888 <p>The
<a href=
"#cc-frag">class
</a> of the data stream
<a href=
"#def-clk">default clocks
</a>.
</p>
891 <p>The names of
<a href=
"#erc-frag">event record classes
</a>.
</p>
894 <p>The
<a href=
"#fc">classes
</a> of event record fields.
</p>
898 <div class=
"paragraph">
899 <p>Multiple traces
<em>MAY
</em> share the same metadata stream: a given trace
900 <em>MAY
</em> contain specific information in its own
<a href=
"#aux-stream">auxiliary
903 <div class=
"paragraph">
904 <p>See
<a href=
"#metadata-stream">Metadata stream
</a> for the full metadata stream specification.
</p>
908 <h3 id=
"ds">4.2. Data stream
</h3>
909 <div class=
"paragraph">
910 <p>A
<em>data stream
</em> is a
<a href=
"#seq-def">sequence
</a> of one or more data
911 <a href=
"#pkt">packets
</a>:
</p>
913 <div class=
"imageblock">
914 <div class=
"content">
915 <img src=
"CTF2-SPECRC-3.0-images/ctf-trace-all.svg" alt=
"ctf trace all">
918 <div class=
"paragraph">
919 <p>In the
<a href=
"#metadata-stream">metadata stream
</a>, a
920 <a href=
"#dsc-frag">data stream class
</a> describes data streams.
</p>
922 <div class=
"paragraph">
923 <p>A packet
<em>MUST
</em> contain one or more bytes of data.
</p>
925 <div class=
"paragraph">
926 <p>Although a packet
<em>MAY
</em> contain padding (garbage data) at the end
927 itself, from the point of view of a data stream, there
’s no padding
928 between packets. In other words, the byte following the last byte of a
929 packet is the first byte of the next packet.
</p>
931 <div class=
"paragraph">
932 <p>A data stream
<em>MAY
</em> have, conceptually:
</p>
936 <dt class=
"hdlist1"><a id=
"def-clk"></a> One default, monotonic clock
</dt>
938 <p>Described by a
<a href=
"#cc-frag">clock class
</a> in the metadata stream.
</p>
939 <div class=
"paragraph">
940 <p><a href=
"#pkt">Packets
</a> and
<a href=
"#er">event records
</a> <em>MAY
</em> contain snapshots, named
941 <em>timestamps
</em>, of the default clock of their data stream.
</p>
944 <dt class=
"hdlist1"><a id=
"disc-er-counter"></a> One counter of discarded event records
</dt>
946 <p>Indicates the number of event records which the
947 <a href=
"#producer-def">producer
</a> needed to discard for different reasons.
</p>
948 <div class=
"paragraph">
949 <p>For example, a tracer could discard an event record when it doesn
’t fit
950 some buffer and there
’s no other available buffer.
</p>
952 <div class=
"paragraph">
953 <p>A packet
<em>MAY
</em> contain a snapshot of this counter.
</p>
958 <div class=
"paragraph">
959 <p>See
<a href=
"#ds-dec">Data stream decoding procedure
</a> to learn how to decode a CTF
 2 data stream.
</p>
962 <h4 id=
"pkt">4.2.1. Packet
</h4>
963 <div class=
"paragraph">
964 <p>A
<em>packet
</em> is a segment of a
<a href=
"#ds">data stream
</a>.
</p>
966 <div class=
"paragraph">
967 <p>A packet contains a
<a href=
"#seq-def">sequence
</a> of data
<em>fields
</em> or padding
968 (garbage data). In the metadata stream,
<a href=
"#fc">field classes
</a> describe
971 <div class=
"paragraph">
972 <p>A packet
<em><strong>P
</strong></em>, contained in a data stream
 <em><strong>S
</strong></em>, contains,
975 <div class=
"olist arabic">
978 <p><a id=
"pkt-header"></a> <em>OPTIONAL
</em>: A
<strong>header
</strong> <a href=
"#struct-fc">structure
</a> field,
979 described at the
<a href=
"#tc-frag">trace class
</a> level in the
980 <a href=
"#metadata-stream">metadata stream
</a>, which contains, in this order:
</p>
981 <div class=
"olist loweralpha">
982 <ol class=
"loweralpha" type=
"a">
984 <p><em>OPTIONAL
</em>: A packet magic number field (
0xc1fc1fc1, or
3254525889).
</p>
991 <p><em>OPTIONAL
</em>: A trace class UUID field.
</p>
994 <p><em>OPTIONAL
</em>: One or more fields which contain the numeric ID of the
995 <a href=
"#dsc-frag">class
</a> of
 <em><strong>S
</strong></em>.
</p>
998 <p><em>OPTIONAL
</em>: One or more fields which contain the numeric ID
999 of
 <em><strong>S
</strong></em>.
</p>
1008 <p><a id=
"pkt-ctx"></a> <em>OPTIONAL
</em>: A
<strong>context
</strong> <a href=
"#struct-fc">structure
</a> field,
1009 described at the
<a href=
"#dsc-frag">data stream class
</a> level in the metadata
1010 stream, which contains, in any order:
</p>
1014 <p><em>OPTIONAL
</em>: A field which contains the total size of
 <em><strong>P
</strong></em>,
1015 in bits (always a multiple of
8).
</p>
1018 <p><em>OPTIONAL
</em>: A field which contains the content size of
 <em><strong>P
</strong></em>,
1022 <p><em>OPTIONAL
</em>: A field which contains the beginning timestamp
1023 of
 <em><strong>P
</strong></em>.
</p>
1026 <p><em>OPTIONAL
</em>: A field which contains the end timestamp of
 <em><strong>P
</strong></em>.
</p>
1029 <p><em>OPTIONAL
</em>: A field which contains a snapshot of the
1030 <a href=
"#disc-er-counter">discarded event record counter
</a> of
 <em><strong>S
</strong></em> at
1031 the end of
 <em><strong>P
</strong></em>.
</p>
1034 <p><em>OPTIONAL
</em>: A field which contains the sequence number
1035 of
 <em><strong>P
</strong></em> within
 <em><strong>S
</strong></em>.
</p>
1038 <p><em>OPTIONAL
</em>: User fields.
</p>
1044 <p>Zero or more
<a href=
"#er">event records
</a>.
</p>
1048 <div class=
"paragraph">
1049 <p>A packet
<em>MUST
</em> contain one or more bytes of data.
</p>
1051 <div class=
"paragraph">
1052 <p>A packet
<em>MAY
</em> contain padding (garbage data) after its
<em>last
</em> event
1053 record. The size of this padding is the difference between its total
1054 size and its content size (as found in its
<a href=
"#pkt-ctx">context structure
1057 <div class=
"paragraph">
1058 <p>Packets are independent of each other: if one removes a packet from a
1059 data stream, a
<a href=
"#consumer-def">consumer
</a> can still decode the whole data
1060 stream. This is why:
</p>
1065 <p>Packets
<em>MAY
</em> contain
<em>snapshots
</em> of the
<a href=
"#disc-er-counter">discarded
1066 event record counter
</a> of their data stream.
</p>
1069 <p>Packets and event records
<em>MAY
</em> contain
<em>timestamps
</em> which are
1070 snapshots of the
<a href=
"#def-clk">default clock
</a> of their data stream.
</p>
1074 <div class=
"paragraph">
1075 <p>If the
<a href=
"#pkt-ctx">packet context
</a> fields of the packets of a data stream
1076 contain a
<a href=
"#pkt-seq-num-role">packet sequence number
</a> field, a consumer
1077 can recognize missing packets.
</p>
1079 <div class=
"paragraph">
1080 <p>See
<a href=
"#pkt-dec">Packet decoding procedure
</a> to learn how to decode a CTF
 2 packet.
</p>
1084 <h4 id=
"er">4.2.2. Event record
</h4>
1085 <div class=
"paragraph">
1086 <p>An
<em>event record
</em> is the result of a
<a href=
"#producer-def">producer
</a> writing a
1087 record with
<em>OPTIONAL
</em> user data when an event occurs during its
1090 <div class=
"paragraph">
1091 <p>A
<a href=
"#pkt">packet
</a> contains zero or more event records.
</p>
1093 <div class=
"paragraph">
1094 <p>An
<a href=
"#erc-frag">event record class
</a> describes the specific parts of event
1097 <div class=
"paragraph">
1098 <p>An event record
<em><strong>E
</strong></em>, contained in a
<a href=
"#ds">data stream
</a> <em><strong>S
</strong></em>,
1099 contains, in this order:
</p>
1101 <div class=
"olist arabic">
1104 <p><a id=
"er-header"></a> <em>OPTIONAL
</em>: A
<strong>header
</strong> <a href=
"#struct-fc">structure
</a> field,
1105 described at the
<a href=
"#dsc-frag">data stream class
</a> level in the metadata
1106 stream, which contains, in any order:
</p>
1110 <p><em>OPTIONAL
</em>: One or more fields which contain the numeric ID of the
1111 <a href=
"#erc-frag">class
</a> of
 <em><strong>E
</strong></em> which has the class
1112 of
 <em><strong>S
</strong></em> as its parent.
</p>
1115 <p><em>OPTIONAL
</em>: One or more fields which contain a timestamp or a partial
1122 <p><a id=
"er-common-ctx"></a> <em>OPTIONAL
</em>: A
<strong>common context
</strong>
1123 <a href=
"#struct-fc">structure
</a> field, described at the data stream class
1124 level in the metadata stream, which contains user fields.
</p>
1127 <p><a id=
"er-spec-ctx"></a> <em>OPTIONAL
</em>: A
<strong>specific context
</strong>
1128 <a href=
"#struct-fc">structure
</a> field, described at the event record class
1129 level in the metadata stream, which contains user fields.
</p>
1132 <p><a id=
"er-payload"></a> <em>OPTIONAL
</em>: A
<strong>payload
</strong> <a href=
"#struct-fc">structure
</a> field,
1133 described at the event record class level in the metadata stream,
1134 which contains user fields.
</p>
1138 <div class=
"paragraph">
1139 <p>An event record
<em>MUST
</em> contain one or more bits of data.
</p>
1141 <div class=
"paragraph">
1142 <p>The
<a href=
"#def-clk">default clock
</a> timestamp of an event record, that is, the
1143 value of the default clock of its
<a href=
"#ds">data stream
</a> <em>after
</em> its
1144 <a href=
"#er-header">header field
</a>, if any, is encoded/decoded
<em>MUST
</em> be greater
1145 than or equal to the default clock timestamp of the previous event
1146 record, if any, within the
<em>same
</em> data stream.
</p>
1148 <div class=
"paragraph">
1149 <p>See
<a href=
"#er-dec">Event record decoding procedure
</a> to learn how to decode a CTF
 2 event record.
</p>
1154 <h3 id=
"aux-stream">4.3. Auxiliary stream
</h3>
1155 <div class=
"paragraph">
1156 <p>An auxiliary stream is a JSON text sequence, as specified by
<a href=
"https://datatracker.ietf.org/doc/html/rfc7464">RFC
 7464</a>,
1157 which contains extra, structured information about the trace which
1158 doesn
’t fit the
<a href=
"#ds">data stream
</a> model.
</p>
1160 <div class=
"paragraph">
1161 <p>Each element of an auxiliary stream is a JSON object which has a single
1164 <div class=
"hdlist">
1167 <td class=
"hdlist1">
1170 <td class=
"hdlist2">
1171 <p><a href=
"#ns-def">Namespace
</a> of the auxiliary stream.
</p>
1175 <td class=
"hdlist1">
1178 <td class=
"hdlist2">
1179 <p>A JSON value.
</p>
1184 <div class=
"exampleblock">
1185 <div class=
"title">Example
1. Auxiliary stream element with the
<code>my.tracer
</code> namespace.
</div>
1186 <div class=
"content">
1187 <div class=
"listingblock">
1188 <div class=
"content">
1189 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
1191 "version": [
1,
3,
2],
1192 "session-name":
"amqui"
1199 <div class=
"exampleblock">
1200 <div class=
"title">Example
2. Auxiliary stream element of which the value is just
<code>42</code>.
</div>
1201 <div class=
"content">
1202 <div class=
"listingblock">
1203 <div class=
"content">
1204 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
1205 "328c7a2d-a959-4f60-bd22-cca74359326f":
42
1212 <h4 id=
"env">4.3.1. Trace environment
</h4>
1213 <div class=
"paragraph">
1214 <p>To remain backward compatible with
<a href=
"https://diamon.org/ctf/v1.8.3/">CTF
 1</a>, a trace
<em>MAY
</em> contain an
1215 auxiliary stream having an element with the
<code>std
</code> namespace which
1216 contains trace environment variables under the
<code>environment
</code> property.
</p>
1218 <div class=
"paragraph">
1219 <p>The trace environment variables are a single JSON object where each
1222 <div class=
"hdlist">
1225 <td class=
"hdlist1">
1228 <td class=
"hdlist2">
1229 <p>Trace environment variable name.
</p>
1233 <td class=
"hdlist1">
1236 <td class=
"hdlist2">
1237 <p>Trace environment variable value (any JSON value).
</p>
1242 <div class=
"paragraph">
1243 <p>This document doesn
’t specify trace environment variable names.
</p>
1245 <div class=
"exampleblock">
1246 <div class=
"title">Example
3.
<code>std
</code> auxiliary stream element with trace environment variables.
</div>
1247 <div class=
"content">
1248 <div class=
"listingblock">
1249 <div class=
"content">
1250 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
1253 "hostname":
"amqui",
1256 "kernel_release":
"4.12.12-1-ARCH",
1257 "kernel_version":
"#1 SMP PREEMPT Sun Sep 10 09:41:14 CEST 2017",
1258 "tracer_name":
"lttng-modules",
1261 "tracer_patchlevel":
0
1274 <h2 id=
"metadata-stream">5. Metadata stream
</h2>
1275 <div class=
"sectionbody">
1276 <div class=
"paragraph">
1277 <p>A metadata stream is a JSON text sequence, as specified by
<a href=
"https://datatracker.ietf.org/doc/html/rfc7464">RFC
 7464</a>,
1278 of
<em>fragments
</em>.
</p>
1280 <div class=
"paragraph">
1281 <p>Together, the fragments of a metadata stream contain all the information
1282 about the
<a href=
"#ds">data streams
</a> of one or more
<a href=
"#trace">traces
</a>.
</p>
1284 <div class=
"paragraph">
1285 <p><a id=
"frag"></a> A
<em>fragment
</em> is a JSON object; its allowed properties depend on
1286 its
<code>type
</code> property.
</p>
1288 <table class=
"tableblock frame-all grid-all fit-content">
1289 <caption class=
"title">Table
2. Common properties of a fragment
<em><strong>F
</strong></em>.
</caption>
1299 <th class=
"tableblock halign-left valign-top">Name
</th>
1300 <th class=
"tableblock halign-left valign-top">Type
</th>
1301 <th class=
"tableblock halign-left valign-top">Description
</th>
1302 <th class=
"tableblock halign-left valign-top">Required?
</th>
1303 <th class=
"tableblock halign-left valign-top">Default
</th>
1308 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
1309 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
1310 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
1311 <p>Type of
 <em><strong>F
</strong></em>.
</p>
1313 <div class=
"paragraph">
1314 <p>The value of this property
<em>MUST
</em> be one of:
</p>
1318 <dt class=
"hdlist1"><code>"preamble"</code></dt>
1320 <p><em><strong>F
</strong></em> is a
<a href=
"#preamble-frag">preamble fragment
</a>.
</p>
1322 <dt class=
"hdlist1"><code>"trace-class"</code></dt>
1324 <p><em><strong>F
</strong></em> is a
<a href=
"#tc-frag">trace class fragment
</a>.
</p>
1326 <dt class=
"hdlist1"><code>"clock-class"</code></dt>
1328 <p><em><strong>F
</strong></em> is a
<a href=
"#cc-frag">clock class fragment
</a>.
</p>
1330 <dt class=
"hdlist1"><code>"data-stream-class"</code></dt>
1332 <p><em><strong>F
</strong></em> is a
<a href=
"#dsc-frag">data stream class fragment
</a>.
</p>
1334 <dt class=
"hdlist1"><code>"event-record-class"</code></dt>
1336 <p><em><strong>F
</strong></em> is a
<a href=
"#erc-frag">event record class fragment
</a>.
</p>
1340 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
1341 <td class=
"tableblock halign-left valign-top"></td>
1344 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
1345 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
1346 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
1347 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
1349 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
1350 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
1353 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
1354 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
1355 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
1356 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
1358 <div class=
"paragraph">
1359 <p>For any fragment except a
<a href=
"#preamble-frag">preamble fragment
</a>, any
1360 extension which exists under this property
<em>MUST
</em> also be declared in
1361 the preamble fragment of the same metadata stream.
</p>
1363 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
1364 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
1368 <div class=
"paragraph">
1369 <p>The metadata stream is a JSON text sequence of fragments instead of a
1370 single JSON object containing nested objects to enable real-time, or
1371 “live
”, tracing: a
<a href=
"#consumer-def">consumer
</a> can always decode
1372 <a href=
"#er">event records
</a> having known
<a href=
"#erc-frag">event record classes
</a>
1373 while a
<a href=
"#producer-def">producer
</a> can always add new event record
1374 classes to a
<a href=
"#dsc-frag">data stream class
</a> by appending additional
1375 fragments to the metadata stream. Once a producer appends a fragment to
1376 a metadata stream, the fragment is considered
“frozen
”, in that it
1377 never needs to change.
</p>
1379 <div class=
"paragraph">
1380 <p>A metadata stream:
</p>
1385 <p><em>MUST
</em> start with a preamble fragment.
</p>
1388 <p><em>MUST
</em> contain exactly one
<a href=
"#preamble-frag">preamble fragment
</a>.
</p>
1391 <p><em>MAY
</em> contain one
<a href=
"#tc-frag">trace class fragment
</a>.
</p>
1394 <p><em>MUST
</em> contain one or more
<a href=
"#dsc-frag">data stream class fragments
</a>
1395 which
<em>MUST
</em> follow the trace class fragment, if any.
</p>
1398 <p><em>MAY
</em> contain one or more
<a href=
"#er-frag">event record class fragments
</a>
1399 which
<em>MUST
</em> follow their parent data stream class, if any.
</p>
1403 <div class=
"exampleblock">
1404 <div class=
"title">Example
4. Partial metadata stream.
</div>
1405 <div class=
"content">
1406 <div class=
"paragraph">
1407 <p>In the sample below, the string
<code><RS
></code> represents a single record
1408 separator character (U+
001E) and the string
<code>[...]
</code> represents
1411 <div class=
"listingblock">
1412 <div class=
"content">
1417 <RS
>[...]
</pre>
1422 <div class=
"admonitionblock note">
1426 <i class=
"fa icon-note" title=
"Note"></i>
1428 <td class=
"content">
1429 <div class=
"paragraph">
1430 <p>This section doesn
’t specify how a metadata stream translates into
1431 <a href=
"#ds">data stream
</a> encoding and decoding rules; it only describes
1432 objects and their properties.
</p>
1434 <div class=
"paragraph">
1435 <p>See
<a href=
"#ds-dec">Data stream decoding procedure
</a> to learn how to decode a data stream.
</p>
1442 <h3 id=
"uuid">5.1. UUID
</h3>
1443 <div class=
"paragraph">
1444 <p>Both a
<a href=
"#tc-frag">trace class fragment
</a> and a
<a href=
"#cc-frag">clock class
1445 fragment
</a> <em>MAY
</em> have a
1446 <a href=
"https://en.wikipedia.org/wiki/Universally_unique_identifier"><em>UUID
</em></a>
1449 <div class=
"paragraph">
1450 <p>Within a metadata stream, a UUID is a JSON array of
16 JSON
1451 integers which are the numeric values of the
16 bytes of the
1454 <div class=
"exampleblock">
1455 <div class=
"title">Example
5.
<code>e53e0ab8-
50a1-
4f0a-b710-b5f0bba9c4ac
</code> UUID.
</div>
1456 <div class=
"content">
1457 <div class=
"listingblock">
1458 <div class=
"content">
1459 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">[
229,
62,
10,
184,
80,
161,
79,
10,
183,
16,
181,
240,
187,
169,
196,
172]
</code></pre>
1466 <h3 id=
"ext">5.2. Extensions
</h3>
1467 <div class=
"paragraph">
1468 <p>A
<a href=
"#producer-def">producer
</a> <em>MAY
</em> add
<em>extensions
</em> to many metadata
1469 stream JSON objects.
</p>
1471 <div class=
"paragraph">
1472 <p>The purpose of an extension is to add core features to CTF
 2 or to
1473 modify existing core features, as specified by this document. In other
1474 words, an extension
<em>MAY
</em> <strong>alter
</strong> the format itself.
</p>
1476 <div class=
"paragraph">
1477 <p>This document doesn
’t specify what an extension exactly is.
</p>
1479 <div class=
"paragraph">
1480 <p>The
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream contains
1481 <em>extension declarations
</em>:
</p>
1486 <p>Any extension in metadata stream objects
<em>MUST
</em> be declared, by
1487 namespace and name, in the preamble fragment.
</p>
1488 <div class=
"paragraph">
1489 <p>Declaring an extension is said to
<em>enable
</em> it.
</p>
1493 <p>If a
<a href=
"#consumer-def">consumer
</a> doesn
’t support
<em>any
</em> declared
1494 extension, it
<em>MUST
 NOT
</em> consume the
<a href=
"#ds">data streams
</a> of the
1495 <a href=
"#trace">trace
</a>.
</p>
1496 <div class=
"paragraph">
1497 <p>The consumer
<em>SHOULD
</em> report unsupported extensions as an error.
</p>
1502 <div class=
"paragraph">
1503 <p>Extensions are a single JSON object, where each property is:
</p>
1505 <div class=
"hdlist">
1508 <td class=
"hdlist1">
1511 <td class=
"hdlist2">
1512 <p>A
<a href=
"#ns-def">namespace
</a></p>
1516 <td class=
"hdlist1">
1519 <td class=
"hdlist2">
1520 <p>A
<a href=
"#ns-exts-obj">namespaced extensions object
</a></p>
1525 <div class=
"paragraph">
1526 <p><a id=
"ns-exts-obj"></a> A
<em>namespaced extensions object
</em> is a JSON object, where
1527 each property is:
</p>
1529 <div class=
"hdlist">
1532 <td class=
"hdlist1">
1535 <td class=
"hdlist2">
1536 <p>An extension name
</p>
1540 <td class=
"hdlist1">
1543 <td class=
"hdlist2">
1549 <div class=
"paragraph">
1550 <p>The metadata stream JSON objects which
<em>MAY
</em> contain extensions as their
1551 <code>extensions
</code> property are:
</p>
1556 <p>Any
<a href=
"#frag">fragment
</a>.
</p>
1557 <div class=
"paragraph">
1558 <p>An extension in the
<a href=
"#preamble-frag">preamble fragment
</a> also makes it
1559 <em>declared
</em>/
<em>enabled
</em>.
</p>
1563 <p>Any
<a href=
"#fc">field class
</a>.
</p>
1566 <p>A
<a href=
"#struct-member-cls">structure field member class
</a>.
</p>
1569 <p>A
<a href=
"#var-fc-opt">variant field class option
</a>.
</p>
1573 <div class=
"exampleblock">
1574 <div class=
"title">Example
6. Three extensions under two namespaces.
</div>
1575 <div class=
"content">
1576 <div class=
"listingblock">
1577 <div class=
"content">
1578 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
1582 "temperament":
"equal"
1598 <h3 id=
"user-attrs">5.3. User attributes
</h3>
1599 <div class=
"paragraph">
1600 <p>A
<a href=
"#producer-def">producer
</a> <em>MAY
</em> add custom
<em>user attributes
</em> to many
1601 metadata stream JSON objects.
</p>
1603 <div class=
"paragraph">
1604 <p>This document doesn
’t specify what a user attribute exactly is.
</p>
1606 <div class=
"paragraph">
1607 <p>Unlike
<a href=
"#ext">extensions
</a>, a
<a href=
"#consumer-def">consumer
</a> <em>MUST
 NOT
</em>
1608 consider user attributes to decode
<a href=
"#ds">data streams
</a>.
</p>
1610 <div class=
"paragraph">
1611 <p>User attributes are a single JSON object, where each property is:
</p>
1613 <div class=
"hdlist">
1616 <td class=
"hdlist1">
1619 <td class=
"hdlist2">
1620 <p>A
<a href=
"#ns-def">namespace
</a></p>
1624 <td class=
"hdlist1">
1627 <td class=
"hdlist2">
1633 <div class=
"paragraph">
1634 <p>The metadata stream JSON objects which
<em>MAY
</em> contain user attributes
1635 as their
<code>user-attributes
</code> property are:
</p>
1640 <p>Any
<a href=
"#frag">fragment
</a>.
</p>
1643 <p>Any
<a href=
"#fc">field class
</a>.
</p>
1646 <p>A
<a href=
"#struct-member-cls">structure field member class
</a>.
</p>
1649 <p>A
<a href=
"#var-fc-opt">variant field class option
</a>.
</p>
1653 <div class=
"exampleblock">
1654 <div class=
"title">Example
7. User attributes under two namespaces.
</div>
1655 <div class=
"content">
1656 <div class=
"listingblock">
1657 <div class=
"content">
1658 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
1671 <h3 id=
"fc">5.4. Field classes
</h3>
1672 <div class=
"paragraph">
1673 <p>A
<em>field class
</em> describes fields, that is,
<a href=
"#seq-def">sequences
</a> of bits
1674 as found in a
<a href=
"#ds">data stream
</a>.
</p>
1676 <div class=
"paragraph">
1677 <p>A field class contains all the properties a
<a href=
"#consumer-def">consumer
</a>
1678 needs to
<a href=
"#ds-dec">decode
</a> a given field.
</p>
1680 <div class=
"paragraph">
1681 <p>A
<em>field
</em> is a field class instance.
</p>
1683 <div class=
"paragraph">
1684 <p>This document specifies the following types of field classes:
</p>
1688 <dt class=
"hdlist1">Abstract field classes
</dt>
1690 <p>One cannot use the following field classes directly: they are bases
1691 for other, concrete field classes:
</p>
1695 <p><a href=
"#int-fc">Abstract integer field class
</a></p>
1698 <p><a href=
"#enum-fc">Abstract enumeration field class
</a></p>
1701 <p><a href=
"#array-fc">Abstract array field class
</a></p>
1704 <p><a href=
"#blob-fc">Abstract BLOB field class
</a></p>
1709 <dt class=
"hdlist1">Fixed/static-length field classes
</dt>
1714 <p><a href=
"#fl-ba-fc">Fixed-length bit array field class
</a></p>
1717 <p><a href=
"#fl-bool-fc">Fixed-length boolean field class
</a></p>
1720 <p><a href=
"#fl-int-fc">Fixed-length integer field class
</a></p>
1723 <p><a href=
"#fl-enum-fc">Fixed-length enumeration field class
</a></p>
1726 <p><a href=
"#fl-fp-fc">Fixed-length floating point number field class
</a></p>
1729 <p><a href=
"#sl-str-fc">Static-length string field class
</a></p>
1732 <p><a href=
"#sl-blob-fc">Static-length BLOB field class
</a></p>
1737 <dt class=
"hdlist1">Variable/dynamic-length field classes
</dt>
1742 <p><a href=
"#vl-ba-fc">Variable-length bit array field class
</a></p>
1745 <p><a href=
"#vl-int-fc">Variable-length integer field class
</a></p>
1748 <p><a href=
"#vl-enum-fc">Variable-length enumeration field class
</a></p>
1751 <p><a href=
"#str-fc">Null-terminated string field class
</a></p>
1754 <p><a href=
"#dl-str-fc">Dynamic-length string field class
</a></p>
1757 <p><a href=
"#dl-blob-fc">Dynamic-length BLOB field class
</a></p>
1762 <dt class=
"hdlist1">Compound field classes
</dt>
1764 <p>The following field classes contain one or more field classes.
</p>
1768 <p><a href=
"#struct-fc">Structure field class
</a></p>
1771 <p><a href=
"#sl-array-fc">Static-length array field class
</a></p>
1774 <p><a href=
"#dl-array-fc">Dynamic-length array field class
</a></p>
1777 <p><a href=
"#opt-fc">Optional field class
</a></p>
1780 <p><a href=
"#var-fc">Variant field class
</a></p>
1787 <div class=
"paragraph">
1788 <p>A field class is a JSON object; its properties depend on its
<code>type
</code>
1791 <table class=
"tableblock frame-all grid-all fit-content">
1792 <caption class=
"title">Table
3. Common properties of a field class
<em><strong>F
</strong></em>.
</caption>
1802 <th class=
"tableblock halign-left valign-top">Name
</th>
1803 <th class=
"tableblock halign-left valign-top">Type
</th>
1804 <th class=
"tableblock halign-left valign-top">Description
</th>
1805 <th class=
"tableblock halign-left valign-top">Required?
</th>
1806 <th class=
"tableblock halign-left valign-top">Default
</th>
1811 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
1812 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
1813 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
1814 <p>Type of
 <em><strong>F
</strong></em>.
</p>
1816 <div class=
"paragraph">
1817 <p>The value of this property
<em>MUST
</em> be one of:
</p>
1821 <dt class=
"hdlist1"><code>"fixed-length-bit-array"</code></dt>
1823 <p><em><strong>F
</strong></em> is a
<a href=
"#fl-ba-fc">fixed-length bit array field class
</a>.
</p>
1825 <dt class=
"hdlist1"><code>"fixed-length-boolean"</code></dt>
1827 <p><em><strong>F
</strong></em> is a
<a href=
"#fl-bool-fc">fixed-length boolean field class
</a>.
</p>
1829 <dt class=
"hdlist1"><code>"fixed-length-unsigned-integer"</code></dt>
1830 <dt class=
"hdlist1"><code>"fixed-length-signed-integer"</code></dt>
1832 <p><em><strong>F
</strong></em> is a
<a href=
"#fl-int-fc">fixed-length integer field class
</a>.
</p>
1834 <dt class=
"hdlist1"><code>"fixed-length-unsigned-enumeration"</code></dt>
1835 <dt class=
"hdlist1"><code>"fixed-length-signed-enumeration"</code></dt>
1837 <p><em><strong>F
</strong></em> is a
<a href=
"#fl-enum-fc">fixed-length enumeration field class
</a>.
</p>
1839 <dt class=
"hdlist1"><code>"fixed-length-floating-point-number"</code></dt>
1841 <p><em><strong>F
</strong></em> is a
<a href=
"#fl-fp-fc">fixed-length floating point number field class
</a>.
</p>
1843 <dt class=
"hdlist1"><code>"variable-length-bit-array"</code></dt>
1845 <p><em><strong>F
</strong></em> is a
<a href=
"#vl-ba-fc">variable-length bit array field class
</a>.
</p>
1847 <dt class=
"hdlist1"><code>"variable-length-unsigned-integer"</code></dt>
1848 <dt class=
"hdlist1"><code>"variable-length-signed-integer"</code></dt>
1850 <p><em><strong>F
</strong></em> is a
<a href=
"#vl-int-fc">variable-length integer field class
</a>.
</p>
1852 <dt class=
"hdlist1"><code>"variable-length-unsigned-enumeration"</code></dt>
1853 <dt class=
"hdlist1"><code>"variable-length-signed-enumeration"</code></dt>
1855 <p><em><strong>F
</strong></em> is a
<a href=
"#vl-enum-fc">variable-length enumeration field class
</a>.
</p>
1857 <dt class=
"hdlist1"><code>"null-terminated-string"</code></dt>
1859 <p><em><strong>F
</strong></em> is a
<a href=
"#str-fc">null-terminated string field class
</a>.
</p>
1861 <dt class=
"hdlist1"><code>"static-length-string"</code></dt>
1863 <p><em><strong>F
</strong></em> is a
<a href=
"#sl-str-fc">static-length string field class
</a>.
</p>
1865 <dt class=
"hdlist1"><code>"static-length-blob"</code></dt>
1867 <p><em><strong>F
</strong></em> is a
<a href=
"#sl-blob-fc">static-length BLOB field class
</a>.
</p>
1869 <dt class=
"hdlist1"><code>"dynamic-length-string"</code></dt>
1871 <p><em><strong>F
</strong></em> is a
<a href=
"#dl-str-fc">dynamic-length string field class
</a>.
</p>
1873 <dt class=
"hdlist1"><code>"dynamic-length-blob"</code></dt>
1875 <p><em><strong>F
</strong></em> is a
<a href=
"#dl-blob-fc">dynamic-length BLOB field class
</a>.
</p>
1877 <dt class=
"hdlist1"><code>"structure"</code></dt>
1879 <p><em><strong>F
</strong></em> is a
<a href=
"#struct-fc">structure field class
</a>.
</p>
1881 <dt class=
"hdlist1"><code>"static-length-array"</code></dt>
1883 <p><em><strong>F
</strong></em> is a
<a href=
"#sl-array-fc">static-length array field class
</a>.
</p>
1885 <dt class=
"hdlist1"><code>"dynamic-length-array"</code></dt>
1887 <p><em><strong>F
</strong></em> is a
<a href=
"#dl-array-fc">dynamic-length array field class
</a>.
</p>
1889 <dt class=
"hdlist1"><code>"optional"</code></dt>
1891 <p><em><strong>F
</strong></em> is a
<a href=
"#opt-fc">optional field class
</a>.
</p>
1893 <dt class=
"hdlist1"><code>"variant"</code></dt>
1895 <p><em><strong>F
</strong></em> is a
<a href=
"#var-fc">variant field class
</a>.
</p>
1899 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
1900 <td class=
"tableblock halign-left valign-top"></td>
1903 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>roles
</code></p></td>
1904 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#roles">Roles
</a></p></td>
1905 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
1906 <p>Roles of an instance of
 <em><strong>F
</strong></em>.
</p>
1908 <div class=
"paragraph">
1909 <p>See
<a href=
"#tc-frag">Trace class fragment
</a> and
<a href=
"#dsc-frag">Data stream class fragment
</a> which indicate accepted within their
1910 root field classes.
</p>
1912 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
1913 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>[]
</code></p></td>
1916 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
1917 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
1918 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
1919 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
1921 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
1922 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
1925 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
1926 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
1927 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
1928 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
1930 <div class=
"paragraph">
1931 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
1932 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
1934 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
1935 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
1939 <div class=
"paragraph">
1940 <p>The following
<a href=
"#frag">fragment
</a> properties
<em>MUST
</em> have a
<a href=
"#struct-fc">structure field class
</a> as
1945 <dt class=
"hdlist1"><a href=
"#tc-frag">Trace class fragment
</a></dt>
1947 <p><code>packet-header-field-class
</code></p>
1949 <dt class=
"hdlist1"><a href=
"#dsc-frag">Data stream class fragment
</a></dt>
1954 <p><code>packet-context-field-class
</code></p>
1957 <p><code>event-record-header-field-class
</code></p>
1960 <p><code>event-record-common-context-field-class
</code></p>
1965 <dt class=
"hdlist1"><a href=
"#erc-frag">Event record class fragment
</a></dt>
1970 <p><code>specific-context-field-class
</code></p>
1973 <p><code>payload-field-class
</code></p>
1981 <h4 id=
"field-loc">5.4.1. Field location
</h4>
1982 <div class=
"paragraph">
1983 <p>A
<em>field location
</em> is a means for a
<a href=
"#consumer-def">consumer
</a> to locate
1984 a field which it needs to
<a href=
"#ds-dec">decode
</a> another, subsequent field.
</p>
1986 <div class=
"paragraph">
1987 <p>A consumer needs to locate another field to decode instances of the
1988 following
<a href=
"#fc">classes
</a>:
</p>
1992 <dt class=
"hdlist1"><a href=
"#dl-array-fc">Dynamic-length array field class
</a></dt>
1993 <dt class=
"hdlist1"><a href=
"#dl-str-fc">Dynamic-length string field class
</a></dt>
1994 <dt class=
"hdlist1"><a href=
"#dl-blob-fc">Dynamic-length BLOB field class
</a></dt>
1996 <p>Needs a
<a href=
"#fl-int-fc">fixed-length unsigned integer
</a> or
1997 <a href=
"#vl-int-fc">variable-length unsigned integer
</a> length field.
</p>
1999 <dt class=
"hdlist1"><a href=
"#opt-fc">Optional field class
</a></dt>
2001 <p>Needs a
<a href=
"#fl-bool-fc">fixed-length boolean
</a>,
<a href=
"#fl-int-fc">fixed-length integer
</a>, or
2002 <a href=
"#vl-int-fc">variable-length integer
</a> selector field.
</p>
2004 <dt class=
"hdlist1"><a href=
"#var-fc">Variant field class
</a></dt>
2006 <p>Needs a
<a href=
"#fl-int-fc">fixed-length integer
</a> or
<a href=
"#vl-int-fc">variable-length integer
</a> selector
2011 <div class=
"paragraph">
2012 <p>Let
<em><strong>T
</strong></em> be an anteriorly decoded field which a consumer needs to
2013 decode another field
 <em><strong>S
</strong></em>. A field location is a JSON array
2014 where, in this order:
</p>
2016 <div class=
"olist arabic">
2019 <p>The first element is the name (JSON string) of a root field from
2020 where to start the lookup of
 <em><strong>T
</strong></em>, amongst:
</p>
2021 <div class=
"openblock">
2022 <div class=
"content">
2023 <div class=
"hdlist">
2026 <td class=
"hdlist1">
2027 <code>"packet-header"</code>
2029 <td class=
"hdlist2">
2030 <p><a href=
"#pkt-header">Header
</a> of the
<a href=
"#pkt">packet
</a> of
 <em><strong>S
</strong></em>.
</p>
2034 <td class=
"hdlist1">
2035 <code>"packet-context"</code>
2037 <td class=
"hdlist2">
2038 <p><a href=
"#pkt-ctx">Context
</a> of the packet of
 <em><strong>S
</strong></em>.
</p>
2042 <td class=
"hdlist1">
2043 <code>"event-record-header"</code>
2045 <td class=
"hdlist2">
2046 <p><a href=
"#er-header">Header
</a> of the
<a href=
"#er">event record
</a> of
 <em><strong>S
</strong></em>.
</p>
2050 <td class=
"hdlist1">
2051 <code>"event-record-common-context"</code>
2053 <td class=
"hdlist2">
2054 <p><a href=
"#er-common-ctx">Common context
</a> of the event record of
 <em><strong>S
</strong></em>.
</p>
2058 <td class=
"hdlist1">
2059 <code>"event-record-specific-context"</code>
2061 <td class=
"hdlist2">
2062 <p><a href=
"#er-spec-ctx">Specific context
</a> of the event record of
 <em><strong>S
</strong></em>.
</p>
2066 <td class=
"hdlist1">
2067 <code>"event-record-payload"</code>
2069 <td class=
"hdlist2">
2070 <p><a href=
"#er-payload">Payload
</a> of the event record of
 <em><strong>S
</strong></em>.
</p>
2077 <div class=
"paragraph">
2078 <p>In other words,
<em><strong>T
</strong></em> <em>MUST
</em> be in the same packet or event record
2079 as
 <em><strong>S
</strong></em>.
</p>
2083 <p>The following elements are
<a href=
"#struct-fc">structure
</a> field member names
2084 (JSON strings) to follow to locate the target field.
</p>
2088 <div class=
"paragraph">
2089 <p>The length of a field location
<em>MUST
</em> be greater than or equal to two.
</p>
2091 <div class=
"paragraph">
2092 <p>See
<a href=
"#field-loc-dec">Field location procedure
</a> to learn how to locate a field with a field
2097 <h4 id=
"int-range-set">5.4.2. Integer range set
</h4>
2098 <div class=
"paragraph">
2099 <p>An
<em>integer range set
</em> is a JSON array of integer ranges.
</p>
2101 <div class=
"paragraph">
2102 <p>An integer range set
<em>MUST
</em> contain one or more integer ranges.
</p>
2104 <div class=
"paragraph">
2105 <p>An
<em>integer range
</em> is a JSON array of two elements:
</p>
2107 <div class=
"olist arabic">
2110 <p>The lower bound of the range (JSON integer, included).
</p>
2113 <p>The upper bound of the range (JSON integer, included).
</p>
2117 <div class=
"paragraph">
2118 <p>An integer range represents all the integer values from the lower bound
2119 of the range to its upper bound.
</p>
2121 <div class=
"paragraph">
2122 <p>The upper bound of an integer range
<em>MUST
</em> be greater than or equal to
2123 its lower bound.
</p>
2125 <div class=
"paragraph">
2126 <p>If both the lower and upper bounds of an integer range are equal, then
2127 the integer range represents a single integer value.
</p>
2129 <div class=
"exampleblock">
2130 <div class=
"title">Example
8. Integer ranges.
</div>
2131 <div class=
"content">
2132 <div class=
"listingblock">
2133 <div class=
"content">
2134 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">[
3,
67]
</code></pre>
2137 <div class=
"listingblock">
2138 <div class=
"content">
2139 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">[-
45,
101]
</code></pre>
2142 <div class=
"listingblock">
2143 <div class=
"title">Single integer value.
</div>
2144 <div class=
"content">
2145 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">[
42,
42]
</code></pre>
2150 <div class=
"exampleblock">
2151 <div class=
"title">Example
9. Integer range set containing three integer ranges.
</div>
2152 <div class=
"content">
2153 <div class=
"listingblock">
2154 <div class=
"content">
2155 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">[[
3,
67], [-
45,
1], [
42,
42]]
</code></pre>
2162 <h4 id=
"roles">5.4.3. Roles
</h4>
2163 <div class=
"paragraph">
2164 <p>Some
<a href=
"#fc">field class
</a> instances can have
<em>roles
</em>.
</p>
2166 <div class=
"paragraph">
2167 <p>A role is specific semantics attached to the fields (instances) of a
2168 field class. For example, the
<code>packet-magic-number
</code> role of a
2169 <a href=
"#fl-int-fc">fixed-length integer field class
</a> indicates that the value of its instances
<em>MUST
</em> be the
2170 <a href=
"#pkt">packet
</a> magic number (
0xc1fc1fc1).
</p>
2172 <div class=
"paragraph">
2173 <p>Roles are a JSON array of role names (JSON strings).
</p>
2175 <div class=
"paragraph">
2176 <p>See
<a href=
"#tc-frag">Trace class fragment
</a> and
<a href=
"#dsc-frag">Data stream class fragment
</a> which indicate accepted roles within
2177 their root field classes.
</p>
2181 <h4 id=
"fl-ba-fc">5.4.4. Fixed-length bit array field class
</h4>
2182 <div class=
"paragraph">
2183 <p>A
<em>fixed-length bit array
</em> field class describes
<em>fixed-length bit array
</em> fields.
</p>
2185 <div class=
"paragraph">
2186 <p>A fixed-length bit array field is a simple array of contiguous bits, without any
2187 attached integer type semantics.
</p>
2189 <div class=
"paragraph">
2190 <p>The length, or number of bits, of a fixed-length bit array field is a property
2191 (
<code>length
</code>) of its class.
</p>
2193 <div class=
"paragraph">
2194 <p>A fixed-length bit array field class acts as a base of a
<a href=
"#fl-bool-fc">fixed-length boolean field class
</a>, a
<a href=
"#fl-int-fc">fixed-length integer field class
</a>,
2195 and a
<a href=
"#fl-fp-fc">fixed-length floating point number field class
</a>.
</p>
2197 <table class=
"tableblock frame-all grid-all fit-content">
2198 <caption class=
"title">Table
4. Common properties of a fixed-length bit array field class
<em><strong>F
</strong></em>.
</caption>
2208 <th class=
"tableblock halign-left valign-top">Name
</th>
2209 <th class=
"tableblock halign-left valign-top">Type
</th>
2210 <th class=
"tableblock halign-left valign-top">Description
</th>
2211 <th class=
"tableblock halign-left valign-top">Required?
</th>
2212 <th class=
"tableblock halign-left valign-top">Default
</th>
2217 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
2218 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
2219 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2220 <p>Type of
 <em><strong>F
</strong></em>.
</p>
2222 <div class=
"paragraph">
2223 <p>The value of this property
<em>MUST
</em> be
<code>"fixed-length-bit-array"</code>.
</p>
2225 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
2226 <td class=
"tableblock halign-left valign-top"></td>
2229 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>length
</code></p></td>
2230 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
2231 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2232 <p>Number of bits of an instance of
 <em><strong>F
</strong></em>.
</p>
2234 <div class=
"paragraph">
2235 <p>The value of this property
<em>MUST
</em> be greater than zero.
</p>
2237 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
2238 <td class=
"tableblock halign-left valign-top"></td>
2241 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>byte-order
</code></p></td>
2242 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
2243 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2244 <p><a href=
"https://en.wikipedia.org/wiki/Endianness">Byte order
</a> of an instance of
 <em><strong>F
</strong></em>.
</p>
2246 <div class=
"paragraph">
2247 <p>The value of this property
<em>MUST
</em> be one of:
</p>
2251 <dt class=
"hdlist1"><code>"big-endian"</code></dt>
2255 <dt class=
"hdlist1"><code>"little-endian"</code></dt>
2257 <p>Little-endian.
</p>
2261 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
2262 <td class=
"tableblock halign-left valign-top"></td>
2265 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>alignment
</code></p></td>
2266 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
2267 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2268 <p>Alignment of the first bit of an instance of
 <em><strong>F
</strong></em>
2269 relative to the beginning of the
<a href=
"#pkt">packet
</a> which
2270 contains this instance.
</p>
2272 <div class=
"paragraph">
2273 <p>The value of this property
<em>MUST
</em> be a positive power of two.
</p>
2275 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
2276 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>1</code></p></td>
2279 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>roles
</code></p></td>
2280 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#roles">Roles
</a></p></td>
2281 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2282 <p>Roles of an instance of
 <em><strong>F
</strong></em>.
</p>
2284 <div class=
"paragraph">
2285 <p>See
<a href=
"#tc-frag">Trace class fragment
</a> and
<a href=
"#dsc-frag">Data stream class fragment
</a> which indicate accepted within their
2286 root field classes.
</p>
2288 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
2289 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>[]
</code></p></td>
2292 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
2293 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
2294 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2295 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
2297 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
2298 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
2301 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
2302 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
2303 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2304 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
2306 <div class=
"paragraph">
2307 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
2308 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
2310 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
2311 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
2315 <div class=
"exampleblock">
2316 <div class=
"title">Example
10. Minimal fixed-length bit array field class.
</div>
2317 <div class=
"content">
2318 <div class=
"listingblock">
2319 <div class=
"content">
2320 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
2321 "type":
"fixed-length-bit-array",
2323 "byte-order":
"little-endian"
2329 <div class=
"exampleblock">
2330 <div class=
"title">Example
11. Fixed-length bit array field class with instances aligned to
32 bits.
</div>
2331 <div class=
"content">
2332 <div class=
"listingblock">
2333 <div class=
"content">
2334 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
2335 "type":
"fixed-length-bit-array",
2337 "byte-order":
"big-endian",
2344 <div class=
"exampleblock">
2345 <div class=
"title">Example
12. Fixed-length bit array field class with
<a href=
"#user-attrs">user attributes
</a>.
</div>
2346 <div class=
"content">
2347 <div class=
"listingblock">
2348 <div class=
"content">
2349 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
2350 "type":
"fixed-length-bit-array",
2352 "byte-order":
"little-endian",
2353 "user-attributes": {
2365 <h4 id=
"fl-bool-fc">5.4.5. Fixed-length boolean field class
</h4>
2366 <div class=
"paragraph">
2367 <p>A
<em>fixed-length boolean
</em> field class is a
<a href=
"#fl-ba-fc">fixed-length bit array field class
</a> which describes
<em>fixed-length boolean
</em>
2370 <div class=
"paragraph">
2371 <p>A fixed-length boolean field is a fixed-length bit array field which has the following semantics:
</p>
2375 <dt class=
"hdlist1">If all the bits of the bit array field are cleared (zero)
</dt>
2377 <p>The value of the fixed-length boolean field is
<em>false
</em>.
</p>
2379 <dt class=
"hdlist1">Otherwise
</dt>
2381 <p>The value of the fixed-length boolean field is
<em>true
</em>.
</p>
2385 <table class=
"tableblock frame-all grid-all fit-content">
2386 <caption class=
"title">Table
5. Properties of a fixed-length boolean field class
<em><strong>F
</strong></em>.
</caption>
2396 <th class=
"tableblock halign-left valign-top">Name
</th>
2397 <th class=
"tableblock halign-left valign-top">Type
</th>
2398 <th class=
"tableblock halign-left valign-top">Description
</th>
2399 <th class=
"tableblock halign-left valign-top">Required?
</th>
2400 <th class=
"tableblock halign-left valign-top">Default
</th>
2405 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
2406 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
2407 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2408 <p>Type of
 <em><strong>F
</strong></em>.
</p>
2410 <div class=
"paragraph">
2411 <p>The value of this property
<em>MUST
</em> be
<code>"fixed-length-boolean"</code>.
</p>
2413 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
2414 <td class=
"tableblock halign-left valign-top"></td>
2417 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>length
</code></p></td>
2418 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
2419 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2420 <p>Number of bits of an instance of
 <em><strong>F
</strong></em>.
</p>
2422 <div class=
"paragraph">
2423 <p>The value of this property
<em>MUST
</em> be greater than zero.
</p>
2425 <div class=
"paragraph">
2426 <p>Property inherited from the
<a href=
"#fl-ba-fc">fixed-length bit array field class
</a>.
</p>
2428 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
2429 <td class=
"tableblock halign-left valign-top"></td>
2432 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>byte-order
</code></p></td>
2433 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
2434 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2435 <p><a href=
"https://en.wikipedia.org/wiki/Endianness">Byte order
</a> of an instance
2436 of
 <em><strong>F
</strong></em>.
</p>
2438 <div class=
"paragraph">
2439 <p>The value of this property
<em>MUST
</em> be one of:
</p>
2443 <dt class=
"hdlist1"><code>"big-endian"</code></dt>
2447 <dt class=
"hdlist1"><code>"little-endian"</code></dt>
2449 <p>Little-endian.
</p>
2453 <div class=
"paragraph">
2454 <p>Property inherited from the
<a href=
"#fl-ba-fc">fixed-length bit array field class
</a>.
</p>
2456 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
2457 <td class=
"tableblock halign-left valign-top"></td>
2460 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>alignment
</code></p></td>
2461 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
2462 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2463 <p>Alignment of the first bit of an instance of
 <em><strong>F
</strong></em>
2464 relative to the beginning of the
<a href=
"#pkt">packet
</a> which
2465 contains this instance.
</p>
2467 <div class=
"paragraph">
2468 <p>The value of this property
<em>MUST
</em> be a positive power of two.
</p>
2470 <div class=
"paragraph">
2471 <p>Property inherited from the
<a href=
"#fl-ba-fc">fixed-length bit array field class
</a>.
</p>
2473 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
2474 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>1</code></p></td>
2477 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>roles
</code></p></td>
2478 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#roles">Roles
</a></p></td>
2479 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2480 <p>Roles of an instance of
 <em><strong>F
</strong></em>.
</p>
2482 <div class=
"paragraph">
2483 <p>See
<a href=
"#tc-frag">Trace class fragment
</a> and
<a href=
"#dsc-frag">Data stream class fragment
</a> which indicate accepted within their
2484 root field classes.
</p>
2486 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
2487 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>[]
</code></p></td>
2490 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
2491 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
2492 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2493 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
2495 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
2496 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
2499 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
2500 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
2501 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2502 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
2504 <div class=
"paragraph">
2505 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
2506 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
2508 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
2509 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
2513 <div class=
"exampleblock">
2514 <div class=
"title">Example
13. Minimal fixed-length boolean field class.
</div>
2515 <div class=
"content">
2516 <div class=
"listingblock">
2517 <div class=
"content">
2518 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
2519 "type":
"fixed-length-boolean",
2521 "byte-order":
"little-endian"
2527 <div class=
"exampleblock">
2528 <div class=
"title">Example
14. Fixed-length boolean field class with instances aligned to
32 bits.
</div>
2529 <div class=
"content">
2530 <div class=
"listingblock">
2531 <div class=
"content">
2532 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
2533 "type":
"fixed-length-boolean",
2535 "byte-order":
"big-endian",
2542 <div class=
"exampleblock">
2543 <div class=
"title">Example
15. Fixed-length boolean field class with
<a href=
"#user-attrs">user attributes
</a>.
</div>
2544 <div class=
"content">
2545 <div class=
"listingblock">
2546 <div class=
"content">
2547 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
2548 "type":
"fixed-length-boolean",
2550 "byte-order":
"little-endian",
2551 "user-attributes": {
2563 <h4 id=
"int-fc">5.4.6. Abstract integer field class
</h4>
2564 <div class=
"paragraph">
2565 <p>An
<em>abstract integer
</em> field class is a base of a
<a href=
"#fl-int-fc">fixed-length integer field class
</a> and a
2566 <a href=
"#vl-int-fc">variable-length integer field class
</a>.
</p>
2568 <div class=
"paragraph">
2569 <p>This field class is abstract in that it only exists to show the relation
2570 between different integer field classes in this document: a
2571 <a href=
"#pkt">packet
</a> cannot contain an abstract integer field.
</p>
2573 <table class=
"tableblock frame-all grid-all fit-content">
2574 <caption class=
"title">Table
6. Common property of an integer field class
<em><strong>F
</strong></em>.
</caption>
2584 <th class=
"tableblock halign-left valign-top">Name
</th>
2585 <th class=
"tableblock halign-left valign-top">Type
</th>
2586 <th class=
"tableblock halign-left valign-top">Description
</th>
2587 <th class=
"tableblock halign-left valign-top">Required?
</th>
2588 <th class=
"tableblock halign-left valign-top">Default
</th>
2593 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>preferred-display-base
</code></p></td>
2594 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
2595 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2596 <p>Preferred base to display the value of an instance of
 <em><strong>F
</strong></em>.
</p>
2598 <div class=
"paragraph">
2599 <p>The value of this property
<em>MUST
</em> be one of:
</p>
2601 <div class=
"hdlist">
2604 <td class=
"hdlist1">
2607 <td class=
"hdlist2">
2612 <td class=
"hdlist1">
2615 <td class=
"hdlist2">
2620 <td class=
"hdlist1">
2623 <td class=
"hdlist2">
2624 <p>Decimal base.
</p>
2628 <td class=
"hdlist1">
2631 <td class=
"hdlist2">
2632 <p>Hexadecimal base.
</p>
2637 <div class=
"paragraph">
2638 <p>This property exists to remain backward compatible with
<a href=
"https://diamon.org/ctf/v1.8.3/">CTF
 1</a>:
2639 it
’s not strictly needed to decode an instance of
 <em><strong>F
</strong></em>.
</p>
2641 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
2642 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>10</code></p></td>
2648 <h4 id=
"fl-int-fc">5.4.7. Fixed-length integer field class
</h4>
2649 <div class=
"paragraph">
2650 <p>A
<em>fixed-length integer
</em> field class is both an
<a href=
"#int-fc">abstract integer field
2651 class
</a> and a
<a href=
"#fl-ba-fc">fixed-length bit array field class
</a> which describes
<em>fixed-length integer
</em> fields.
</p>
2653 <div class=
"paragraph">
2654 <p>A fixed-length integer field is a fixed-length bit array field which has integer semantics.
</p>
2656 <div class=
"paragraph">
2657 <p>If the value of the
<code>type
</code> property of a fixed-length integer is
2658 <code>"fixed-length-signed-integer"</code>, then its instances have the two
’s
2659 complement format.
</p>
2661 <div class=
"paragraph">
2662 <p>A fixed-length integer field class acts as a base of a
<a href=
"#fl-enum-fc">fixed-length enumeration field class
</a>.
</p>
2664 <table class=
"tableblock frame-all grid-all fit-content">
2665 <caption class=
"title">Table
7. Common properties of a fixed-length integer field class
<em><strong>F
</strong></em>.
</caption>
2675 <th class=
"tableblock halign-left valign-top">Name
</th>
2676 <th class=
"tableblock halign-left valign-top">Type
</th>
2677 <th class=
"tableblock halign-left valign-top">Description
</th>
2678 <th class=
"tableblock halign-left valign-top">Required?
</th>
2679 <th class=
"tableblock halign-left valign-top">Default
</th>
2684 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
2685 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
2686 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2687 <p>Type of
 <em><strong>F
</strong></em>.
</p>
2689 <div class=
"paragraph">
2690 <p>The value of this property
<em>MUST
</em> be one of:
</p>
2694 <dt class=
"hdlist1"><code>"fixed-length-unsigned-integer"</code></dt>
2696 <p>The instances of
 <em><strong>F
</strong></em> are fixed-length unsigned integer fields.
</p>
2698 <dt class=
"hdlist1"><code>"fixed-length-signed-integer"</code></dt>
2700 <p>The instances of
 <em><strong>F
</strong></em> are fixed-length signed integer fields.
</p>
2704 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
2705 <td class=
"tableblock halign-left valign-top"></td>
2708 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>length
</code></p></td>
2709 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
2710 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2711 <p>Number of bits of an instance of
 <em><strong>F
</strong></em>.
</p>
2713 <div class=
"paragraph">
2714 <p>The value of this property
<em>MUST
</em> be greater than zero.
</p>
2716 <div class=
"paragraph">
2717 <p>Property inherited from the
<a href=
"#fl-ba-fc">fixed-length bit array field class
</a>.
</p>
2719 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
2720 <td class=
"tableblock halign-left valign-top"></td>
2723 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>byte-order
</code></p></td>
2724 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
2725 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2726 <p><a href=
"https://en.wikipedia.org/wiki/Endianness">Byte order
</a> of an instance
2727 of
 <em><strong>F
</strong></em>.
</p>
2729 <div class=
"paragraph">
2730 <p>The value of this property
<em>MUST
</em> be one of:
</p>
2734 <dt class=
"hdlist1"><code>"big-endian"</code></dt>
2738 <dt class=
"hdlist1"><code>"little-endian"</code></dt>
2740 <p>Little-endian.
</p>
2744 <div class=
"paragraph">
2745 <p>Property inherited from the
<a href=
"#fl-ba-fc">fixed-length bit array field class
</a>.
</p>
2747 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
2748 <td class=
"tableblock halign-left valign-top"></td>
2751 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>alignment
</code></p></td>
2752 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
2753 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2754 <p>Alignment of the first bit of an instance of
 <em><strong>F
</strong></em>
2755 relative to the beginning of the
<a href=
"#pkt">packet
</a> which
2756 contains this instance.
</p>
2758 <div class=
"paragraph">
2759 <p>The value of this property
<em>MUST
</em> be a positive power of two.
</p>
2761 <div class=
"paragraph">
2762 <p>Property inherited from the
<a href=
"#fl-ba-fc">fixed-length bit array field class
</a>.
</p>
2764 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
2765 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>1</code></p></td>
2768 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>preferred-display-base
</code></p></td>
2769 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
2770 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2771 <p>Preferred base to display the value of an instance of
 <em><strong>F
</strong></em>.
</p>
2773 <div class=
"paragraph">
2774 <p>The value of this property
<em>MUST
</em> be one of:
</p>
2776 <div class=
"hdlist">
2779 <td class=
"hdlist1">
2782 <td class=
"hdlist2">
2787 <td class=
"hdlist1">
2790 <td class=
"hdlist2">
2795 <td class=
"hdlist1">
2798 <td class=
"hdlist2">
2799 <p>Decimal base.
</p>
2803 <td class=
"hdlist1">
2806 <td class=
"hdlist2">
2807 <p>Hexadecimal base.
</p>
2812 <div class=
"paragraph">
2813 <p>This property exists to remain backward compatible with
<a href=
"https://diamon.org/ctf/v1.8.3/">CTF
 1</a>:
2814 it
’s not strictly needed to decode an instance of
 <em><strong>F
</strong></em>.
</p>
2816 <div class=
"paragraph">
2817 <p>Property inherited from the
<a href=
"#int-fc">abstract integer field class
</a>.
</p>
2819 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
2820 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>10</code></p></td>
2823 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>roles
</code></p></td>
2824 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#roles">Roles
</a></p></td>
2825 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2826 <p>Roles of an instance of
 <em><strong>F
</strong></em>.
</p>
2828 <div class=
"paragraph">
2829 <p>See
<a href=
"#tc-frag">Trace class fragment
</a> and
<a href=
"#dsc-frag">Data stream class fragment
</a> which indicate accepted within their
2830 root field classes.
</p>
2832 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
2833 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>[]
</code></p></td>
2836 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
2837 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
2838 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2839 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
2841 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
2842 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
2845 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
2846 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
2847 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2848 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
2850 <div class=
"paragraph">
2851 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
2852 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
2854 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
2855 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
2859 <div class=
"exampleblock">
2860 <div class=
"title">Example
16. Minimal fixed-length unsigned integer field class.
</div>
2861 <div class=
"content">
2862 <div class=
"listingblock">
2863 <div class=
"content">
2864 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
2865 "type":
"fixed-length-unsigned-integer",
2867 "byte-order":
"little-endian"
2873 <div class=
"exampleblock">
2874 <div class=
"title">Example
17. Fixed-length signed integer field class with instances aligned to
32 bits.
</div>
2875 <div class=
"content">
2876 <div class=
"listingblock">
2877 <div class=
"content">
2878 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
2879 "type":
"fixed-length-signed-integer",
2881 "byte-order":
"big-endian",
2888 <div class=
"exampleblock">
2889 <div class=
"title">Example
18. Fixed-length unsigned integer field class with instances to be preferably displayed with a hexadecimal base.
</div>
2890 <div class=
"content">
2891 <div class=
"listingblock">
2892 <div class=
"content">
2893 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
2894 "type":
"fixed-length-unsigned-integer",
2896 "byte-order":
"big-endian",
2897 "preferred-display-base":
16
2903 <div class=
"exampleblock">
2904 <div class=
"title">Example
19. Fixed-length signed integer field class with
<a href=
"#user-attrs">user attributes
</a>.
</div>
2905 <div class=
"content">
2906 <div class=
"listingblock">
2907 <div class=
"content">
2908 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
2909 "type":
"fixed-length-signed-integer",
2911 "byte-order":
"little-endian",
2912 "user-attributes": {
2924 <h4 id=
"enum-fc">5.4.8. Abstract enumeration field class
</h4>
2925 <div class=
"paragraph">
2926 <p>An
<em>abstract enumeration
</em> field class is a base of a
<a href=
"#fl-enum-fc">fixed-length enumeration field class
</a> and a
2927 <a href=
"#vl-enum-fc">variable-length enumeration field class
</a>.
</p>
2929 <div class=
"paragraph">
2930 <p>This field class is abstract in that it only exists to show the relation
2931 between different enumeration field classes in this document: a
2932 <a href=
"#pkt">packet
</a> cannot contain an abstract enumeration field.
</p>
2934 <div class=
"paragraph">
2935 <p>An abstract enumeration field class is an
<a href=
"#int-fc">abstract integer
2936 field class
</a>.
</p>
2938 <div class=
"paragraph">
2939 <p>An enumeration field is an integer field which
<em>MAY
</em> have one or more
2940 associated names thanks to the
<code>mappings
</code> property of its class.
</p>
2942 <table class=
"tableblock frame-all grid-all fit-content">
2943 <caption class=
"title">Table
8. Common property of an enumeration field class
<em><strong>F
</strong></em>.
</caption>
2953 <th class=
"tableblock halign-left valign-top">Name
</th>
2954 <th class=
"tableblock halign-left valign-top">Type
</th>
2955 <th class=
"tableblock halign-left valign-top">Description
</th>
2956 <th class=
"tableblock halign-left valign-top">Required?
</th>
2957 <th class=
"tableblock halign-left valign-top">Default
</th>
2962 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>preferred-display-base
</code></p></td>
2963 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
2964 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
2965 <p>Preferred base to display the value of an instance of
 <em><strong>F
</strong></em>.
</p>
2967 <div class=
"paragraph">
2968 <p>The value of this property
<em>MUST
</em> be one of:
</p>
2970 <div class=
"hdlist">
2973 <td class=
"hdlist1">
2976 <td class=
"hdlist2">
2981 <td class=
"hdlist1">
2984 <td class=
"hdlist2">
2989 <td class=
"hdlist1">
2992 <td class=
"hdlist2">
2993 <p>Decimal base.
</p>
2997 <td class=
"hdlist1">
3000 <td class=
"hdlist2">
3001 <p>Hexadecimal base.
</p>
3006 <div class=
"paragraph">
3007 <p>This property exists to remain backward compatible with
<a href=
"https://diamon.org/ctf/v1.8.3/">CTF
 1</a>:
3008 it
’s not strictly needed to decode an instance of
 <em><strong>F
</strong></em>.
</p>
3010 <div class=
"paragraph">
3011 <p>Property inherited from the
<a href=
"#int-fc">abstract integer field class
</a>.
</p>
3013 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
3014 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>10</code></p></td>
3017 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>mappings
</code></p></td>
3018 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#enum-fc-mappings">Enumeration field class mappings
</a></p></td>
3019 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3020 <p>Mappings of
 <em><strong>F
</strong></em>.
</p>
3022 <div class=
"paragraph">
3023 <p>The value of this property
<em>MUST
</em> contain one or more properties.
</p>
3025 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
3026 <td class=
"tableblock halign-left valign-top"></td>
3031 <h5 id=
"enum-fc-mappings">5.4.8.1. Enumeration field class mappings
</h5>
3032 <div class=
"paragraph">
3033 <p><em>Enumeration field class mappings
</em> map names to
3034 <a href=
"#int-range-set">integer range sets
</a>.
</p>
3036 <div class=
"paragraph">
3037 <p>Enumeration field class mappings are a JSON object, where each property
3040 <div class=
"hdlist">
3043 <td class=
"hdlist1">
3046 <td class=
"hdlist2">
3047 <p>Mapping name.
</p>
3051 <td class=
"hdlist1">
3054 <td class=
"hdlist2">
3055 <p>Mapped ranges of integers (
<a href=
"#int-range-set">integer range set
</a>).
</p>
3060 <div class=
"paragraph">
3061 <p>The integer ranges of two given mappings
<em>MAY
</em> overlap.
</p>
3063 <div class=
"paragraph">
3064 <p>Enumeration field class mappings
<em>MUST
</em> contain one or more properties.
</p>
3066 <div class=
"exampleblock">
3067 <div class=
"title">Example
20. Enumeration field class mappings with three mappings.
</div>
3068 <div class=
"content">
3069 <div class=
"paragraph">
3070 <p>In this example, the
<code>fortune
</code> and
<code>building
</code> mappings overlap with the
3071 values
4 and
5, and the
<code>building
</code> and
<code>journal
</code> mappings overlap with
3074 <div class=
"listingblock">
3075 <div class=
"content">
3076 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
3077 "fortune": [[
3,
67], [-
45,
1], [
84,
84]],
3078 "building": [[
4,
5], [
75,
82]],
3079 "journal": [[
100,
2305], [
80,
80]]
3088 <h4 id=
"fl-enum-fc">5.4.9. Fixed-length enumeration field class
</h4>
3089 <div class=
"paragraph">
3090 <p>A
<em>fixed-length enumeration
</em> field class is both an
<a href=
"#enum-fc">abstract enumeration
3091 field class
</a> and a
<a href=
"#fl-int-fc">fixed-length integer field class
</a> which describes
<em>fixed-length enumeration
</em> fields.
</p>
3093 <div class=
"paragraph">
3094 <p>A fixed-length enumeration field is a fixed-length integer field which
<em>MAY
</em> have one or more
3095 associated names thanks to the
<code>mappings
</code> property of its class.
</p>
3097 <div class=
"paragraph">
3098 <p>If the value of the
<code>type
</code> property of a fixed-length enumeration field class is
3099 <code>"fixed-length-signed-enumeration"</code>, then its instances have the two
’s
3100 complement format.
</p>
3102 <table class=
"tableblock frame-all grid-all fit-content">
3103 <caption class=
"title">Table
9. Properties of a fixed-length enumeration field class
<em><strong>F
</strong></em>.
</caption>
3113 <th class=
"tableblock halign-left valign-top">Name
</th>
3114 <th class=
"tableblock halign-left valign-top">Type
</th>
3115 <th class=
"tableblock halign-left valign-top">Description
</th>
3116 <th class=
"tableblock halign-left valign-top">Required?
</th>
3117 <th class=
"tableblock halign-left valign-top">Default
</th>
3122 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
3123 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
3124 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3125 <p>Type of
 <em><strong>F
</strong></em>.
</p>
3127 <div class=
"paragraph">
3128 <p>The value of this property
<em>MUST
</em> be one of:
</p>
3132 <dt class=
"hdlist1"><code>"fixed-length-unsigned-enumeration"</code></dt>
3134 <p>The instances of
 <em><strong>F
</strong></em> are fixed-length unsigned enumeration fields.
</p>
3136 <dt class=
"hdlist1"><code>"fixed-length-signed-enumeration"</code></dt>
3138 <p>The instances of
 <em><strong>F
</strong></em> are fixed-length signed enumeration fields.
</p>
3142 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
3143 <td class=
"tableblock halign-left valign-top"></td>
3146 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>length
</code></p></td>
3147 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
3148 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3149 <p>Number of bits of an instance of
 <em><strong>F
</strong></em>.
</p>
3151 <div class=
"paragraph">
3152 <p>The value of this property
<em>MUST
</em> be greater than zero.
</p>
3154 <div class=
"paragraph">
3155 <p>Property inherited from the
<a href=
"#fl-ba-fc">fixed-length bit array field class
</a>.
</p>
3157 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
3158 <td class=
"tableblock halign-left valign-top"></td>
3161 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>byte-order
</code></p></td>
3162 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
3163 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3164 <p><a href=
"https://en.wikipedia.org/wiki/Endianness">Byte order
</a> of an instance
3165 of
 <em><strong>F
</strong></em>.
</p>
3167 <div class=
"paragraph">
3168 <p>The value of this property
<em>MUST
</em> be one of:
</p>
3172 <dt class=
"hdlist1"><code>"big-endian"</code></dt>
3176 <dt class=
"hdlist1"><code>"little-endian"</code></dt>
3178 <p>Little-endian.
</p>
3182 <div class=
"paragraph">
3183 <p>Property inherited from the
<a href=
"#fl-ba-fc">fixed-length bit array field class
</a>.
</p>
3185 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
3186 <td class=
"tableblock halign-left valign-top"></td>
3189 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>alignment
</code></p></td>
3190 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
3191 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3192 <p>Alignment of the first bit of an instance of
 <em><strong>F
</strong></em>
3193 relative to the beginning of the
<a href=
"#pkt">packet
</a> which
3194 contains this instance.
</p>
3196 <div class=
"paragraph">
3197 <p>The value of this property
<em>MUST
</em> be a positive power of two.
</p>
3199 <div class=
"paragraph">
3200 <p>Property inherited from the
<a href=
"#fl-ba-fc">fixed-length bit array field class
</a>.
</p>
3202 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
3203 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>1</code></p></td>
3206 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>preferred-display-base
</code></p></td>
3207 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
3208 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3209 <p>Preferred base to display the value of an instance of
 <em><strong>F
</strong></em>.
</p>
3211 <div class=
"paragraph">
3212 <p>The value of this property
<em>MUST
</em> be one of:
</p>
3214 <div class=
"hdlist">
3217 <td class=
"hdlist1">
3220 <td class=
"hdlist2">
3225 <td class=
"hdlist1">
3228 <td class=
"hdlist2">
3233 <td class=
"hdlist1">
3236 <td class=
"hdlist2">
3237 <p>Decimal base.
</p>
3241 <td class=
"hdlist1">
3244 <td class=
"hdlist2">
3245 <p>Hexadecimal base.
</p>
3250 <div class=
"paragraph">
3251 <p>This property exists to remain backward compatible with
<a href=
"https://diamon.org/ctf/v1.8.3/">CTF
 1</a>:
3252 it
’s not strictly needed to decode an instance of
 <em><strong>F
</strong></em>.
</p>
3254 <div class=
"paragraph">
3255 <p>Property inherited from the
<a href=
"#int-fc">abstract integer field class
</a>.
</p>
3257 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
3258 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>10</code></p></td>
3261 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>mappings
</code></p></td>
3262 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#enum-fc-mappings">Enumeration field class mappings
</a></p></td>
3263 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3264 <p>Mappings of
 <em><strong>F
</strong></em>.
</p>
3266 <div class=
"paragraph">
3267 <p>The value of this property
<em>MUST
</em> contain one or more properties.
</p>
3269 <div class=
"paragraph">
3270 <p>Property inherited from the
<a href=
"#enum-fc">abstract enumeration field class
</a>.
</p>
3272 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
3273 <td class=
"tableblock halign-left valign-top"></td>
3276 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>roles
</code></p></td>
3277 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#roles">Roles
</a></p></td>
3278 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3279 <p>Roles of an instance of
 <em><strong>F
</strong></em>.
</p>
3281 <div class=
"paragraph">
3282 <p>See
<a href=
"#tc-frag">Trace class fragment
</a> and
<a href=
"#dsc-frag">Data stream class fragment
</a> which indicate accepted within their
3283 root field classes.
</p>
3285 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
3286 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>[]
</code></p></td>
3289 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
3290 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
3291 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3292 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
3294 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
3295 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
3298 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
3299 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
3300 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3301 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
3303 <div class=
"paragraph">
3304 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
3305 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
3307 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
3308 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
3312 <div class=
"exampleblock">
3313 <div class=
"title">Example
21. Minimal fixed-length unsigned enumeration field class.
</div>
3314 <div class=
"content">
3315 <div class=
"listingblock">
3316 <div class=
"content">
3317 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
3318 "type":
"fixed-length-unsigned-enumeration",
3320 "byte-order":
"little-endian",
3329 <div class=
"exampleblock">
3330 <div class=
"title">Example
22. Fixed-length signed enumeration field class with instances aligned to
32 bits.
</div>
3331 <div class=
"content">
3332 <div class=
"listingblock">
3333 <div class=
"content">
3334 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
3335 "type":
"fixed-length-signed-enumeration",
3337 "byte-order":
"big-endian",
3340 "banana": [[-
27399, -
1882], [
8,
199], [
101,
101]],
3341 "orange": [[
67,
67], [
43,
1534]]
3348 <div class=
"exampleblock">
3349 <div class=
"title">Example
23. Fixed-length unsigned enumeration field class with instances to be preferably displayed with a hexadecimal base.
</div>
3350 <div class=
"content">
3351 <div class=
"listingblock">
3352 <div class=
"content">
3353 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
3354 "type":
"fixed-length-unsigned-enumeration",
3356 "byte-order":
"big-endian",
3357 "preferred-display-base":
16,
3361 "blueberry": [[
11,
11]]
3368 <div class=
"exampleblock">
3369 <div class=
"title">Example
24. Fixed-length signed enumeration field class with
<a href=
"#user-attrs">user attributes
</a>.
</div>
3370 <div class=
"content">
3371 <div class=
"listingblock">
3372 <div class=
"content">
3373 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
3374 "type":
"fixed-length-signed-enumeration",
3376 "byte-order":
"little-endian",
3380 "user-attributes": {
3392 <h4 id=
"fl-fp-fc">5.4.10. Fixed-length floating point number field class
</h4>
3393 <div class=
"paragraph">
3394 <p>A
<em>fixed-length floating point number
</em> field class is a
<a href=
"#fl-ba-fc">fixed-length bit array field class
</a> which describes
<em>fixed-length floating point number
</em>
3397 <div class=
"paragraph">
3398 <p>A fixed-length floating point number field is a fixed-length bit array field which has floating point number
3401 <table class=
"tableblock frame-all grid-all fit-content">
3402 <caption class=
"title">Table
10. Properties of a fixed-length floating point number field class
<em><strong>F
</strong></em>.
</caption>
3412 <th class=
"tableblock halign-left valign-top">Name
</th>
3413 <th class=
"tableblock halign-left valign-top">Type
</th>
3414 <th class=
"tableblock halign-left valign-top">Description
</th>
3415 <th class=
"tableblock halign-left valign-top">Required?
</th>
3416 <th class=
"tableblock halign-left valign-top">Default
</th>
3421 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
3422 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
3423 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3424 <p>Type of
 <em><strong>F
</strong></em>.
</p>
3426 <div class=
"paragraph">
3427 <p>The value of this property
<em>MUST
</em> be
3428 <code>"fixed-length-floating-point-number"</code>.
</p>
3430 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
3431 <td class=
"tableblock halign-left valign-top"></td>
3434 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>length
</code></p></td>
3435 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
3436 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3437 <p>Number of bits of an instance of
 <em><strong>F
</strong></em>.
</p>
3439 <div class=
"paragraph">
3440 <p>The value of this property
<em>MUST
</em> be one of:
</p>
3444 <dt class=
"hdlist1"><code>16</code></dt>
3446 <p>The instances of
 <em><strong>F
</strong></em> are binary16 floating point numbers,
3447 as per the
<a href=
"https://standards.ieee.org/standard/754-2008.html">IEEE
754-
2008</a> binary interchange format.
</p>
3449 <dt class=
"hdlist1"><code>32</code></dt>
3451 <p>The instances of
 <em><strong>F
</strong></em> are binary32 floating point numbers.
</p>
3453 <dt class=
"hdlist1"><code>64</code></dt>
3455 <p>The instances of
 <em><strong>F
</strong></em> are binary64 floating point numbers.
</p>
3457 <dt class=
"hdlist1"><code>128</code></dt>
3459 <p>The instances of
 <em><strong>F
</strong></em> are binary128 floating point
3462 <dt class=
"hdlist1"><em><strong>K
</strong></em>, where
<em><strong>K
</strong></em> is greater than
 128 and a multiple of
 32</dt>
3464 <p>The instances of
 <em><strong>F
</strong></em> are binary
<em><strong>K
</strong></em> floating point
3469 <div class=
"paragraph">
3470 <p>Property inherited from the
<a href=
"#fl-ba-fc">fixed-length bit array field class
</a>.
</p>
3472 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
3473 <td class=
"tableblock halign-left valign-top"></td>
3476 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>byte-order
</code></p></td>
3477 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
3478 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3479 <p><a href=
"https://en.wikipedia.org/wiki/Endianness">Byte order
</a> of an instance
3480 of
 <em><strong>F
</strong></em>.
</p>
3482 <div class=
"paragraph">
3483 <p>The value of this property
<em>MUST
</em> be one of:
</p>
3487 <dt class=
"hdlist1"><code>"big-endian"</code></dt>
3491 <dt class=
"hdlist1"><code>"little-endian"</code></dt>
3493 <p>Little-endian.
</p>
3497 <div class=
"paragraph">
3498 <p>Property inherited from the
<a href=
"#fl-ba-fc">fixed-length bit array field class
</a>.
</p>
3500 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
3501 <td class=
"tableblock halign-left valign-top"></td>
3504 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>alignment
</code></p></td>
3505 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
3506 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3507 <p>Alignment of the first bit of an instance of
 <em><strong>F
</strong></em>
3508 relative to the beginning of the
<a href=
"#pkt">packet
</a> which
3509 contains this instance.
</p>
3511 <div class=
"paragraph">
3512 <p>The value of this property
<em>MUST
</em> be a positive power of two.
</p>
3514 <div class=
"paragraph">
3515 <p>Property inherited from the
<a href=
"#fl-ba-fc">fixed-length bit array field class
</a>.
</p>
3517 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
3518 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>1</code></p></td>
3521 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>roles
</code></p></td>
3522 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#roles">Roles
</a></p></td>
3523 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3524 <p>Roles of an instance of
 <em><strong>F
</strong></em>.
</p>
3526 <div class=
"paragraph">
3527 <p>See
<a href=
"#tc-frag">Trace class fragment
</a> and
<a href=
"#dsc-frag">Data stream class fragment
</a> which indicate accepted within their
3528 root field classes.
</p>
3530 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
3531 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>[]
</code></p></td>
3534 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
3535 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
3536 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3537 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
3539 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
3540 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
3543 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
3544 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
3545 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3546 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
3548 <div class=
"paragraph">
3549 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
3550 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
3552 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
3553 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
3557 <div class=
"exampleblock">
3558 <div class=
"title">Example
25. Minimal binary32 fixed-length floating point number field class.
</div>
3559 <div class=
"content">
3560 <div class=
"listingblock">
3561 <div class=
"content">
3562 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
3563 "type":
"fixed-length-floating-point-number",
3565 "byte-order":
"little-endian"
3571 <div class=
"exampleblock">
3572 <div class=
"title">Example
26. binary64 fixed-length floating point number field class with instances aligned to
32 bits.
</div>
3573 <div class=
"content">
3574 <div class=
"listingblock">
3575 <div class=
"content">
3576 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
3577 "type":
"fixed-length-floating-point-number",
3579 "byte-order":
"big-endian",
3586 <div class=
"exampleblock">
3587 <div class=
"title">Example
27. binary192 fixed-length floating point number field class with
<a href=
"#user-attrs">user attributes
</a>.
</div>
3588 <div class=
"content">
3589 <div class=
"listingblock">
3590 <div class=
"content">
3591 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
3592 "type":
"fixed-length-floating-point-number",
3594 "byte-order":
"little-endian",
3595 "user-attributes": {
3607 <h4 id=
"vl-ba-fc">5.4.11. Variable-length bit array field class
</h4>
3608 <div class=
"paragraph">
3609 <p>A
<em>variable-length bit array
</em> field class describes
<em>variable-length bit array
</em> fields.
</p>
3611 <div class=
"paragraph">
3612 <p>A variable-length bit array field is a
<a href=
"#seq-def">sequence
</a> of bytes with a variable
3613 length which contains an array of bits of which the length is a multiple
3614 of
 7. A variable-length bit array field is encoded as per
3615 <a href=
"https://en.wikipedia.org/wiki/LEB128">LEB128
</a>.
</p>
3617 <div class=
"paragraph">
3618 <p>A variable-length bit array field class acts as a base of a
<a href=
"#vl-int-fc">variable-length integer field class
</a>.
</p>
3620 <table class=
"tableblock frame-all grid-all fit-content">
3621 <caption class=
"title">Table
11. Common properties of a variable-length bit array field class
<em><strong>F
</strong></em>.
</caption>
3631 <th class=
"tableblock halign-left valign-top">Name
</th>
3632 <th class=
"tableblock halign-left valign-top">Type
</th>
3633 <th class=
"tableblock halign-left valign-top">Description
</th>
3634 <th class=
"tableblock halign-left valign-top">Required?
</th>
3635 <th class=
"tableblock halign-left valign-top">Default
</th>
3640 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
3641 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
3642 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3643 <p>Type of
 <em><strong>F
</strong></em>.
</p>
3645 <div class=
"paragraph">
3646 <p>The value of this property
<em>MUST
</em> be
<code>"variable-length-bit-array"</code>.
</p>
3648 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
3649 <td class=
"tableblock halign-left valign-top"></td>
3652 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>roles
</code></p></td>
3653 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#roles">Roles
</a></p></td>
3654 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3655 <p>Roles of an instance of
 <em><strong>F
</strong></em>.
</p>
3657 <div class=
"paragraph">
3658 <p>See
<a href=
"#tc-frag">Trace class fragment
</a> and
<a href=
"#dsc-frag">Data stream class fragment
</a> which indicate accepted within their
3659 root field classes.
</p>
3661 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
3662 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>[]
</code></p></td>
3665 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
3666 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
3667 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3668 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
3670 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
3671 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
3674 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
3675 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
3676 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3677 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
3679 <div class=
"paragraph">
3680 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
3681 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
3683 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
3684 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
3688 <div class=
"exampleblock">
3689 <div class=
"title">Example
28. Minimal variable-length bit array field class.
</div>
3690 <div class=
"content">
3691 <div class=
"listingblock">
3692 <div class=
"content">
3693 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
3694 "type":
"variable-length-bit-array"
3700 <div class=
"exampleblock">
3701 <div class=
"title">Example
29. Variable-length bit array field class with
<a href=
"#user-attrs">user attributes
</a>.
</div>
3702 <div class=
"content">
3703 <div class=
"listingblock">
3704 <div class=
"content">
3705 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
3706 "type":
"variable-length-bit-array",
3707 "user-attributes": {
3719 <h4 id=
"vl-int-fc">5.4.12. Variable-length integer field class
</h4>
3720 <div class=
"paragraph">
3721 <p>A
<em>variable-length integer
</em> field class is both an
<a href=
"#int-fc">abstract integer field
3722 class
</a> and a
<a href=
"#vl-ba-fc">variable-length bit array field class
</a> which describes
<em>variable-length integer
</em> fields.
</p>
3724 <div class=
"paragraph">
3725 <p>A variable-length integer field is a variable-length bit array field which has integer semantics.
</p>
3727 <div class=
"paragraph">
3728 <p>If the value of the
<code>type
</code> property of a variable-length integer field class is
3729 <code>"variable-length-signed-integer"</code>, then its instances have the two
’s
3730 complement format.
</p>
3732 <div class=
"paragraph">
3733 <p>A variable-length integer field class acts as a base of a
<a href=
"#vl-enum-fc">variable-length enumeration field class
</a>.
</p>
3735 <table class=
"tableblock frame-all grid-all fit-content">
3736 <caption class=
"title">Table
12. Common properties of a variable-length integer field class
<em><strong>F
</strong></em>.
</caption>
3746 <th class=
"tableblock halign-left valign-top">Name
</th>
3747 <th class=
"tableblock halign-left valign-top">Type
</th>
3748 <th class=
"tableblock halign-left valign-top">Description
</th>
3749 <th class=
"tableblock halign-left valign-top">Required?
</th>
3750 <th class=
"tableblock halign-left valign-top">Default
</th>
3755 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
3756 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
3757 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3758 <p>Type of
 <em><strong>F
</strong></em>.
</p>
3760 <div class=
"paragraph">
3761 <p>The value of this property
<em>MUST
</em> be one of:
</p>
3765 <dt class=
"hdlist1"><code>"variable-length-unsigned-integer"</code></dt>
3767 <p>The instances of
 <em><strong>F
</strong></em> are variable-length unsigned integer fields.
</p>
3769 <dt class=
"hdlist1"><code>"variable-length-signed-integer"</code></dt>
3771 <p>The instances of
 <em><strong>F
</strong></em> are variable-length signed integer fields.
</p>
3775 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
3776 <td class=
"tableblock halign-left valign-top"></td>
3779 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>preferred-display-base
</code></p></td>
3780 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
3781 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3782 <p>Preferred base to display the value of an instance of
 <em><strong>F
</strong></em>.
</p>
3784 <div class=
"paragraph">
3785 <p>The value of this property
<em>MUST
</em> be one of:
</p>
3787 <div class=
"hdlist">
3790 <td class=
"hdlist1">
3793 <td class=
"hdlist2">
3798 <td class=
"hdlist1">
3801 <td class=
"hdlist2">
3806 <td class=
"hdlist1">
3809 <td class=
"hdlist2">
3810 <p>Decimal base.
</p>
3814 <td class=
"hdlist1">
3817 <td class=
"hdlist2">
3818 <p>Hexadecimal base.
</p>
3823 <div class=
"paragraph">
3824 <p>This property exists to remain backward compatible with
<a href=
"https://diamon.org/ctf/v1.8.3/">CTF
 1</a>:
3825 it
’s not strictly needed to decode an instance of
 <em><strong>F
</strong></em>.
</p>
3827 <div class=
"paragraph">
3828 <p>Property inherited from the
<a href=
"#int-fc">abstract integer field class
</a>.
</p>
3830 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
3831 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>10</code></p></td>
3834 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>roles
</code></p></td>
3835 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#roles">Roles
</a></p></td>
3836 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3837 <p>Roles of an instance of
 <em><strong>F
</strong></em>.
</p>
3839 <div class=
"paragraph">
3840 <p>See
<a href=
"#tc-frag">Trace class fragment
</a> and
<a href=
"#dsc-frag">Data stream class fragment
</a> which indicate accepted within their
3841 root field classes.
</p>
3843 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
3844 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>[]
</code></p></td>
3847 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
3848 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
3849 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3850 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
3852 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
3853 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
3856 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
3857 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
3858 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3859 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
3861 <div class=
"paragraph">
3862 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
3863 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
3865 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
3866 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
3870 <div class=
"exampleblock">
3871 <div class=
"title">Example
30. Minimal variable-length unsigned integer field class.
</div>
3872 <div class=
"content">
3873 <div class=
"listingblock">
3874 <div class=
"content">
3875 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
3876 "type":
"variable-length-unsigned-integer"
3882 <div class=
"exampleblock">
3883 <div class=
"title">Example
31. Variable-length signed integer field class with instances to be preferably displayed with a hexadecimal base.
</div>
3884 <div class=
"content">
3885 <div class=
"listingblock">
3886 <div class=
"content">
3887 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
3888 "type":
"variable-length-signed-integer",
3889 "preferred-display-base":
16
3895 <div class=
"exampleblock">
3896 <div class=
"title">Example
32. Variable-length unsigned integer field class with
<a href=
"#user-attrs">user attributes
</a>.
</div>
3897 <div class=
"content">
3898 <div class=
"listingblock">
3899 <div class=
"content">
3900 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
3901 "type":
"variable-length-unsigned-integer",
3902 "user-attributes": {
3914 <h4 id=
"vl-enum-fc">5.4.13. Variable-length enumeration field class
</h4>
3915 <div class=
"paragraph">
3916 <p>A
<em>variable-length enumeration
</em> field class is both an
<a href=
"#enum-fc">abstract enumeration
3917 field class
</a> and a
<a href=
"#vl-int-fc">variable-length integer field class
</a> which describes
<em>variable-length enumeration
</em> fields.
</p>
3919 <div class=
"paragraph">
3920 <p>A variable-length enumeration field is a variable-length integer field which
<em>MAY
</em> have one or more
3921 associated names thanks to the
<code>mappings
</code> property of its class.
</p>
3923 <div class=
"paragraph">
3924 <p>If the value of the
<code>type
</code> property of a variable-length enumeration field class is
3925 <code>"variable-length-signed-enumeration"</code>, then its instances have the
3926 two
’s complement format.
</p>
3928 <table class=
"tableblock frame-all grid-all fit-content">
3929 <caption class=
"title">Table
13. Properties of a variable-length enumeration field class
<em><strong>F
</strong></em>.
</caption>
3939 <th class=
"tableblock halign-left valign-top">Name
</th>
3940 <th class=
"tableblock halign-left valign-top">Type
</th>
3941 <th class=
"tableblock halign-left valign-top">Description
</th>
3942 <th class=
"tableblock halign-left valign-top">Required?
</th>
3943 <th class=
"tableblock halign-left valign-top">Default
</th>
3948 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
3949 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
3950 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3951 <p>Type of
 <em><strong>F
</strong></em>.
</p>
3953 <div class=
"paragraph">
3954 <p>The value of this property
<em>MUST
</em> be one of:
</p>
3958 <dt class=
"hdlist1"><code>"variable-length-unsigned-enumeration"</code></dt>
3960 <p>The instances of
 <em><strong>F
</strong></em> are variable-length unsigned enumeration fields.
</p>
3962 <dt class=
"hdlist1"><code>"variable-length-signed-enumeration"</code></dt>
3964 <p>The instances of
 <em><strong>F
</strong></em> are variable-length signed enumeration fields.
</p>
3968 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
3969 <td class=
"tableblock halign-left valign-top"></td>
3972 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>preferred-display-base
</code></p></td>
3973 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
3974 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
3975 <p>Preferred base to display the value of an instance of
 <em><strong>F
</strong></em>.
</p>
3977 <div class=
"paragraph">
3978 <p>The value of this property
<em>MUST
</em> be one of:
</p>
3980 <div class=
"hdlist">
3983 <td class=
"hdlist1">
3986 <td class=
"hdlist2">
3991 <td class=
"hdlist1">
3994 <td class=
"hdlist2">
3999 <td class=
"hdlist1">
4002 <td class=
"hdlist2">
4003 <p>Decimal base.
</p>
4007 <td class=
"hdlist1">
4010 <td class=
"hdlist2">
4011 <p>Hexadecimal base.
</p>
4016 <div class=
"paragraph">
4017 <p>This property exists to remain backward compatible with
<a href=
"https://diamon.org/ctf/v1.8.3/">CTF
 1</a>:
4018 it
’s not strictly needed to decode an instance of
 <em><strong>F
</strong></em>.
</p>
4020 <div class=
"paragraph">
4021 <p>Property inherited from the
<a href=
"#int-fc">abstract integer field class
</a>.
</p>
4023 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4024 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>10</code></p></td>
4027 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>mappings
</code></p></td>
4028 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#enum-fc-mappings">Enumeration field class mappings
</a></p></td>
4029 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4030 <p>Mappings of
 <em><strong>F
</strong></em>.
</p>
4032 <div class=
"paragraph">
4033 <p>The value of this property
<em>MUST
</em> contain one or more properties.
</p>
4035 <div class=
"paragraph">
4036 <p>Property inherited from the
<a href=
"#enum-fc">abstract enumeration field class
</a>.
</p>
4038 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
4039 <td class=
"tableblock halign-left valign-top"></td>
4042 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>roles
</code></p></td>
4043 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#roles">Roles
</a></p></td>
4044 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4045 <p>Roles of an instance of
 <em><strong>F
</strong></em>.
</p>
4047 <div class=
"paragraph">
4048 <p>See
<a href=
"#tc-frag">Trace class fragment
</a> and
<a href=
"#dsc-frag">Data stream class fragment
</a> which indicate accepted within their
4049 root field classes.
</p>
4051 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4052 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>[]
</code></p></td>
4055 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
4056 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
4057 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4058 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
4060 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4061 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
4064 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
4065 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
4066 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4067 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
4069 <div class=
"paragraph">
4070 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
4071 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
4073 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4074 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
4078 <div class=
"exampleblock">
4079 <div class=
"title">Example
33. Minimal variable-length unsigned enumeration field class.
</div>
4080 <div class=
"content">
4081 <div class=
"listingblock">
4082 <div class=
"content">
4083 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
4084 "type":
"variable-length-unsigned-enumeration",
4093 <div class=
"exampleblock">
4094 <div class=
"title">Example
34. Variable-length unsigned enumeration field class with instances to be preferably displayed with a hexadecimal base.
</div>
4095 <div class=
"content">
4096 <div class=
"listingblock">
4097 <div class=
"content">
4098 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
4099 "type":
"variable-length-unsigned-enumeration",
4100 "preferred-display-base":
16,
4104 "blueberry": [[
11,
11]]
4111 <div class=
"exampleblock">
4112 <div class=
"title">Example
35. Variable-length signed enumeration field class with
<a href=
"#user-attrs">user attributes
</a>.
</div>
4113 <div class=
"content">
4114 <div class=
"listingblock">
4115 <div class=
"content">
4116 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
4117 "type":
"variable-length-signed-enumeration",
4119 "banana": [[-
27399, -
1882], [
8,
199], [
101,
101]],
4120 "orange": [[
67,
67], [
43,
1534]]
4122 "user-attributes": {
4134 <h4 id=
"str-fc">5.4.14. Null-terminated string field class
</h4>
4135 <div class=
"paragraph">
4136 <p>A
<em>null-terminated string
</em> field class describes
<em>null-terminated string
</em> fields.
</p>
4138 <div class=
"paragraph">
4139 <p>A null-terminated string field is, in this order:
</p>
4141 <div class=
"olist arabic">
4144 <p>Zero or more contiguous non-null (non-zero) bytes which form a
4145 UTF-
8-encoded string.
</p>
4148 <p>One null (zero) byte.
</p>
4152 <table class=
"tableblock frame-all grid-all fit-content">
4153 <caption class=
"title">Table
14. Properties of a null-terminated string field class
<em><strong>F
</strong></em>.
</caption>
4163 <th class=
"tableblock halign-left valign-top">Name
</th>
4164 <th class=
"tableblock halign-left valign-top">Type
</th>
4165 <th class=
"tableblock halign-left valign-top">Description
</th>
4166 <th class=
"tableblock halign-left valign-top">Required?
</th>
4167 <th class=
"tableblock halign-left valign-top">Default
</th>
4172 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
4173 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
4174 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4175 <p>Type of
 <em><strong>F
</strong></em>.
</p>
4177 <div class=
"paragraph">
4178 <p>The value of this property
<em>MUST
</em> be
<code>"null-terminated-string"</code>.
</p>
4180 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
4181 <td class=
"tableblock halign-left valign-top"></td>
4184 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>roles
</code></p></td>
4185 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#roles">Roles
</a></p></td>
4186 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4187 <p>Roles of an instance of
 <em><strong>F
</strong></em>.
</p>
4189 <div class=
"paragraph">
4190 <p>See
<a href=
"#tc-frag">Trace class fragment
</a> and
<a href=
"#dsc-frag">Data stream class fragment
</a> which indicate accepted within their
4191 root field classes.
</p>
4193 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4194 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>[]
</code></p></td>
4197 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
4198 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
4199 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4200 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
4202 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4203 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
4206 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
4207 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
4208 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4209 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
4211 <div class=
"paragraph">
4212 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
4213 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
4215 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4216 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
4220 <div class=
"exampleblock">
4221 <div class=
"title">Example
36. Minimal null-terminated string field class.
</div>
4222 <div class=
"content">
4223 <div class=
"listingblock">
4224 <div class=
"content">
4225 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
4226 "type":
"null-terminated-string"
4232 <div class=
"exampleblock">
4233 <div class=
"title">Example
37. Null-terminated string field class with
<a href=
"#user-attrs">user attributes
</a>.
</div>
4234 <div class=
"content">
4235 <div class=
"listingblock">
4236 <div class=
"content">
4237 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
4238 "type":
"null-terminated-string",
4239 "user-attributes": {
4251 <h4 id=
"sl-str-fc">5.4.15. Static-length string field class
</h4>
4252 <div class=
"paragraph">
4253 <p>A
<em>static-length string
</em> field class describes
<em>static-length string
</em> fields.
</p>
4255 <div class=
"paragraph">
4256 <p>A static-length string field is a
<a href=
"#seq-def">sequence
</a> of zero or more contiguous
4257 bytes. All the bytes of a static-length string before the first null (zero) byte, if
4258 any, form a UTF-
8-encoded string. All the bytes after the first null
4259 (zero) byte, if any, are padding (garbage data).
</p>
4261 <div class=
"paragraph">
4262 <p>The length, or number of bytes, of a static-length string field is a property
4263 (
<code>length
</code>) of its class.
</p>
4265 <table class=
"tableblock frame-all grid-all fit-content">
4266 <caption class=
"title">Table
15. Properties of a static-length string field class
<em><strong>F
</strong></em>.
</caption>
4276 <th class=
"tableblock halign-left valign-top">Name
</th>
4277 <th class=
"tableblock halign-left valign-top">Type
</th>
4278 <th class=
"tableblock halign-left valign-top">Description
</th>
4279 <th class=
"tableblock halign-left valign-top">Required?
</th>
4280 <th class=
"tableblock halign-left valign-top">Default
</th>
4285 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
4286 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
4287 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4288 <p>Type of
 <em><strong>F
</strong></em>.
</p>
4290 <div class=
"paragraph">
4291 <p>The value of this property
<em>MUST
</em> be
<code>"static-length-string"</code>.
</p>
4293 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
4294 <td class=
"tableblock halign-left valign-top"></td>
4297 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>length
</code></p></td>
4298 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
4299 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4300 <p>Number of bytes contained in an instance of
 <em><strong>F
</strong></em>.
</p>
4302 <div class=
"paragraph">
4303 <p>The value of this property
<em>MUST
</em> be greater than or equal to zero.
</p>
4305 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
4306 <td class=
"tableblock halign-left valign-top"></td>
4309 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>roles
</code></p></td>
4310 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#roles">Roles
</a></p></td>
4311 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4312 <p>Roles of an instance of
 <em><strong>F
</strong></em>.
</p>
4314 <div class=
"paragraph">
4315 <p>See
<a href=
"#tc-frag">Trace class fragment
</a> and
<a href=
"#dsc-frag">Data stream class fragment
</a> which indicate accepted within their
4316 root field classes.
</p>
4318 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4319 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>[]
</code></p></td>
4322 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
4323 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
4324 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4325 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
4327 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4328 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
4331 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
4332 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
4333 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4334 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
4336 <div class=
"paragraph">
4337 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
4338 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
4340 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4341 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
4345 <div class=
"exampleblock">
4346 <div class=
"title">Example
38. Empty static-length string field class.
</div>
4347 <div class=
"content">
4348 <div class=
"listingblock">
4349 <div class=
"content">
4350 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
4351 "type":
"static-length-string",
4358 <div class=
"exampleblock">
4359 <div class=
"title">Example
39. Static-length string field class with instances having
100 bytes.
</div>
4360 <div class=
"content">
4361 <div class=
"listingblock">
4362 <div class=
"content">
4363 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
4364 "type":
"static-length-string",
4371 <div class=
"exampleblock">
4372 <div class=
"title">Example
40. Static-length string field class with
<a href=
"#user-attrs">user attributes
</a>.
</div>
4373 <div class=
"content">
4374 <div class=
"listingblock">
4375 <div class=
"content">
4376 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
4377 "type":
"static-length-string",
4379 "user-attributes": {
4389 <h4 id=
"dl-str-fc">5.4.16. Dynamic-length string field class
</h4>
4390 <div class=
"paragraph">
4391 <p>A
<em>dynamic-length string
</em> field class describes
<em>dynamic-length string
</em> fields.
</p>
4393 <div class=
"paragraph">
4394 <p>A dynamic-length string field is a
<a href=
"#seq-def">sequence
</a> of zero or more contiguous
4395 bytes. All the bytes of a dynamic-length string before the first null (zero) byte, if
4396 any, form a UTF-
8-encoded string. All the bytes after the first null
4397 (zero) byte, if any, are padding (garbage data).
</p>
4399 <div class=
"paragraph">
4400 <p>The length, or number of bytes, of a dynamic-length string field is the value of
4401 another, anterior (already encoded/decoded)
<em>length
</em> field. A
4402 <a href=
"#consumer-def">consumer
</a> can locate this length field thanks to the
4403 <code>length-field-location
</code> property of the dynamic-length string field class.
</p>
4405 <table class=
"tableblock frame-all grid-all fit-content">
4406 <caption class=
"title">Table
16. Properties of a dynamic-length string field class
<em><strong>F
</strong></em>.
</caption>
4416 <th class=
"tableblock halign-left valign-top">Name
</th>
4417 <th class=
"tableblock halign-left valign-top">Type
</th>
4418 <th class=
"tableblock halign-left valign-top">Description
</th>
4419 <th class=
"tableblock halign-left valign-top">Required?
</th>
4420 <th class=
"tableblock halign-left valign-top">Default
</th>
4425 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
4426 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
4427 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4428 <p>Type of
 <em><strong>F
</strong></em>.
</p>
4430 <div class=
"paragraph">
4431 <p>The value of this property
<em>MUST
</em> be
<code>"static-length-string"</code>.
</p>
4433 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
4434 <td class=
"tableblock halign-left valign-top"></td>
4437 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>length-field-location
</code></p></td>
4438 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#field-loc">Field location
</a></p></td>
4439 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4440 <p>Location of the field of which the value is the number of bytes
4441 contained in an instance of
 <em><strong>F
</strong></em>.
</p>
4443 <div class=
"paragraph">
4444 <p>The class of the length field
<em>MUST
</em> be one of:
</p>
4449 <p><a href=
"#fl-int-fc">Fixed-length unsigned integer field class
</a></p>
4452 <p><a href=
"#vl-int-fc">Variable-length unsigned integer field class
</a></p>
4456 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
4457 <td class=
"tableblock halign-left valign-top"></td>
4460 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>roles
</code></p></td>
4461 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#roles">Roles
</a></p></td>
4462 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4463 <p>Roles of an instance of
 <em><strong>F
</strong></em>.
</p>
4465 <div class=
"paragraph">
4466 <p>See
<a href=
"#tc-frag">Trace class fragment
</a> and
<a href=
"#dsc-frag">Data stream class fragment
</a> which indicate accepted within their
4467 root field classes.
</p>
4469 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4470 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>[]
</code></p></td>
4473 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
4474 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
4475 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4476 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
4478 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4479 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
4482 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
4483 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
4484 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4485 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
4487 <div class=
"paragraph">
4488 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
4489 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
4491 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4492 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
4496 <div class=
"exampleblock">
4497 <div class=
"title">Example
41. Dynamic-length string field class.
</div>
4498 <div class=
"content">
4499 <div class=
"listingblock">
4500 <div class=
"content">
4501 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
4502 "type":
"dynamic-length-string",
4503 "length-field-location": [
"event-record-payload",
"length"]
4509 <div class=
"exampleblock">
4510 <div class=
"title">Example
42. Dynamic-length string field class with
<a href=
"#user-attrs">user attributes
</a>.
</div>
4511 <div class=
"content">
4512 <div class=
"listingblock">
4513 <div class=
"content">
4514 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
4515 "type":
"dynamic-length-string",
4516 "length-field-location": [
"event-record-common-context",
"name-length"],
4517 "user-attributes": {
4527 <h4 id=
"blob-fc">5.4.17. Abstract BLOB field class
</h4>
4528 <div class=
"paragraph">
4529 <p>An
<em>abstract
<a href=
"https://en.wikipedia.org/wiki/Binary_large_object">BLOB
</a></em>
4530 field class is a base of a
<a href=
"#sl-blob-fc">static-length BLOB field class
</a> and a
<a href=
"#dl-blob-fc">dynamic-length BLOB field class
</a>.
</p>
4532 <div class=
"paragraph">
4533 <p>This field class is abstract in that it only exists to show the relation
4534 between different BLOB field classes in this document: a
<a href=
"#pkt">packet
</a>
4535 cannot contain an abstract BLOB field.
</p>
4537 <table class=
"tableblock frame-all grid-all fit-content">
4538 <caption class=
"title">Table
17. Common properties of a BLOB field class
<em><strong>F
</strong></em>.
</caption>
4548 <th class=
"tableblock halign-left valign-top">Name
</th>
4549 <th class=
"tableblock halign-left valign-top">Type
</th>
4550 <th class=
"tableblock halign-left valign-top">Description
</th>
4551 <th class=
"tableblock halign-left valign-top">Required?
</th>
4552 <th class=
"tableblock halign-left valign-top">Default
</th>
4557 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>media-type
</code></p></td>
4558 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
4559 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4560 <p><a href=
"https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types">IANA
4561 media type
</a> of an instance of
 <em><strong>F
</strong></em>.
</p>
4563 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4564 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>"application/octet-stream"</code></p></td>
4570 <h4 id=
"sl-blob-fc">5.4.18. Static-length BLOB field class
</h4>
4571 <div class=
"paragraph">
4572 <p>A
<em>static-length BLOB
</em> field class is an
<a href=
"#blob-fc">abstract BLOB field class
</a>
4573 which describes
<em>static-length BLOB
</em> fields.
</p>
4575 <div class=
"paragraph">
4576 <p>A static-length BLOB field is a
<a href=
"#seq-def">sequence
</a> of zero or more contiguous
4577 bytes with an associated IANA media type (given by the
<code>media-type
</code>
4578 property of its class).
</p>
4580 <div class=
"paragraph">
4581 <p>The length, or number of bytes, of a static-length BLOB field is a property
4582 (
<code>length
</code>) of its class.
</p>
4584 <table class=
"tableblock frame-all grid-all fit-content">
4585 <caption class=
"title">Table
18. Properties of a static-length BLOB field class
<em><strong>F
</strong></em>.
</caption>
4595 <th class=
"tableblock halign-left valign-top">Name
</th>
4596 <th class=
"tableblock halign-left valign-top">Type
</th>
4597 <th class=
"tableblock halign-left valign-top">Description
</th>
4598 <th class=
"tableblock halign-left valign-top">Required?
</th>
4599 <th class=
"tableblock halign-left valign-top">Default
</th>
4604 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
4605 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
4606 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4607 <p>Type of
 <em><strong>F
</strong></em>.
</p>
4609 <div class=
"paragraph">
4610 <p>The value of this property
<em>MUST
</em> be
<code>"static-length-blob"</code>.
</p>
4612 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
4613 <td class=
"tableblock halign-left valign-top"></td>
4616 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>length
</code></p></td>
4617 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
4618 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4619 <p>Number of bytes contained in an instance of
 <em><strong>F
</strong></em>.
</p>
4621 <div class=
"paragraph">
4622 <p>The value of this property
<em>MUST
</em> be greater than or equal to zero.
</p>
4624 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
4625 <td class=
"tableblock halign-left valign-top"></td>
4628 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>media-type
</code></p></td>
4629 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
4630 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4631 <p><a href=
"https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types">IANA
4632 media type
</a> of an instance of
 <em><strong>F
</strong></em>.
</p>
4634 <div class=
"paragraph">
4635 <p>Property inherited from the
<a href=
"#blob-fc">abstract BLOB field class
</a>.
</p>
4637 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4638 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>"application/octet-stream"</code></p></td>
4641 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>roles
</code></p></td>
4642 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#roles">Roles
</a></p></td>
4643 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4644 <p>Roles of an instance of
 <em><strong>F
</strong></em>.
</p>
4646 <div class=
"paragraph">
4647 <p>See
<a href=
"#tc-frag">Trace class fragment
</a> and
<a href=
"#dsc-frag">Data stream class fragment
</a> which indicate accepted within their
4648 root field classes.
</p>
4650 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4651 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>[]
</code></p></td>
4654 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
4655 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
4656 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4657 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
4659 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4660 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
4663 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
4664 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
4665 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4666 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
4668 <div class=
"paragraph">
4669 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
4670 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
4672 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4673 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
4677 <div class=
"exampleblock">
4678 <div class=
"title">Example
43. Empty static-length BLOB field class with instances having a default IANA media type.
</div>
4679 <div class=
"content">
4680 <div class=
"listingblock">
4681 <div class=
"content">
4682 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
4683 "type":
"static-length-blob",
4690 <div class=
"exampleblock">
4691 <div class=
"title">Example
44. Static-length TIFF BLOB field class with instances having
511,
267 bytes.
</div>
4692 <div class=
"content">
4693 <div class=
"listingblock">
4694 <div class=
"content">
4695 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
4696 "type":
"static-length-blob",
4698 "media-type":
"image/tif"
4704 <div class=
"exampleblock">
4705 <div class=
"title">Example
45. Static-length CSV BLOB field class with
<a href=
"#user-attrs">user attributes
</a>.
</div>
4706 <div class=
"content">
4707 <div class=
"listingblock">
4708 <div class=
"content">
4709 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
4710 "type":
"static-length-blob",
4712 "media-type":
"text/csv",
4713 "user-attributes": {
4725 <h4 id=
"dl-blob-fc">5.4.19. Dynamic-length BLOB field class
</h4>
4726 <div class=
"paragraph">
4727 <p>A
<em>dynamic-length BLOB
</em> field class is an
<a href=
"#blob-fc">abstract BLOB field class
</a>
4728 which describes
<em>dynamic-length BLOB
</em> fields.
</p>
4730 <div class=
"paragraph">
4731 <p>A dynamic-length BLOB field is a
<a href=
"#seq-def">sequence
</a> of zero or more contiguous
4732 bytes with an associated IANA media type.
</p>
4734 <div class=
"paragraph">
4735 <p>The length, or number of bytes, of a dynamic-length BLOB field is the value of
4736 another, anterior (already encoded/decoded)
<em>length
</em> field. A
4737 <a href=
"#consumer-def">consumer
</a> can locate this length field thanks to the
4738 <code>length-field-location
</code> property of the dynamic-length BLOB field class.
</p>
4740 <table class=
"tableblock frame-all grid-all fit-content">
4741 <caption class=
"title">Table
19. Properties of a dynamic-length BLOB field class
<em><strong>F
</strong></em>.
</caption>
4751 <th class=
"tableblock halign-left valign-top">Name
</th>
4752 <th class=
"tableblock halign-left valign-top">Type
</th>
4753 <th class=
"tableblock halign-left valign-top">Description
</th>
4754 <th class=
"tableblock halign-left valign-top">Required?
</th>
4755 <th class=
"tableblock halign-left valign-top">Default
</th>
4760 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
4761 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
4762 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4763 <p>Type of
 <em><strong>F
</strong></em>.
</p>
4765 <div class=
"paragraph">
4766 <p>The value of this property
<em>MUST
</em> be
<code>"dynamic-length-blob"</code>.
</p>
4768 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
4769 <td class=
"tableblock halign-left valign-top"></td>
4772 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>length-field-location
</code></p></td>
4773 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#field-loc">Field location
</a></p></td>
4774 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4775 <p>Location of the field of which the value is the number of bytes
4776 contained in an instance of
 <em><strong>F
</strong></em>.
</p>
4778 <div class=
"paragraph">
4779 <p>The class of the length field
<em>MUST
</em> be one of:
</p>
4784 <p><a href=
"#fl-int-fc">Fixed-length unsigned integer field class
</a></p>
4787 <p><a href=
"#vl-int-fc">Variable-length unsigned integer field class
</a></p>
4791 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
4792 <td class=
"tableblock halign-left valign-top"></td>
4795 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>media-type
</code></p></td>
4796 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
4797 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4798 <p><a href=
"https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types">IANA
4799 media type
</a> of an instance of
 <em><strong>F
</strong></em>.
</p>
4801 <div class=
"paragraph">
4802 <p>Property inherited from the
<a href=
"#blob-fc">abstract BLOB field class
</a>.
</p>
4804 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4805 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>"application/octet-stream"</code></p></td>
4808 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>roles
</code></p></td>
4809 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#roles">Roles
</a></p></td>
4810 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4811 <p>Roles of an instance of
 <em><strong>F
</strong></em>.
</p>
4813 <div class=
"paragraph">
4814 <p>See
<a href=
"#tc-frag">Trace class fragment
</a> and
<a href=
"#dsc-frag">Data stream class fragment
</a> which indicate accepted within their
4815 root field classes.
</p>
4817 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4818 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>[]
</code></p></td>
4821 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
4822 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
4823 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4824 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
4826 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4827 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
4830 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
4831 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
4832 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4833 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
4835 <div class=
"paragraph">
4836 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
4837 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
4839 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4840 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
4844 <div class=
"exampleblock">
4845 <div class=
"title">Example
46. Dynamic-length BLOB field class with instances having a default IANA media type.
</div>
4846 <div class=
"content">
4847 <div class=
"listingblock">
4848 <div class=
"content">
4849 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
4850 "type":
"dynamic-length-blob",
4851 "length-field-location": [
"event-record-payload",
"length"]
4857 <div class=
"exampleblock">
4858 <div class=
"title">Example
47. Dynamic-length JPEG BLOB field class with
<a href=
"#user-attrs">user attributes
</a>.
</div>
4859 <div class=
"content">
4860 <div class=
"listingblock">
4861 <div class=
"content">
4862 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
4863 "type":
"dynamic-length-blob",
4864 "length-field-location": [
"event-record-common-context",
"length"],
4865 "media-type":
"image/jpeg",
4866 "user-attributes": {
4878 <h4 id=
"struct-fc">5.4.20. Structure field class
</h4>
4879 <div class=
"paragraph">
4880 <p>A
<em>structure field class
</em> describes
<em>structure fields
</em>.
</p>
4882 <div class=
"paragraph">
4883 <p>A structure field is a
<a href=
"#seq-def">sequence
</a> of zero or more structure
4884 field
<em>members
</em>. A structure field member is a named field.
</p>
4886 <table class=
"tableblock frame-all grid-all fit-content">
4887 <caption class=
"title">Table
20. Properties of a structure field class
<em><strong>F
</strong></em>.
</caption>
4897 <th class=
"tableblock halign-left valign-top">Name
</th>
4898 <th class=
"tableblock halign-left valign-top">Type
</th>
4899 <th class=
"tableblock halign-left valign-top">Description
</th>
4900 <th class=
"tableblock halign-left valign-top">Required?
</th>
4901 <th class=
"tableblock halign-left valign-top">Default
</th>
4906 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
4907 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
4908 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4909 <p>Type of
 <em><strong>F
</strong></em>.
</p>
4911 <div class=
"paragraph">
4912 <p>The value of this property
<em>MUST
</em> be
<code>"structure"</code>.
</p>
4914 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
4915 <td class=
"tableblock halign-left valign-top"></td>
4918 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>member-classes
</code></p></td>
4919 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON array of
<a href=
"#struct-member-cls">structure field member classes
</a></p></td>
4920 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4921 <p>Classes of the members of an instance of
 <em><strong>F
</strong></em>.
</p>
4923 <div class=
"paragraph">
4924 <p>The
<code>name
</code> property of each member class
<em>MUST
</em> be unique within the
4925 member class names of
 <em><strong>F
</strong></em>.
</p>
4927 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4928 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>[]
</code></p></td>
4931 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>minimum-alignment
</code></p></td>
4932 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
4933 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4934 <p>Minimum alignment of the first bit of an instance of
 <em><strong>F
</strong></em>
4935 relative to the beginning of the
<a href=
"#pkt">packet
</a> which contains this
4938 <div class=
"paragraph">
4939 <p>The value of this property
<em>MUST
</em> be a positive power of two.
</p>
4941 <div class=
"paragraph">
4942 <p>The
<a href=
"#align-dec"><em>effective
</em> alignment
</a> of the first bit of an instance
4943 of
 <em><strong>F
</strong></em> <em>MAY
</em> be greater than the value of this property.
</p>
4945 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4946 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>1</code></p></td>
4949 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>roles
</code></p></td>
4950 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#roles">Roles
</a></p></td>
4951 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4952 <p>Roles of an instance of
 <em><strong>F
</strong></em>.
</p>
4954 <div class=
"paragraph">
4955 <p>See
<a href=
"#tc-frag">Trace class fragment
</a> and
<a href=
"#dsc-frag">Data stream class fragment
</a> which indicate accepted within their
4956 root field classes.
</p>
4958 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4959 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>[]
</code></p></td>
4962 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
4963 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
4964 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4965 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
4967 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4968 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
4971 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
4972 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
4973 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
4974 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
4976 <div class=
"paragraph">
4977 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
4978 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
4980 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
4981 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
4985 <div class=
"exampleblock">
4986 <div class=
"title">Example
48. Empty structure field class: instances have no members.
</div>
4987 <div class=
"content">
4988 <div class=
"listingblock">
4989 <div class=
"content">
4990 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
4997 <div class=
"exampleblock">
4998 <div class=
"title">Example
49. Structure field class with three member classes.
</div>
4999 <div class=
"content">
5000 <div class=
"listingblock">
5001 <div class=
"content">
5002 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
5003 "type":
"structure",
5008 "type":
"null-terminated-string"
5014 "type":
"fixed-length-unsigned-integer",
5016 "byte-order":
"little-endian",
5017 "preferred-display-base":
2
5019 "user-attributes": {
5028 "type":
"fixed-length-boolean",
5030 "byte-order":
"little-endian"
5039 <div class=
"exampleblock">
5040 <div class=
"title">Example
50. Structure field class with instances minimally aligned to
64 bits.
</div>
5041 <div class=
"content">
5042 <div class=
"listingblock">
5043 <div class=
"content">
5044 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
5045 "type":
"structure",
5050 "type":
"null-terminated-string"
5054 "name":
"Lajeunesse",
5056 "type":
"fixed-length-unsigned-integer",
5058 "byte-order":
"big-endian",
5063 "minimum-alignment":
64
5069 <div class=
"exampleblock">
5070 <div class=
"title">Example
51. Structure field class with
<a href=
"#user-attrs">user attributes
</a>.
</div>
5071 <div class=
"content">
5072 <div class=
"listingblock">
5073 <div class=
"content">
5074 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
5075 "type":
"structure",
5078 "name":
"Henri-Julien",
5080 "type":
"fixed-length-signed-integer",
5082 "byte-order":
"little-endian"
5088 "type":
"static-length-string",
5093 "user-attributes": {
5104 <h5 id=
"struct-member-cls">5.4.20.1. Structure field member class
</h5>
5105 <div class=
"paragraph">
5106 <p>A
<em>structure field member class
</em> describes
<em>structure field members
</em>.
</p>
5108 <div class=
"paragraph">
5109 <p>A structure field member class is a JSON object.
</p>
5111 <table class=
"tableblock frame-all grid-all fit-content">
5112 <caption class=
"title">Table
21. Properties of a structure field member class
<em><strong>M
</strong></em>.
</caption>
5122 <th class=
"tableblock halign-left valign-top">Name
</th>
5123 <th class=
"tableblock halign-left valign-top">Type
</th>
5124 <th class=
"tableblock halign-left valign-top">Description
</th>
5125 <th class=
"tableblock halign-left valign-top">Required?
</th>
5126 <th class=
"tableblock halign-left valign-top">Default
</th>
5131 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>name
</code></p></td>
5132 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
5133 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5134 <p>Name of
 <em><strong>M
</strong></em>.
</p>
5136 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
5137 <td class=
"tableblock halign-left valign-top"></td>
5140 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>field-class
</code></p></td>
5141 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#fc">Field class
</a></p></td>
5142 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5143 <p>Field class of
 <em><strong>M
</strong></em>.
</p>
5145 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
5146 <td class=
"tableblock halign-left valign-top"></td>
5149 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
5150 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
5151 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5152 <p>User attributes of
 <em><strong>M
</strong></em>.
</p>
5154 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
5155 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
5158 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
5159 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
5160 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5161 <p>Extensions of
 <em><strong>M
</strong></em>.
</p>
5163 <div class=
"paragraph">
5164 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
5165 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
5167 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
5168 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
5172 <div class=
"exampleblock">
5173 <div class=
"title">Example
52.
<a href=
"#str-fc">Null-terminated string field class
</a> member class named
<code>cat
</code>.
</div>
5174 <div class=
"content">
5175 <div class=
"listingblock">
5176 <div class=
"content">
5177 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
5180 "type":
"null-terminated-string"
5187 <div class=
"exampleblock">
5188 <div class=
"title">Example
53.
<a href=
"#vl-int-fc">Variable-length signed integer field class
</a> member class named
<code>dog
</code> with
<a href=
"#user-attrs">user attributes
</a>.
</div>
5189 <div class=
"content">
5190 <div class=
"listingblock">
5191 <div class=
"content">
5192 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
5195 "type":
"variable-length-signed-integer",
5196 "preferred-display-base":
8
5198 "user-attributes": {
5201 243,
97,
0,
184,
236,
54,
72,
97,
5202 141,
107,
169,
214,
171,
137,
115,
201
5215 <h4 id=
"array-fc">5.4.21. Abstract array field class
</h4>
5216 <div class=
"paragraph">
5217 <p>An
<em>abstract array
</em> field class is a base of a
<a href=
"#sl-array-fc">static-length array field class
</a> and a
5218 <a href=
"#dl-array-fc">dynamic-length array field class
</a>.
</p>
5220 <div class=
"paragraph">
5221 <p>This field class is abstract in that it only exists to show the relation
5222 between different array field classes in this document: a
<a href=
"#pkt">packet
</a>
5223 cannot contain an abstract array field.
</p>
5225 <table class=
"tableblock frame-all grid-all fit-content">
5226 <caption class=
"title">Table
22. Common properties of an array field class
<em><strong>F
</strong></em>.
</caption>
5236 <th class=
"tableblock halign-left valign-top">Name
</th>
5237 <th class=
"tableblock halign-left valign-top">Type
</th>
5238 <th class=
"tableblock halign-left valign-top">Description
</th>
5239 <th class=
"tableblock halign-left valign-top">Required?
</th>
5240 <th class=
"tableblock halign-left valign-top">Default
</th>
5245 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>element-field-class
</code></p></td>
5246 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#fc">Field class
</a></p></td>
5247 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5248 <p>Class of the element fields contained in an instance of
 <em><strong>F
</strong></em>.
</p>
5250 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
5251 <td class=
"tableblock halign-left valign-top"></td>
5254 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>minimum-alignment
</code></p></td>
5255 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
5256 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5257 <p>Minimum alignment of the first bit of an instance of
 <em><strong>F
</strong></em>
5258 relative to the beginning of the
<a href=
"#pkt">packet
</a> which contains this
5261 <div class=
"paragraph">
5262 <p>The value of this property
<em>MUST
</em> be a positive power of two.
</p>
5264 <div class=
"paragraph">
5265 <p>The
<a href=
"#align-dec"><em>effective
</em> alignment
</a> of the first bit of an instance
5266 of
 <em><strong>F
</strong></em> <em>MAY
</em> be greater than the value of this property.
</p>
5268 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
5269 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>1</code></p></td>
5275 <h4 id=
"sl-array-fc">5.4.22. Static-length array field class
</h4>
5276 <div class=
"paragraph">
5277 <p>A
<em>static-length array
</em> field class is an
<a href=
"#array-fc">abstract array field class
</a>
5278 which describes
<em>static-length array
</em> fields.
</p>
5280 <div class=
"paragraph">
5281 <p>A static-length array field is a sequence of zero or more element fields.
</p>
5283 <div class=
"paragraph">
5284 <p>The length, or number of element fields, of a static-length array field is a
5285 property (
<code>length
</code>) of its class.
</p>
5287 <table class=
"tableblock frame-all grid-all fit-content">
5288 <caption class=
"title">Table
23. Properties of a static-length array field class
<em><strong>F
</strong></em>.
</caption>
5298 <th class=
"tableblock halign-left valign-top">Name
</th>
5299 <th class=
"tableblock halign-left valign-top">Type
</th>
5300 <th class=
"tableblock halign-left valign-top">Description
</th>
5301 <th class=
"tableblock halign-left valign-top">Required?
</th>
5302 <th class=
"tableblock halign-left valign-top">Default
</th>
5307 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
5308 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
5309 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5310 <p>Type of
 <em><strong>F
</strong></em>.
</p>
5312 <div class=
"paragraph">
5313 <p>The value of this property
<em>MUST
</em> be
<code>"static-length-array"</code>.
</p>
5315 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
5316 <td class=
"tableblock halign-left valign-top"></td>
5319 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>element-field-class
</code></p></td>
5320 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#fc">Field class
</a></p></td>
5321 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5322 <p>Class of the element fields contained in an instance of
 <em><strong>F
</strong></em>.
</p>
5324 <div class=
"paragraph">
5325 <p>Property inherited from the
<a href=
"#array-fc">abstract array field class
</a>.
</p>
5327 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
5328 <td class=
"tableblock halign-left valign-top"></td>
5331 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>minimum-alignment
</code></p></td>
5332 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
5333 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5334 <p>Minimum alignment of the first bit of an instance of
 <em><strong>F
</strong></em>
5335 relative to the beginning of the
<a href=
"#pkt">packet
</a> which contains this
5338 <div class=
"paragraph">
5339 <p>The value of this property
<em>MUST
</em> be a positive power of two.
</p>
5341 <div class=
"paragraph">
5342 <p>The
<a href=
"#align-dec"><em>effective
</em> alignment
</a> of the first bit of an instance
5343 of
 <em><strong>F
</strong></em> <em>MAY
</em> be greater than the value of this property.
</p>
5345 <div class=
"paragraph">
5346 <p>Property inherited from the
<a href=
"#array-fc">abstract array field class
</a>.
</p>
5348 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
5349 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>1</code></p></td>
5352 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>length
</code></p></td>
5353 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
5354 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5355 <p>Number of element fields contained in an instance of
 <em><strong>F
</strong></em>.
</p>
5357 <div class=
"paragraph">
5358 <p>The value of this property
<em>MUST
</em> be greater than or equal to zero.
</p>
5360 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
5361 <td class=
"tableblock halign-left valign-top"></td>
5364 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>roles
</code></p></td>
5365 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#roles">Roles
</a></p></td>
5366 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5367 <p>Roles of an instance of
 <em><strong>F
</strong></em>.
</p>
5369 <div class=
"paragraph">
5370 <p>See
<a href=
"#tc-frag">Trace class fragment
</a> and
<a href=
"#dsc-frag">Data stream class fragment
</a> which indicate accepted within their
5371 root field classes.
</p>
5373 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
5374 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>[]
</code></p></td>
5377 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
5378 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
5379 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5380 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
5382 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
5383 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
5386 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
5387 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
5388 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5389 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
5391 <div class=
"paragraph">
5392 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
5393 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
5395 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
5396 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
5400 <div class=
"exampleblock">
5401 <div class=
"title">Example
54. Empty static-length array field class.
</div>
5402 <div class=
"content">
5403 <div class=
"listingblock">
5404 <div class=
"content">
5405 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
5406 "type":
"static-length-array",
5407 "element-field-class": {
5408 "type":
"fixed-length-signed-integer",
5410 "byte-order":
"little-endian",
5419 <div class=
"exampleblock">
5420 <div class=
"title">Example
55. Static-length array field class with instances having
100 <a href=
"#str-fc">null-terminated string
</a> fields.
</div>
5421 <div class=
"content">
5422 <div class=
"listingblock">
5423 <div class=
"content">
5424 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
5425 "type":
"static-length-array",
5426 "element-field-class": {
5427 "type":
"null-terminated-string"
5435 <div class=
"exampleblock">
5436 <div class=
"title">Example
56. Static-length array field class with
<a href=
"#user-attrs">user attributes
</a>.
</div>
5437 <div class=
"content">
5438 <div class=
"listingblock">
5439 <div class=
"content">
5440 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
5441 "type":
"static-length-array",
5442 "element-field-class": {
5443 "type":
"variable-length-unsigned-integer"
5446 "user-attributes": {
5454 <div class=
"exampleblock">
5455 <div class=
"title">Example
57. Static-length array field class with instances minimally aligned to
32 bits.
</div>
5456 <div class=
"content">
5457 <div class=
"paragraph">
5458 <p>With the following static-length array field class, a
<a href=
"#producer-def">producer
</a>
5459 can write a single
32-bit-aligned,
32-bit little-endian integer value,
5460 and have
<a href=
"#consumer-def">consumers
</a> <a href=
"#sl-array-field-dec">decode
</a> it as
5461 an array of
32 flags (booleans).
</p>
5463 <div class=
"listingblock">
5464 <div class=
"content">
5465 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
5466 "type":
"static-length-array",
5468 "minimum-alignment":
32,
5469 "element-field-class": {
5470 "type":
"fixed-length-boolean",
5472 "byte-order":
"little-endian"
5481 <h4 id=
"dl-array-fc">5.4.23. Dynamic-length array field class
</h4>
5482 <div class=
"paragraph">
5483 <p>A
<em>dynamic-length array
</em> field class is an
<a href=
"#array-fc">abstract array field class
</a>
5484 which describes
<em>dynamic-length array
</em> fields.
</p>
5486 <div class=
"paragraph">
5487 <p>A dynamic-length array field is a sequence of zero or more element fields.
</p>
5489 <div class=
"paragraph">
5490 <p>The length, or number of element fields, of a dynamic-length array field is the
5491 value of another, anterior (already encoded/decoded)
<em>length
</em> field. A
5492 <a href=
"#consumer-def">consumer
</a> can locate this length field thanks to the
5493 <code>length-field-location
</code> property of the dynamic-length array field class.
</p>
5495 <table class=
"tableblock frame-all grid-all fit-content">
5496 <caption class=
"title">Table
24. Properties of a dynamic-length array field class
<em><strong>F
</strong></em>.
</caption>
5506 <th class=
"tableblock halign-left valign-top">Name
</th>
5507 <th class=
"tableblock halign-left valign-top">Type
</th>
5508 <th class=
"tableblock halign-left valign-top">Description
</th>
5509 <th class=
"tableblock halign-left valign-top">Required?
</th>
5510 <th class=
"tableblock halign-left valign-top">Default
</th>
5515 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
5516 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
5517 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5518 <p>Type of
 <em><strong>F
</strong></em>.
</p>
5520 <div class=
"paragraph">
5521 <p>The value of this property
<em>MUST
</em> be
<code>"dynamic-length-array"</code>.
</p>
5523 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
5524 <td class=
"tableblock halign-left valign-top"></td>
5527 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>element-field-class
</code></p></td>
5528 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#fc">Field class
</a></p></td>
5529 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5530 <p>Class of the element fields contained in an instance of
 <em><strong>F
</strong></em>.
</p>
5532 <div class=
"paragraph">
5533 <p>Property inherited from the
<a href=
"#array-fc">abstract array field class
</a>.
</p>
5535 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
5536 <td class=
"tableblock halign-left valign-top"></td>
5539 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>minimum-alignment
</code></p></td>
5540 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
5541 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5542 <p>Minimum alignment of the first bit of an instance of
 <em><strong>F
</strong></em>
5543 relative to the beginning of the
<a href=
"#pkt">packet
</a> which contains this
5546 <div class=
"paragraph">
5547 <p>The value of this property
<em>MUST
</em> be a positive power of two.
</p>
5549 <div class=
"paragraph">
5550 <p>The
<a href=
"#align-dec"><em>effective
</em> alignment
</a> of the first bit of an instance
5551 of
 <em><strong>F
</strong></em> <em>MAY
</em> be greater than the value of this property.
</p>
5553 <div class=
"paragraph">
5554 <p>Property inherited from the
<a href=
"#array-fc">abstract array field class
</a>.
</p>
5556 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
5557 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>1</code></p></td>
5560 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>length-field-location
</code></p></td>
5561 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#field-loc">Field location
</a></p></td>
5562 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5563 <p>Location of the field of which the value is the number of element
5564 fields contained in an instance of
 <em><strong>F
</strong></em>.
</p>
5566 <div class=
"paragraph">
5567 <p>The class of the length field
<em>MUST
</em> be one of:
</p>
5572 <p><a href=
"#fl-int-fc">Fixed-length unsigned integer field class
</a></p>
5575 <p><a href=
"#vl-int-fc">Variable-length unsigned integer field class
</a></p>
5579 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
5580 <td class=
"tableblock halign-left valign-top"></td>
5583 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>roles
</code></p></td>
5584 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#roles">Roles
</a></p></td>
5585 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5586 <p>Roles of an instance of
 <em><strong>F
</strong></em>.
</p>
5588 <div class=
"paragraph">
5589 <p>See
<a href=
"#tc-frag">Trace class fragment
</a> and
<a href=
"#dsc-frag">Data stream class fragment
</a> which indicate accepted within their
5590 root field classes.
</p>
5592 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
5593 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>[]
</code></p></td>
5596 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
5597 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
5598 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5599 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
5601 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
5602 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
5605 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
5606 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
5607 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5608 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
5610 <div class=
"paragraph">
5611 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
5612 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
5614 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
5615 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
5619 <div class=
"exampleblock">
5620 <div class=
"title">Example
58. Dynamic-length array field class.
</div>
5621 <div class=
"content">
5622 <div class=
"listingblock">
5623 <div class=
"content">
5624 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
5625 "type":
"dynamic-length-array",
5626 "element-field-class": {
5627 "type":
"fixed-length-unsigned-integer",
5629 "byte-order":
"big-endian",
5632 "length-field-location": [
"event-record-payload",
"length"]
5638 <div class=
"exampleblock">
5639 <div class=
"title">Example
59. Dynamic-length array field class with
<a href=
"#user-attrs">user attributes
</a>.
</div>
5640 <div class=
"content">
5641 <div class=
"listingblock">
5642 <div class=
"content">
5643 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
5644 "type":
"dynamic-length-array",
5645 "element-field-class": {
5646 "type":
"variable-length-unsigned-integer"
5648 "length-field-location": [
"packet-context",
"common-length"],
5649 "user-attributes": {
5659 <h4 id=
"opt-fc">5.4.24. Optional field class
</h4>
5660 <div class=
"paragraph">
5661 <p>An
<em>optional
</em> field class describes
<em>optional
</em> fields.
</p>
5663 <div class=
"paragraph">
5664 <p>An optional field is, depending on the value of another, anterior
5665 (already encoded/decoded)
<em>selector
</em> field, one of:
</p>
5670 <p>An instance of a given field class (
<code>field-class
</code> property of the
5671 optional field class).
</p>
5672 <div class=
"paragraph">
5673 <p>In this case, the optional field is said to be
<em>enabled
</em>.
</p>
5677 <p>A zero-bit field (no field).
</p>
5678 <div class=
"paragraph">
5679 <p>In this case, the optional field is said to be
<em>disabled
</em>.
</p>
5684 <div class=
"paragraph">
5685 <p>A
<a href=
"#consumer-def">consumer
</a> can locate the selector field thanks to the
5686 <code>selector-field-location
</code> property of the optional field class.
</p>
5688 <table class=
"tableblock frame-all grid-all fit-content">
5689 <caption class=
"title">Table
25. Properties of an optional field class
<em><strong>F
</strong></em>.
</caption>
5699 <th class=
"tableblock halign-left valign-top">Name
</th>
5700 <th class=
"tableblock halign-left valign-top">Type
</th>
5701 <th class=
"tableblock halign-left valign-top">Description
</th>
5702 <th class=
"tableblock halign-left valign-top">Required?
</th>
5703 <th class=
"tableblock halign-left valign-top">Default
</th>
5708 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
5709 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
5710 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5711 <p>Type of
 <em><strong>F
</strong></em>.
</p>
5713 <div class=
"paragraph">
5714 <p>The value of this property
<em>MUST
</em> be
<code>"optional"</code>.
</p>
5716 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
5717 <td class=
"tableblock halign-left valign-top"></td>
5720 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>field-class
</code></p></td>
5721 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#fc">Field class
</a></p></td>
5722 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5723 <p>Class of an instance of
 <em><strong>F
</strong></em> when it
’s enabled.
</p>
5725 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
5726 <td class=
"tableblock halign-left valign-top"></td>
5729 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>selector-field-location
</code></p></td>
5730 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#field-loc">Field location
</a></p></td>
5731 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5732 <p>Location of the field of which the value indicates whether or not an
5733 instance of
 <em><strong>F
</strong></em> is enabled.
</p>
5735 <div class=
"paragraph">
5736 <p>A selector field
 <em><strong>S
</strong></em> <em>MUST
</em> be an instance of one of:
</p>
5740 <dt class=
"hdlist1"><a href=
"#fl-bool-fc">Fixed-length boolean field class
</a></dt>
5742 <p>An instance of
 <em><strong>F
</strong></em> is enabled when
 <em><strong>S
</strong></em> is
5745 <dt class=
"hdlist1"><a href=
"#fl-int-fc">Fixed-length integer field class
</a></dt>
5746 <dt class=
"hdlist1"><a href=
"#vl-int-fc">Variable-length integer field class
</a></dt>
5748 <p>An instance of
 <em><strong>F
</strong></em> is enabled when the value
5749 of
 <em><strong>S
</strong></em> is an element of any of the integer ranges of the
5750 <code>selector-field-ranges
</code> property of
 <em><strong>F
</strong></em>.
</p>
5754 <div class=
"paragraph">
5755 <p>For a given instance of
 <em><strong>F
</strong></em>, the
<code>type
</code> property of the
5756 <a href=
"#fc">classes
</a> of
<em>all
</em> the possible selector fields
<em>MUST
</em> be
5762 <p><a href=
"#fl-bool-fc"><code>"fixed-length-boolean"</code></a></p>
5769 <p><a href=
"#fl-int-fc"><code>"fixed-length-unsigned-integer"</code></a></p>
5772 <p><a href=
"#fl-enum-fc"><code>"fixed-length-unsigned-enumeration"</code></a></p>
5775 <p><a href=
"#vl-int-fc"><code>"variable-length-unsigned-integer"</code></a></p>
5778 <p><a href=
"#vl-enum-fc"><code>"variable-length-unsigned-enumeration"</code></a></p>
5788 <p><a href=
"#fl-int-fc"><code>"fixed-length-signed-integer"</code></a></p>
5791 <p><a href=
"#fl-enum-fc"><code>"fixed-length-signed-enumeration"</code></a></p>
5794 <p><a href=
"#vl-int-fc"><code>"variable-length-signed-integer"</code></a></p>
5797 <p><a href=
"#vl-enum-fc"><code>"variable-length-signed-enumeration"</code></a></p>
5804 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
5805 <td class=
"tableblock halign-left valign-top"></td>
5808 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>selector-field-ranges
</code></p></td>
5809 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#int-range-set">Integer range set
</a></p></td>
5810 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5811 <p>Ranges of integers which the value of a selector field
<em>MUST
</em> be an
5812 element of to enable an instance of
 <em><strong>F
</strong></em>.
</p>
5814 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes, if the selector field is an instance of a
<a href=
"#fl-int-fc">fixed-length integer field class
</a>
5815 or a
<a href=
"#vl-int-fc">variable-length integer field class
</a>.
</p></td>
5816 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">None if the selector field is an instance of a
<a href=
"#fl-bool-fc">fixed-length boolean field class
</a>.
</p></td>
5819 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>roles
</code></p></td>
5820 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#roles">Roles
</a></p></td>
5821 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5822 <p>Roles of
 <em><strong>F
</strong></em>.
</p>
5824 <div class=
"paragraph">
5825 <p>See
<a href=
"#tc-frag">Trace class fragment
</a> and
<a href=
"#dsc-frag">Data stream class fragment
</a> which indicate accepted within their
5826 root field classes.
</p>
5828 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
5829 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>[]
</code></p></td>
5832 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
5833 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
5834 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5835 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
5837 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
5838 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
5841 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
5842 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
5843 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5844 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
5846 <div class=
"paragraph">
5847 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
5848 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
5850 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
5851 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
5855 <div class=
"exampleblock">
5856 <div class=
"title">Example
60. Optional
<a href=
"#sl-array-fc">static-length array field class
</a> with a
<a href=
"#bool-fc">boolean
</a> selector field class.
</div>
5857 <div class=
"content">
5858 <div class=
"listingblock">
5859 <div class=
"content">
5860 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
5862 "selector-field-location": [
"event-record-payload",
"has-ip"],
5864 "type":
"static-length-array",
5865 "element-field-class": {
5866 "type":
"fixed-length-unsigned-integer",
5868 "byte-order":
"little-endian",
5878 <div class=
"exampleblock">
5879 <div class=
"title">Example
61. Optional null-terminated string with a
<a href=
"#fl-int-fc">fixed-length signed integer
</a> selector field class.
</div>
5880 <div class=
"content">
5881 <div class=
"listingblock">
5882 <div class=
"content">
5883 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
5885 "selector-field-location": [
"event-record-payload",
"has-ip"],
5886 "selector-field-ranges": [[-
12, -
12], [-
5,
0], [
15,
35]],
5888 "type":
"null-terminated-string"
5897 <h4 id=
"var-fc">5.4.25. Variant field class
</h4>
5898 <div class=
"paragraph">
5899 <p>A
<em>variant
</em> field class describes
<em>variant
</em> fields.
</p>
5901 <div class=
"paragraph">
5902 <p>A variant field is, depending on the value of another, anterior (already
5903 encoded/decoded)
<em>selector
</em> field, the instance of a specific, effective
5904 field class amongst one or more
<em>variant field class options
</em>.
</p>
5906 <div class=
"paragraph">
5907 <p>A
<a href=
"#consumer-def">consumer
</a> can locate the selector field thanks to the
5908 <code>selector-field-location
</code> property of the variant field class.
</p>
5910 <table class=
"tableblock frame-all grid-all fit-content">
5911 <caption class=
"title">Table
26. Properties of a variant field class
<em><strong>F
</strong></em>.
</caption>
5921 <th class=
"tableblock halign-left valign-top">Name
</th>
5922 <th class=
"tableblock halign-left valign-top">Type
</th>
5923 <th class=
"tableblock halign-left valign-top">Description
</th>
5924 <th class=
"tableblock halign-left valign-top">Required?
</th>
5925 <th class=
"tableblock halign-left valign-top">Default
</th>
5930 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
5931 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
5932 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5933 <p>Type of
 <em><strong>F
</strong></em>.
</p>
5935 <div class=
"paragraph">
5936 <p>The value of this property
<em>MUST
</em> be
<code>"variant"</code>.
</p>
5938 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
5939 <td class=
"tableblock halign-left valign-top"></td>
5942 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>options
</code></p></td>
5943 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON array of
<a href=
"#var-fc-opt">variant field class options
</a></p></td>
5944 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5945 <p>Options containing the possible effective classes of an instance
5946 of
 <em><strong>F
</strong></em>.
</p>
5948 <div class=
"paragraph">
5949 <p>This array
<em>MUST
</em> contain one or more elements.
</p>
5951 <div class=
"paragraph">
5952 <p>The
<code>name
</code> property of each option, if it
’s set,
<em>MUST
</em> be unique within
5953 the option names of
 <em><strong>F
</strong></em>.
</p>
5955 <div class=
"paragraph">
5956 <p>The integer ranges (
<code>selector-field-ranges
</code> property) of two given
5957 options
<em>MUST
 NOT
</em> intersect.
</p>
5959 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
5960 <td class=
"tableblock halign-left valign-top"></td>
5963 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>selector-field-location
</code></p></td>
5964 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#field-loc">Field location
</a></p></td>
5965 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
5966 <p>Location of the field of which the value indicates which option
5967 of
 <em><strong>F
</strong></em> contains the effective class of an instance
5968 of
 <em><strong>F
</strong></em>.
</p>
5970 <div class=
"paragraph">
5971 <p>For a given instance of
 <em><strong>F
</strong></em>, the
<code>type
</code> property of the
5972 <a href=
"#fc">classes
</a> of
<em>all
</em> the possible selector fields
<em>MUST
</em> be
5982 <p><a href=
"#fl-int-fc"><code>"fixed-length-unsigned-integer"</code></a></p>
5985 <p><a href=
"#fl-enum-fc"><code>"fixed-length-unsigned-enumeration"</code></a></p>
5988 <p><a href=
"#vl-int-fc"><code>"variable-length-unsigned-integer"</code></a></p>
5991 <p><a href=
"#vl-enum-fc"><code>"variable-length-unsigned-enumeration"</code></a></p>
6001 <p><a href=
"#fl-int-fc"><code>"fixed-length-signed-integer"</code></a></p>
6004 <p><a href=
"#fl-enum-fc"><code>"fixed-length-signed-enumeration"</code></a></p>
6007 <p><a href=
"#vl-int-fc"><code>"variable-length-signed-integer"</code></a></p>
6010 <p><a href=
"#vl-enum-fc"><code>"variable-length-signed-enumeration"</code></a></p>
6017 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
6018 <td class=
"tableblock halign-left valign-top"></td>
6021 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>roles
</code></p></td>
6022 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#roles">Roles
</a></p></td>
6023 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6024 <p>Roles of
 <em><strong>F
</strong></em>.
</p>
6026 <div class=
"paragraph">
6027 <p>See
<a href=
"#tc-frag">Trace class fragment
</a> and
<a href=
"#dsc-frag">Data stream class fragment
</a> which indicate accepted within their
6028 root field classes.
</p>
6030 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
6031 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>[]
</code></p></td>
6034 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
6035 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
6036 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6037 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
6039 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
6040 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
6043 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
6044 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
6045 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6046 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
6048 <div class=
"paragraph">
6049 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
6050 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
6052 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
6053 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
6057 <div class=
"exampleblock">
6058 <div class=
"title">Example
62. Variant field class with two options.
</div>
6059 <div class=
"content">
6060 <div class=
"listingblock">
6061 <div class=
"content">
6062 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
6064 "selector-field-location": [
"event-record-payload",
"sel"],
6067 "selector-field-ranges": [[
5,
5]],
6069 "type":
"null-terminated-string"
6073 "selector-field-ranges": [[
8,
8]],
6075 "type":
"fixed-length-signed-integer",
6077 "byte-order":
"little-endian",
6078 "preferred-display-base":
8
6087 <div class=
"exampleblock">
6088 <div class=
"title">Example
63. Variant field class within an
<a href=
"#opt-fc">optional field class
</a> which share the same selector field location.
</div>
6089 <div class=
"content">
6090 <div class=
"paragraph">
6091 <p>This example shows that an optional field class and a contained variant
6092 field class
<em>MAY
</em> share the same selector field location.
</p>
6094 <div class=
"paragraph">
6095 <p>In this example, depending on the value of the selector field:
</p>
6097 <div class=
"hdlist">
6100 <td class=
"hdlist1">
6103 <td class=
"hdlist2">
6104 <p>The optional field is
<em>not
</em> enabled.
</p>
6108 <td class=
"hdlist1">
6111 <td class=
"hdlist2">
6112 <p>The optional field is enabled and is a variant field.
</p>
6113 <div class=
"paragraph">
6114 <p>The variant field is an instance of a
<a href=
"#str-fc">null-terminated string field class
</a> (effective class).
</p>
6119 <td class=
"hdlist1">
6122 <td class=
"hdlist2">
6123 <p>The optional field is enabled and is a variant field.
</p>
6124 <div class=
"paragraph">
6125 <p>The variant field is an instance of a
<a href=
"#vl-int-fc">variable-length signed integer field class
</a> (effective class).
</p>
6131 <div class=
"listingblock">
6132 <div class=
"content">
6133 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
6135 "selector-field-location": [
"event-record-payload",
"sel"],
6136 "selector-field-ranges": [[
1,
255]],
6139 "selector-field-location": [
"event-record-payload",
"sel"],
6142 "selector-field-ranges": [[
1,
1]],
6144 "type":
"null-terminated-string"
6148 "selector-field-ranges": [[
2,
2]],
6150 "type":
"variable-length-signed-integer",
6151 "preferred-display-base":
16
6161 <div class=
"exampleblock">
6162 <div class=
"title">Example
64. Variant field class with
<a href=
"#user-attrs">user attributes
</a>.
</div>
6163 <div class=
"content">
6164 <div class=
"listingblock">
6165 <div class=
"content">
6166 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
6168 "selector-field-location": [
"event-record-specific-context",
"sel"],
6171 "selector-field-ranges": [[
5,
5], [
10,
10], [
15,
15]],
6173 "type":
"static-length-string",
6178 "selector-field-ranges": [[
0,
4], [
6,
9], [
11,
14], [
16,
127]],
6180 "type":
"fixed-length-floating-point-number",
6182 "byte-order":
"big-endian"
6186 "user-attributes": {
6198 <h5 id=
"var-fc-opt">5.4.25.1. Variant field class option
</h5>
6199 <div class=
"paragraph">
6200 <p>A
<em>variant field class option
</em> contains a possible effective class of a
6203 <div class=
"paragraph">
6204 <p>A variant field class option
 <em><strong>O
</strong></em> also contains the ranges of
6205 integer values (
<code>selector-field-ranges
</code> property) of which the value of
6206 a selector field
<em>MUST
</em> be an element of for the effective class of a
6207 variant field to be the field class of
<em><strong>O
</strong></em>.
</p>
6209 <div class=
"paragraph">
6210 <p>A variant field class option is a JSON object.
</p>
6212 <table class=
"tableblock frame-all grid-all fit-content">
6213 <caption class=
"title">Table
27. Properties of a variant field class option
<em><strong>O
</strong></em> contained in a variant field class
 <em><strong>F
</strong></em>.
</caption>
6223 <th class=
"tableblock halign-left valign-top">Name
</th>
6224 <th class=
"tableblock halign-left valign-top">Type
</th>
6225 <th class=
"tableblock halign-left valign-top">Description
</th>
6226 <th class=
"tableblock halign-left valign-top">Required?
</th>
6227 <th class=
"tableblock halign-left valign-top">Default
</th>
6232 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>field-class
</code></p></td>
6233 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#fc">Field class
</a></p></td>
6234 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6235 <p>Field class of
 <em><strong>O
</strong></em>.
</p>
6237 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
6238 <td class=
"tableblock halign-left valign-top"></td>
6241 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>selector-field-ranges
</code></p></td>
6242 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#int-range-set">Integer range set
</a></p></td>
6243 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6244 <p>Ranges of integers which the value of a selector field
<em>MUST
</em> be an
6245 element of for the effective class of an instance of
 <em><strong>F
</strong></em>
6246 to be the field class (
<code>field-class
</code> property) of
 <em><strong>O
</strong></em>.
</p>
6248 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
6249 <td class=
"tableblock halign-left valign-top"></td>
6252 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>name
</code></p></td>
6253 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
6254 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6255 <p>Name of
 <em><strong>O
</strong></em>.
</p>
6257 <div class=
"paragraph">
6258 <p>This property exists to remain backward compatible with
<a href=
"https://diamon.org/ctf/v1.8.3/">CTF
 1</a>:
6259 it
’s not strictly needed to decode an instance of
 <em><strong>F
</strong></em>.
</p>
6261 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
6262 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>O
</strong></em> is unnamed
</p></td>
6265 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
6266 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
6267 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6268 <p>User attributes of
 <em><strong>O
</strong></em>.
</p>
6270 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
6271 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
6274 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
6275 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
6276 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6277 <p>Extensions of
 <em><strong>O
</strong></em>.
</p>
6279 <div class=
"paragraph">
6280 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
6281 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
6283 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
6284 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
6288 <div class=
"exampleblock">
6289 <div class=
"title">Example
65. Unnamed
<a href=
"#str-fc">null-terminated string field class
</a> option.
</div>
6290 <div class=
"content">
6291 <div class=
"listingblock">
6292 <div class=
"content">
6293 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
6295 "type":
"null-terminated-string"
6297 "selector-field-ranges": [[
3,
9]]
6303 <div class=
"exampleblock">
6304 <div class=
"title">Example
66.
<a href=
"#vl-int-fc">Variable-length signed integer field class
</a> option named
<code>juice
</code> with
<a href=
"#user-attrs">user attributes
</a>.
</div>
6305 <div class=
"content">
6306 <div class=
"listingblock">
6307 <div class=
"content">
6308 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
6311 "type":
"variable-length-signed-integer",
6312 "preferred-display-base":
16
6314 "selector-field-ranges": [[-
4,
4], [
9,
9], [
100,
200]],
6315 "user-attributes": {
6318 243,
97,
0,
184,
236,
54,
72,
97,
6319 141,
107,
169,
214,
171,
137,
115,
201
6333 <h3 id=
"preamble-frag">5.5. Preamble fragment
</h3>
6334 <div class=
"paragraph">
6335 <p>A
<em>preamble fragment
</em> indicates:
</p>
6340 <p>The CTF
 2 major version (
2).
</p>
6341 <div class=
"paragraph">
6342 <p>CTF
 2 doesn
’t have a minor version: users can use
6343 <a href=
"#user-attributes">user attributes
</a> and
<a href=
"#ext">extensions
</a> to add
6344 features to, or change features of, the format which this document
6349 <p><a href=
"#ext">Extension
</a> declarations.
</p>
6350 <div class=
"paragraph">
6351 <p>An extension declaration is an initial extension of which the purpose is
6352 to declare that it
’s
<em>enabled
</em> within the
<a href=
"#metadata-stream">metadata
6355 <div class=
"paragraph">
6356 <p>Because an extension
<em>MAY
</em> alter the CTF
 2 format itself, and because a
6357 preamble fragment is always the first metadata stream fragment, those
6358 extension declarations make it possible for a
<a href=
"#consumer-def">consumer
</a>
6359 to gracefully decline the
<a href=
"#ds">data streams
</a> of the trace if it doesn
’t
6360 support
<em>any
</em> declared extension.
</p>
6365 <div class=
"paragraph">
6366 <p>The first fragment of a metadata stream
<em>MUST
</em> be a preamble fragment.
</p>
6368 <table class=
"tableblock frame-all grid-all fit-content">
6369 <caption class=
"title">Table
28. Properties of a preamble fragment
<em><strong>F
</strong></em>.
</caption>
6379 <th class=
"tableblock halign-left valign-top">Name
</th>
6380 <th class=
"tableblock halign-left valign-top">Type
</th>
6381 <th class=
"tableblock halign-left valign-top">Description
</th>
6382 <th class=
"tableblock halign-left valign-top">Required?
</th>
6383 <th class=
"tableblock halign-left valign-top">Default
</th>
6388 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
6389 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
6390 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Type of
 <em><strong>F
</strong></em>.
</p>
6391 <p class=
"tableblock">The value of this property
<em>MUST
</em> be
<code>"preamble"</code>.
</p></td>
6392 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
6393 <td class=
"tableblock halign-left valign-top"></td>
6396 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>version
</code></p></td>
6397 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
6398 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">CTF
 2 major version.
</p>
6399 <p class=
"tableblock">The value of this property
<em>MUST
</em> be
<code>2</code>.
</p></td>
6400 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
6401 <td class=
"tableblock halign-left valign-top"></td>
6404 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
6405 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
6406 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">User attributes of
 <em><strong>F
</strong></em>.
</p></td>
6407 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
6408 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
6411 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
6412 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
6413 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Extension declarations of
 <em><strong>F
</strong></em>.
</p>
6414 <p class=
"tableblock">The name of each property is a
<a href=
"#ns-def">namespace
</a> and its value is a
6415 <a href=
"#ns-exts-obj">namespaced extensions object
</a>.
</p>
6416 <p class=
"tableblock">Within a
<a href=
"#ns-exts-obj">namespaced extensions object
</a>, an extension
6417 named
 <em><strong>N
</strong></em> is
<em>declared
</em> when it exists as a property
6418 named
 <em><strong>N
</strong></em>, whatever the value of the property.
</p></td>
6419 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
6420 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
6424 <div class=
"exampleblock">
6425 <div class=
"title">Example
67. Minimal preamble fragment.
</div>
6426 <div class=
"content">
6427 <div class=
"listingblock">
6428 <div class=
"content">
6429 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
6437 <div class=
"exampleblock">
6438 <div class=
"title">Example
68. Preamble fragment with
<a href=
"#ext">extension
</a> declarations.
</div>
6439 <div class=
"content">
6440 <div class=
"paragraph">
6441 <p>The following preamble fragment declares the
<code>piano
</code> and
<code>ramen
</code>
6442 extensions under the
<code>my.tracer
</code> namespace.
</p>
6444 <div class=
"listingblock">
6445 <div class=
"content">
6446 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
6453 "temperament":
"equal"
6465 <h3 id=
"tc-frag">5.6. Trace class fragment
</h3>
6466 <div class=
"paragraph">
6467 <p>A
<em>trace class
</em> describes
<a href=
"#trace"><em>traces
</em></a>.
</p>
6469 <div class=
"paragraph">
6470 <p>Within a metadata stream, a trace class fragment
<em>MUST
</em> occur, if any,
6471 before any
<a href=
"#dsc-frag">data stream class fragment
</a>.
</p>
6473 <table class=
"tableblock frame-all grid-all fit-content">
6474 <caption class=
"title">Table
29. Properties of a trace class fragment
<em><strong>F
</strong></em>.
</caption>
6484 <th class=
"tableblock halign-left valign-top">Name
</th>
6485 <th class=
"tableblock halign-left valign-top">Type
</th>
6486 <th class=
"tableblock halign-left valign-top">Description
</th>
6487 <th class=
"tableblock halign-left valign-top">Required?
</th>
6488 <th class=
"tableblock halign-left valign-top">Default
</th>
6493 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
6494 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
6495 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6496 <p>Type of
 <em><strong>F
</strong></em>.
</p>
6498 <div class=
"paragraph">
6499 <p>The value of this property
<em>MUST
</em> be
<code>"trace-class"</code>.
</p>
6501 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
6502 <td class=
"tableblock halign-left valign-top"></td>
6505 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>uuid
</code></p></td>
6506 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#uuid">UUID
</a></p></td>
6507 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6508 <p>UUID of
 <em><strong>F
</strong></em>.
</p>
6510 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
6511 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>F
</strong></em> has no UUID
</p></td>
6514 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>packet-header-field-class
</code></p></td>
6515 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#struct-fc">Structure field class
</a></p></td>
6516 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6517 <p>Class of all the
<a href=
"#pkt-header">packet header fields
</a> of an instance
6518 of
 <em><strong>F
</strong></em>.
</p>
6520 <div class=
"paragraph">
6521 <p>Any field class as the value of this property
<em>MUST
</em> satisfy
<em>at least
6527 <p>Have at least one valid
<a href=
"#pkt-header-roles">role
</a>.
</p>
6530 <p>Be a
<a href=
"#struct-fc">structure field class
</a>.
</p>
6533 <p>Be an
<a href=
"#opt-fc">optional field class
</a>.
</p>
6536 <p>Be a
<a href=
"#var-fc">variant field class
</a>.
</p>
6539 <p>Be the class of a field which is the selector field of an optional
6540 or variant field.
</p>
6544 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
6545 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>F
</strong></em> has no packet header field class
</p></td>
6548 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
6549 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
6550 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6551 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
6553 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
6554 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
6557 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
6558 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
6559 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6560 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
6562 <div class=
"paragraph">
6563 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
6564 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
6566 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
6567 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
6572 <h4 id=
"_roles">5.6.1. Roles
</h4>
6573 <div class=
"paragraph">
6574 <p><a id=
"pkt-header-roles"></a> If the
<code>packet-header-field-class
</code> property of a
6575 trace class fragment exists, then the
<a href=
"#fc">field classes
</a> of its
6576 <a href=
"#struct-member-cls">member classes
</a> <em>MAY
</em> have the following
6577 <a href=
"#roles">roles
</a>:
</p>
6579 <table class=
"tableblock frame-all grid-all fit-content">
6580 <caption class=
"title">Table
30. Roles of field classes of the member classes of a packet header field class.
</caption>
6589 <th class=
"tableblock halign-left valign-top">Name
</th>
6590 <th class=
"tableblock halign-left valign-top">Description
</th>
6591 <th class=
"tableblock halign-left valign-top">Field class (
<em><strong>F
</strong></em>) constraints
</th>
6592 <th class=
"tableblock halign-left valign-top">Other constraints
</th>
6597 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>packet-magic-number
</code></p></td>
6598 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#pkt">Packet
</a> magic number.
</p>
6599 <p class=
"tableblock">The purpose of a packet magic number field is to confirm the beginning
6600 of a CTF
 2 packet.
</p></td>
6601 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6602 <p><a href=
"#fl-int-fc">Fixed-length unsigned integer field class
</a> with the following property value:
</p>
6604 <div class=
"hdlist">
6607 <td class=
"hdlist1">
6610 <td class=
"hdlist2">
6611 <p><code>32</code></p>
6616 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6617 <p>An instance of
 <em><strong>F
</strong></em> <em>MUST
</em> be the
<em>first
</em> member of the packet
6618 header structure field.
</p>
6620 <div class=
"paragraph">
6621 <p>The value of an instance of
 <em><strong>F
</strong></em> value
<em>MUST
</em> be
0xc1fc1fc1
6626 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>trace-class-uuid
</code></p></td>
6627 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Trace class UUID.
</p>
6628 <p class=
"tableblock">The purpose of a trace class UUID field is to confirm the association
6629 between a
<a href=
"#ds">data stream
</a> and a
<a href=
"#metadata-stream-overview">metadata
6630 stream
</a>.
</p></td>
6631 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6632 <p><a href=
"#sl-blob-fc">Static-length BLOB field class
</a> with the following property value:
</p>
6634 <div class=
"hdlist">
6637 <td class=
"hdlist1">
6640 <td class=
"hdlist2">
6641 <p><code>16</code></p>
6646 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6647 <p>The
<code>uuid
</code> property of the trace class
<em>MUST
</em> exist.
</p>
6649 <div class=
"paragraph">
6650 <p>The
16 bytes of an instance of
 <em><strong>F
</strong></em> <em>MUST
</em> be equal to the
6651 16 JSON integers of the
<code>uuid
</code> property of the trace class.
</p>
6655 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>data-stream-class-id
</code></p></td>
6656 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Data stream class ID.
</p>
6657 <p class=
"tableblock">The purpose of a data stream class ID field is to set the current ID of
6658 the class of the data stream of the current packet.
</p></td>
6659 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6660 <p><a href=
"#fl-int-fc">Fixed-length unsigned integer field class
</a> or
<a href=
"#vl-int-fc">variable-length unsigned integer field class
</a>.
</p>
6662 <td class=
"tableblock halign-left valign-top"><div class=
"content"></div></td>
6665 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>data-stream-id
</code></p></td>
6666 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Data stream ID.
</p>
6667 <p class=
"tableblock">The purpose of a data stream ID field is to set the current ID of
6668 the data stream of the current packet.
</p>
6669 <p class=
"tableblock">Combined with the ID of its class, such a field makes it possible to
6670 uniquely identify a data stream within a
<a href=
"#trace">trace
</a>.
</p></td>
6671 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6672 <p><a href=
"#fl-int-fc">Fixed-length unsigned integer field class
</a> or
<a href=
"#vl-int-fc">variable-length unsigned integer field class
</a>.
</p>
6674 <td class=
"tableblock halign-left valign-top"><div class=
"content"></div></td>
6678 <div class=
"exampleblock">
6679 <div class=
"title">Example
69. Trace class fragment.
</div>
6680 <div class=
"content">
6681 <div class=
"listingblock">
6682 <div class=
"content">
6683 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
6684 "type":
"trace-class",
6686 30,
201,
100,
148,
228,
2,
69,
70,
6687 147,
219,
233,
34,
43,
238,
108,
199
6689 "packet-header-field-class": {
6690 "type":
"structure",
6693 "name":
"the magic!",
6695 "type":
"fixed-length-unsigned-integer",
6697 "byte-order":
"little-endian",
6698 "preferred-display-base":
16,
6699 "roles": [
"packet-magic-number"]
6705 "type":
"static-length-blob",
6707 "roles": [
"trace-class-uuid"]
6711 "name":
"my data stream class ID",
6713 "type":
"fixed-length-unsigned-integer",
6715 "byte-order":
"little-endian",
6716 "roles": [
"data-stream-class-id"]
6720 "name":
"my data stream ID",
6722 "type":
"variable-length-unsigned-integer",
6723 "roles": [
"data-stream-id"]
6736 <h3 id=
"cc-frag">5.7. Clock class fragment
</h3>
6737 <div class=
"paragraph">
6738 <p>A
<em>clock class
</em> describes
<em>clocks
</em>.
</p>
6740 <div class=
"paragraph">
6741 <p>A
<a href=
"#ds">data stream
</a> <em>MAY
</em> have a
<a href=
"#def-clk">default clock
</a>.
</p>
6743 <div class=
"paragraph">
6744 <p>Within a metadata stream, a clock class fragment
<em>MUST
</em> occur before any
6745 <a href=
"#dsc-frag">data stream class fragment
</a> which refers to it by name with
6746 its
<code>default-clock-class-name
</code> property.
</p>
6748 <table class=
"tableblock frame-all grid-all fit-content">
6749 <caption class=
"title">Table
31. Properties of a clock class fragment
<em><strong>F
</strong></em>.
</caption>
6759 <th class=
"tableblock halign-left valign-top">Name
</th>
6760 <th class=
"tableblock halign-left valign-top">Type
</th>
6761 <th class=
"tableblock halign-left valign-top">Description
</th>
6762 <th class=
"tableblock halign-left valign-top">Required?
</th>
6763 <th class=
"tableblock halign-left valign-top">Default
</th>
6768 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
6769 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
6770 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6771 <p>Type of
 <em><strong>F
</strong></em>.
</p>
6773 <div class=
"paragraph">
6774 <p>The value of this property
<em>MUST
</em> be
<code>"clock-class"</code>.
</p>
6776 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
6777 <td class=
"tableblock halign-left valign-top"></td>
6780 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>frequency
</code></p></td>
6781 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
6782 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6783 <p>Frequency of an instance of
 <em><strong>F
</strong></em> (Hz).
</p>
6785 <div class=
"paragraph">
6786 <p>The value of this property
<em>MUST
</em> be greater than zero.
</p>
6788 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
6789 <td class=
"tableblock halign-left valign-top"></td>
6792 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>name
</code></p></td>
6793 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
6794 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6795 <p>Name of
 <em><strong>F
</strong></em>.
</p>
6797 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
6798 <td class=
"tableblock halign-left valign-top"></td>
6801 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>description
</code></p></td>
6802 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
6803 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6804 <p>Textual description of
 <em><strong>F
</strong></em>.
</p>
6806 <div class=
"paragraph">
6807 <p>This property exists to remain backward compatible with
<a href=
"https://diamon.org/ctf/v1.8.3/">CTF
 1</a>:
6808 it
’s not strictly needed to decode
<a href=
"#ds">data streams
</a>.
</p>
6810 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
6811 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>F
</strong></em> has no textual description
</p></td>
6814 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>uuid
</code></p></td>
6815 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#uuid">UUID
</a></p></td>
6816 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6817 <p>UUID of
 <em><strong>F
</strong></em>.
</p>
6819 <div class=
"paragraph">
6820 <p>This property exists to remain backward compatible with
<a href=
"https://diamon.org/ctf/v1.8.3/">CTF
 1</a>:
6821 it
’s not strictly needed to decode
<a href=
"#ds">data streams
</a>.
</p>
6823 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
6824 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>F
</strong></em> has no UUID
</p></td>
6827 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>origin-is-unix-epoch
</code></p></td>
6828 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON boolean
</p></td>
6829 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6830 <p>Whether or not the origin of an instance of
 <em><strong>F
</strong></em> is
6831 the
<a href=
"https://en.wikipedia.org/wiki/Unix_time">Unix epoch
</a>.
</p>
6833 <div class=
"paragraph">
6834 <p>If the value of this property is
<code>false
</code>, then the origin of
6835 an instance of
 <em><strong>F
</strong></em> is unknown.
</p>
6837 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
6838 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>true
</code></p></td>
6841 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>offset
</code></p></td>
6842 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#clock-offset">Clock offset
</a></p></td>
6843 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6844 <p>Offset of an instance of
 <em><strong>F
</strong></em> relative to its origin.
</p>
6846 <div class=
"paragraph">
6849 <div class=
"olist arabic">
6852 <p><em><strong>H
</strong></em> be the value of the
<code>frequency
</code> property of
 <em><strong>F
</strong></em>.
</p>
6855 <p><em><strong>O
</strong></em> be the value of this property.
</p>
6858 <p><em><strong>S
</strong></em> be the value of the
<code>seconds
</code> property of
 <em><strong>O
</strong></em>.
</p>
6861 <p><em><strong>C
</strong></em> be the value of the
<code>cycles
</code> property of
 <em><strong>O
</strong></em>.
</p>
6865 <div class=
"paragraph">
6866 <p>Then the effective offset of an instance of
 <em><strong>F
</strong></em>, in clock
6868 is
 <em><strong>S
</strong></em> Ã—
 <em><strong>H
</strong></em> +
 <em><strong>C
</strong></em>.
</p>
6870 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
6871 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{
"seconds":
 0,
"cycles":
 0}
</code></p></td>
6874 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>precision
</code></p></td>
6875 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
6876 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6877 <p>Precision of an instance of
 <em><strong>F
</strong></em> (clock cycles).
</p>
6879 <div class=
"paragraph">
6880 <p>The value of this property
<em>MUST
</em> be greater than or equal to zero.
</p>
6882 <div class=
"paragraph">
6883 <p>Let
 <em><strong>P
</strong></em> be the value of this property and
 <em><strong>V
</strong></em>
6884 the value of an instance of
 <em><strong>F
</strong></em>: the range of possible
6885 values of the instance
6886 is
 [
<em><strong>V
</strong></em> âˆ’
 <em><strong>P
</strong></em>,
 <em><strong>V
</strong></em> +
 <em><strong>P
</strong></em>].
</p>
6888 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
6889 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>0</code></p></td>
6892 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
6893 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
6894 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6895 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
6897 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
6898 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
6901 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
6902 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
6903 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
6904 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
6906 <div class=
"paragraph">
6907 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
6908 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
6910 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
6911 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
6915 <div class=
"paragraph">
6916 <p>Within a metadata stream, two given clock class fragments
<em>MUST
 NOT
</em>:
</p>
6921 <p>Share the same
<code>name
</code> property value.
</p>
6924 <p>Share the same
<code>uuid
</code> property value.
</p>
6928 <div class=
"exampleblock">
6929 <div class=
"title">Example
70. Minimal clock class fragment with
1-GHz instances.
</div>
6930 <div class=
"content">
6931 <div class=
"listingblock">
6932 <div class=
"content">
6933 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
6934 "type":
"clock-class",
6935 "name":
"my clock class",
6936 "frequency":
1000000000
6942 <div class=
"exampleblock">
6943 <div class=
"title">Example
71. Clock class fragment with a UUID property.
</div>
6944 <div class=
"content">
6945 <div class=
"listingblock">
6946 <div class=
"content">
6947 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
6948 "type":
"clock-class",
6949 "name":
"my clock class",
6950 "frequency":
1000000000,
6952 116,
210,
0,
140,
239,
255,
77,
3,
6953 129,
99,
233,
226,
134,
106,
207,
32
6960 <div class=
"exampleblock">
6961 <div class=
"title">Example
72. Clock class fragment with instances having a specific offset.
</div>
6962 <div class=
"content">
6963 <div class=
"listingblock">
6964 <div class=
"content">
6965 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
6966 "type":
"clock-class",
6967 "name":
"my clock class",
6968 "frequency":
1000000000,
6970 "seconds":
1605112699,
6978 <div class=
"exampleblock">
6979 <div class=
"title">Example
73. Clock class fragment with instances having a specific precision.
</div>
6980 <div class=
"content">
6981 <div class=
"listingblock">
6982 <div class=
"content">
6983 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
6984 "type":
"clock-class",
6985 "name":
"my clock class",
6986 "frequency":
8000000,
6993 <div class=
"exampleblock">
6994 <div class=
"title">Example
74. Clock class fragment with instances having an origin which isn
’t the Unix epoch.
</div>
6995 <div class=
"content">
6996 <div class=
"listingblock">
6997 <div class=
"content">
6998 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
6999 "type":
"clock-class",
7000 "name":
"my clock class",
7001 "frequency":
1000000000,
7002 "origin-is-unix-epoch": false
7008 <div class=
"exampleblock">
7009 <div class=
"title">Example
75. Clock class fragment with
<a href=
"#user-attrs">user attributes
</a>.
</div>
7010 <div class=
"content">
7011 <div class=
"listingblock">
7012 <div class=
"content">
7013 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
7014 "type":
"clock-class",
7015 "name":
"my clock class",
7016 "frequency":
16000000,
7017 "user-attributes": {
7019 "sys-name":
"SOC23",
7024 "propagation-delay-ps":
177
7033 <h4 id=
"clock-offset">5.7.1. Clock offset
</h4>
7034 <div class=
"paragraph">
7035 <p>A
<em>clock offset
</em> contains the offset of the instances of a
7036 <a href=
"#cc-frag">clock class
</a> relative to their origin.
</p>
7038 <div class=
"paragraph">
7039 <p>A clock offset is a JSON object.
</p>
7041 <table class=
"tableblock frame-all grid-all fit-content">
7042 <caption class=
"title">Table
32. Properties of a clock offset contained in a clock class fragment
<em><strong>F
</strong></em>.
</caption>
7052 <th class=
"tableblock halign-left valign-top">Name
</th>
7053 <th class=
"tableblock halign-left valign-top">Type
</th>
7054 <th class=
"tableblock halign-left valign-top">Description
</th>
7055 <th class=
"tableblock halign-left valign-top">Required?
</th>
7056 <th class=
"tableblock halign-left valign-top">Default
</th>
7061 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>seconds
</code></p></td>
7062 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
7063 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Offset, in seconds, of an instance of
 <em><strong>F
</strong></em> relative to its
7065 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
7066 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>0</code></p></td>
7069 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>cycles
</code></p></td>
7070 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
7071 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Offset, in cycles, of an instance of
 <em><strong>F
</strong></em> relative to its
7073 <p class=
"tableblock">The value of this property
<em>MUST
</em> be greater than or equal to zero.
</p>
7074 <p class=
"tableblock">The value of this property
<em>MUST
</em> be less than the value of the
7075 <code>frequency
</code> property of
 <em><strong>F
</strong></em>.
</p></td>
7076 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
7077 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>0</code></p></td>
7081 <div class=
"exampleblock">
7082 <div class=
"title">Example
76. Minimal clock offset.
</div>
7083 <div class=
"content">
7084 <div class=
"listingblock">
7085 <div class=
"content">
7086 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{}
</code></pre>
7091 <div class=
"exampleblock">
7092 <div class=
"title">Example
77. Clock offset with seconds and cycles.
</div>
7093 <div class=
"content">
7094 <div class=
"listingblock">
7095 <div class=
"content">
7096 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
7097 "seconds":
1605112699,
7104 <div class=
"exampleblock">
7105 <div class=
"title">Example
78. Clock offset with seconds only.
</div>
7106 <div class=
"content">
7107 <div class=
"listingblock">
7108 <div class=
"content">
7109 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
7110 "seconds":
1605111293
7116 <div class=
"exampleblock">
7117 <div class=
"title">Example
79. Negative clock offset.
</div>
7118 <div class=
"content">
7119 <div class=
"paragraph">
7120 <p>This example shows that a clock offset
<em>MAY
</em> be negative, that is,
7121 <em>before
</em> the origin of the clock.
</p>
7123 <div class=
"listingblock">
7124 <div class=
"content">
7125 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
7136 <h3 id=
"dsc-frag">5.8. Data stream class fragment
</h3>
7137 <div class=
"paragraph">
7138 <p>A
<em>data stream class
</em> describes
<a href=
"#ds"><em>data streams
</em></a>.
</p>
7140 <div class=
"paragraph">
7141 <p>Within a metadata stream, a data stream class fragment
<em><strong>F
</strong></em> <em>MUST
</em>
7142 occur before any
<a href=
"#erc-frag">event record class fragment
</a> of
7143 which
 <em><strong>F
</strong></em> is the parent.
</p>
7145 <table class=
"tableblock frame-all grid-all fit-content">
7146 <caption class=
"title">Table
33. Properties of a data stream class fragment
<em><strong>F
</strong></em>.
</caption>
7156 <th class=
"tableblock halign-left valign-top">Name
</th>
7157 <th class=
"tableblock halign-left valign-top">Type
</th>
7158 <th class=
"tableblock halign-left valign-top">Description
</th>
7159 <th class=
"tableblock halign-left valign-top">Required?
</th>
7160 <th class=
"tableblock halign-left valign-top">Default
</th>
7165 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
7166 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
7167 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7168 <p>Type of
 <em><strong>F
</strong></em>.
</p>
7170 <div class=
"paragraph">
7171 <p>The value of this property
<em>MUST
</em> be
<code>"data-stream-class"</code>.
</p>
7173 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
7174 <td class=
"tableblock halign-left valign-top"></td>
7177 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>id
</code></p></td>
7178 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
7179 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7180 <p>Numeric ID of
 <em><strong>F
</strong></em>.
</p>
7182 <div class=
"paragraph">
7183 <p>The value of this property
<em>MUST
</em> be greater than or equal to zero.
</p>
7185 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
7186 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>0</code></p></td>
7189 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>name
</code></p></td>
7190 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
7191 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7192 <p>Name of
 <em><strong>F
</strong></em>.
</p>
7194 <div class=
"paragraph">
7195 <p>The purpose of this property, combined with the
<code>namespace
</code> property, is
7196 to uniquely identify a data stream class amongst many
7197 <a href=
"#producer-def">producers
</a>.
</p>
7199 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
7200 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>F
</strong></em> is unnamed
</p></td>
7203 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>namespace
</code></p></td>
7204 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
7205 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7206 <p><a href=
"#ns-def">Namespace
</a> of
 <em><strong>F
</strong></em>.
</p>
7208 <div class=
"paragraph">
7209 <p>The purpose of this property, combined with the
<code>name
</code> property, is to
7210 uniquely identify a data stream class amongst many
7211 <a href=
"#producer-def">producers
</a>.
</p>
7213 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
7214 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>F
</strong></em> has no namespace
</p></td>
7217 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>default-clock-class-name
</code></p></td>
7218 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
7219 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7220 <p>Name of the
<a href=
"#cc-frag">class
</a> of the
<a href=
"#def-clk">default clock
</a> of an
7221 instance of
 <em><strong>F
</strong></em>.
</p>
7223 <div class=
"paragraph">
7224 <p>Within the metadata stream containing
 <em><strong>F
</strong></em>, the
<a href=
"#cc-frag">clock
7225 class fragment
</a> which has the value of this property as its
<code>name
</code>
7226 property
<em>MUST
</em> occur before
 <em><strong>F
</strong></em>.
</p>
7228 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
7229 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">An instance of
 <em><strong>F
</strong></em> has no default clock
</p></td>
7232 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>packet-context-field-class
</code></p></td>
7233 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#struct-fc">Structure field class
</a></p></td>
7234 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7235 <p>Class of all the
<a href=
"#pkt-ctx">packet context fields
</a> of an instance
7236 of
 <em><strong>F
</strong></em>.
</p>
7238 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
7239 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>F
</strong></em> has no packet context field class
</p></td>
7242 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>event-record-header-field-class
</code></p></td>
7243 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#struct-fc">Structure field class
</a></p></td>
7244 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7245 <p>Class of all the
<a href=
"#er-header">event record header fields
</a> of an
7246 instance of
 <em><strong>F
</strong></em>.
</p>
7248 <div class=
"paragraph">
7249 <p>Any field class as the value of this property
<em>MUST
</em> satisfy
<em>at least
7255 <p>Have at least one valid
<a href=
"#er-header-roles">role
</a>.
</p>
7258 <p>Be a
<a href=
"#struct-fc">structure field class
</a>.
</p>
7261 <p>Be an
<a href=
"#opt-fc">optional field class
</a>.
</p>
7264 <p>Be a
<a href=
"#var-fc">variant field class
</a>.
</p>
7267 <p>Be the class of a field which is the selector field of an optional or
7272 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
7273 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>F
</strong></em> has no event record header field class
</p></td>
7276 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>event-record-common-context-field-class
</code></p></td>
7277 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#struct-fc">Structure field class
</a></p></td>
7278 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7279 <p>Class of all the
<a href=
"#er-common-ctx">event record common context fields
</a>
7280 of an instance of
 <em><strong>F
</strong></em>.
</p>
7282 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
7283 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>F
</strong></em> has no event record common context field class
</p></td>
7286 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
7287 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
7288 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7289 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
7291 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
7292 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
7295 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
7296 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
7297 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7298 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
7300 <div class=
"paragraph">
7301 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
7302 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
7304 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
7305 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
7309 <div class=
"paragraph">
7310 <p>Within a metadata stream, two given data stream class fragments
7311 <em>MUST
 NOT
</em> share the same
<code>id
</code> property value.
</p>
7314 <h4 id=
"_roles_2">5.8.1. Roles
</h4>
7315 <div class=
"paragraph">
7316 <p><a id=
"pkt-ctx-roles"></a> If the
<code>packet-context-field-class
</code> property of a data
7317 stream class fragment exists, then the
<a href=
"#fc">field classes
</a> of its
7318 <a href=
"#struct-member-cls">member classes
</a> <em>MAY
</em> have the following
7319 <a href=
"#roles">roles
</a>:
</p>
7321 <table class=
"tableblock frame-all grid-all fit-content">
7322 <caption class=
"title">Table
34. Roles of field classes of the member classes of a packet context field class.
</caption>
7331 <th class=
"tableblock halign-left valign-top">Name
</th>
7332 <th class=
"tableblock halign-left valign-top">Description
</th>
7333 <th class=
"tableblock halign-left valign-top">Field class (
<em><strong>F
</strong></em>) constraints
</th>
7334 <th class=
"tableblock halign-left valign-top">Other constraints
</th>
7339 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>packet-total-size
</code></p></td>
7340 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Total size (bits) of the
<a href=
"#pkt">packet
</a>.
</p>
7341 <p class=
"tableblock">This size includes any padding after the packet contents.
</p></td>
7342 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7343 <p><a href=
"#fl-int-fc">Fixed-length unsigned integer field class
</a> or
<a href=
"#vl-int-fc">variable-length unsigned integer field class
</a>.
</p>
7345 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7346 <p>The value of an instance of
 <em><strong>F
</strong></em> <em>MUST
</em> be greater than or
7347 equal to the value of an instance of a field class having the
7348 <code>packet-content-size
</code> role, if any, within the
<em>same
</em> packet context
7353 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>packet-content-size
</code></p></td>
7354 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Content size (bits) of the packet.
</p></td>
7355 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7356 <p><a href=
"#fl-int-fc">Fixed-length unsigned integer field class
</a> or
<a href=
"#vl-int-fc">variable-length unsigned integer field class
</a>.
</p>
7358 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7359 <p>The value of an instance of
 <em><strong>F
</strong></em> <em>MUST
</em> be less than or equal
7360 to the value of an instance of a field class having the
7361 <code>packet-total-size
</code> role, if any, within the
<em>same
</em> packet context
7366 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>packet-beginning-default-clock-timestamp
</code></p></td>
7367 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Timestamp of the
<a href=
"#def-clk">default clock
</a> of the
<a href=
"#ds">data stream
</a>
7368 when the packet begins.
</p></td>
7369 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7370 <p><a href=
"#fl-int-fc">Fixed-length unsigned integer field class
</a> or
<a href=
"#vl-int-fc">variable-length unsigned integer field class
</a>.
</p>
7372 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7373 <p>The timestamps of all the
<a href=
"#er">event records
</a> of the packet
<em>MUST
</em> be
7374 greater than or equal to the value of an instance of
 <em><strong>F
</strong></em>.
</p>
7376 <div class=
"paragraph">
7377 <p>The value of an instance of
 <em><strong>F
</strong></em> <em>MUST
</em> be less than or equal to
7378 the value of an instance of a field class having the
7379 <code>packet-end-default-clock-timestamp
</code> role, if any, within the
<em>same
</em>
7380 packet context field.
</p>
7384 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>packet-end-default-clock-timestamp
</code></p></td>
7385 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Timestamp of the default clock of the data stream when the packet ends.
</p></td>
7386 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7387 <p><a href=
"#fl-int-fc">Fixed-length unsigned integer field class
</a> or
<a href=
"#vl-int-fc">variable-length unsigned integer field class
</a>.
</p>
7389 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7390 <p>The timestamps of all the
<a href=
"#er">event records
</a> of the packet
<em>MUST
</em> be
7391 less than or equal to the value of an instance of
 <em><strong>F
</strong></em>.
</p>
7393 <div class=
"paragraph">
7394 <p>The value of an instance of
 <em><strong>F
</strong></em> <em>MUST
</em> be greater than or equal
7395 to the value of an instance of a field class having the
7396 <code>packet-beginning-default-clock-timestamp
</code> role, if any, within the
7397 <em>same
</em> packet context field.
</p>
7401 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>discarded-event-record-counter-snapshot
</code></p></td>
7402 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Snapshot of the
<a href=
"#disc-er-counter">discarded event record counter
</a> of
7403 the data stream when the packet ends.
</p></td>
7404 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7405 <p><a href=
"#fl-int-fc">Fixed-length unsigned integer field class
</a> or
<a href=
"#vl-int-fc">variable-length unsigned integer field class
</a>.
</p>
7407 <td class=
"tableblock halign-left valign-top"><div class=
"content"></div></td>
7410 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a id=
"pkt-seq-num-role"></a> <code>packet-sequence-number
</code></p></td>
7411 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Sequence number of the packet within its data stream.
</p></td>
7412 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7413 <p><a href=
"#fl-int-fc">Fixed-length unsigned integer field class
</a> or
<a href=
"#vl-int-fc">variable-length unsigned integer field class
</a>.
</p>
7415 <td class=
"tableblock halign-left valign-top"><div class=
"content"></div></td>
7419 <div class=
"paragraph">
7420 <p><a id=
"er-header-roles"></a> If the
<code>event-record-header-field-class
</code> property of
7421 a data stream class fragment exists, then the
<a href=
"#fc">field classes
</a> of
7422 its
<a href=
"#struct-member-cls">member classes
</a> <em>MAY
</em> have the following
7423 <a href=
"#roles">roles
</a>:
</p>
7425 <table class=
"tableblock frame-all grid-all fit-content">
7426 <caption class=
"title">Table
35. Roles of field classes of the member classes of an event record header field class.
</caption>
7434 <th class=
"tableblock halign-left valign-top">Name
</th>
7435 <th class=
"tableblock halign-left valign-top">Description
</th>
7436 <th class=
"tableblock halign-left valign-top">Field class (
<em><strong>F
</strong></em>) constraints
</th>
7441 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>event-record-class-id
</code></p></td>
7442 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Event record class ID.
</p>
7443 <p class=
"tableblock">The purpose of an event record class ID field is to set the current ID
7444 of the class of the event record within its parent
<a href=
"#dsc-frag">data
7445 stream class
</a>.
</p></td>
7446 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7447 <p><a href=
"#fl-int-fc">Fixed-length unsigned integer field class
</a> or
<a href=
"#vl-int-fc">variable-length unsigned integer field class
</a>.
</p>
7451 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>default-clock-timestamp
</code></p></td>
7452 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Current timestamp of the
<a href=
"#def-clk">default clock
</a> of the data stream
7453 when the event record occurs.
</p></td>
7454 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7455 <p><a href=
"#fl-int-fc">Fixed-length unsigned integer field class
</a> or
<a href=
"#vl-int-fc">variable-length unsigned integer field class
</a>.
</p>
7463 <h3 id=
"erc-frag">5.9. Event record class fragment
</h3>
7464 <div class=
"paragraph">
7465 <p>An
<em>event record class
</em> describes
<a href=
"#er"><em>event records
</em></a>.
</p>
7467 <div class=
"paragraph">
7468 <p>The
<a href=
"#dsc-frag">data stream class fragment
</a> of which the value of the
7469 <code>id
</code> property matches the value of the
<code>data-stream-class-id
</code> property
7470 of an event record class fragment
 <em><strong>F
</strong></em> is considered the
7471 <em>parent
</em> of
 <em><strong>F
</strong></em>.
</p>
7473 <table class=
"tableblock frame-all grid-all fit-content">
7474 <caption class=
"title">Table
36. Properties of an event record class fragment
 <em><strong>F
</strong></em> having the data stream class
 <em><strong>P
</strong></em> as its parent.
</caption>
7484 <th class=
"tableblock halign-left valign-top">Name
</th>
7485 <th class=
"tableblock halign-left valign-top">Type
</th>
7486 <th class=
"tableblock halign-left valign-top">Description
</th>
7487 <th class=
"tableblock halign-left valign-top">Required?
</th>
7488 <th class=
"tableblock halign-left valign-top">Default
</th>
7493 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>type
</code></p></td>
7494 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
7495 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7496 <p>Type of
 <em><strong>F
</strong></em>.
</p>
7498 <div class=
"paragraph">
7499 <p>The value of this property
<em>MUST
</em> be
<code>"event-record-class"</code>.
</p>
7501 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Yes
</p></td>
7502 <td class=
"tableblock halign-left valign-top"></td>
7505 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>id
</code></p></td>
7506 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
7507 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7508 <p>Numeric ID of
 <em><strong>F
</strong></em> within
 <em><strong>P
</strong></em>.
</p>
7510 <div class=
"paragraph">
7511 <p>The value of this property
<em>MUST
</em> be greater than or equal to zero.
</p>
7513 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
7514 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>0</code></p></td>
7517 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>data-stream-class-id
</code></p></td>
7518 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON integer
</p></td>
7519 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7520 <p>Numeric ID of
 <em><strong>P
</strong></em>.
</p>
7522 <div class=
"paragraph">
7523 <p>The value of this property
<em>MUST
</em> be greater than or equal to zero.
</p>
7525 <div class=
"paragraph">
7526 <p>Within the metadata stream,
 <em><strong>P
</strong></em> <em>MUST
</em> occur
7527 before
 <em><strong>F
</strong></em>.
</p>
7529 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
7530 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>0</code></p></td>
7533 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>name
</code></p></td>
7534 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
7535 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7536 <p>Name of
 <em><strong>F
</strong></em>.
</p>
7538 <div class=
"paragraph">
7539 <p>The purpose of this property, combined with the
<code>namespace
</code> property, is
7540 to uniquely identify an event record class amongst many
7541 <a href=
"#producer-def">producers
</a>.
</p>
7543 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
7544 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>F
</strong></em> is unnamed
</p></td>
7547 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>namespace
</code></p></td>
7548 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">JSON string
</p></td>
7549 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7550 <p><a href=
"#ns-def">Namespace
</a> of
 <em><strong>F
</strong></em>.
</p>
7552 <div class=
"paragraph">
7553 <p>The purpose of this property, combined with the
<code>name
</code> property, is to
7554 uniquely identify an event record class amongst many
7555 <a href=
"#producer-def">producers
</a>.
</p>
7557 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
7558 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>F
</strong></em> has no namespace
</p></td>
7561 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>specific-context-field-class
</code></p></td>
7562 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#struct-fc">Structure field class
</a></p></td>
7563 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7564 <p>Class of the
<a href=
"#er-spec-ctx">event record specific context field
</a>
7565 of an instance of
 <em><strong>F
</strong></em>.
</p>
7567 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
7568 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>F
</strong></em> has no event record specific context field class
</p></td>
7571 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>payload-field-class
</code></p></td>
7572 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#struct-fc">Structure field class
</a></p></td>
7573 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7574 <p>Class of the
<a href=
"#er-payload">event record payload field
</a> of an
7575 instance of
 <em><strong>F
</strong></em>.
</p>
7577 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
7578 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>F
</strong></em> has no event record payload field class
</p></td>
7581 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>user-attributes
</code></p></td>
7582 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#user-attrs">User attributes
</a></p></td>
7583 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7584 <p>User attributes of
 <em><strong>F
</strong></em>.
</p>
7586 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
7587 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
7590 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>extensions
</code></p></td>
7591 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><a href=
"#ext">Extensions
</a></p></td>
7592 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
7593 <p>Extensions of
 <em><strong>F
</strong></em>.
</p>
7595 <div class=
"paragraph">
7596 <p>Any extension which exists under this property
<em>MUST
</em> also be declared
7597 in the
<a href=
"#preamble-frag">preamble fragment
</a> of the metadata stream.
</p>
7599 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">No
</p></td>
7600 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><code>{}
</code></p></td>
7604 <div class=
"paragraph">
7605 <p>Within a metadata stream, two given event record class fragments
7606 <em>MUST
 NOT
</em> share the same
<code>id
</code> property value
<em>and
</em> the same
7607 <code>data-stream-class-id
</code> property value.
</p>
7613 <h2 id=
"ds-dec">6. Data stream decoding procedure
</h2>
7614 <div class=
"sectionbody">
7615 <div class=
"paragraph">
7616 <p>This section shows how to, procedurally,
<em>decode
</em> a CTF
 2 <a href=
"#ds">data
7619 <div class=
"paragraph">
7620 <p>Decoding a data stream is the responsibility of a
7621 <a href=
"#consumer-def">consumer
</a>.
</p>
7623 <div class=
"paragraph">
7624 <p>This document doesn
’t specify how to encode a data stream, as this
7625 procedure implies much more freedom than decoding. One can deduce how to
7626 encode a data stream from the decoding procedure.
</p>
7628 <div class=
"paragraph">
7629 <p>A consumer needs to keep a
<em>data stream decoding state
</em> while decoding a
7630 data stream. A data stream decoding state comprises the following
7631 <em>variable
</em>:
</p>
7633 <table class=
"tableblock frame-all grid-all fit-content">
7634 <caption class=
"title">Table
37. Variable needed to decode a data stream
 <em><strong>S
</strong></em>.
</caption>
7643 <th class=
"tableblock halign-left valign-top">Name
</th>
7644 <th class=
"tableblock halign-left valign-top">Type
</th>
7645 <th class=
"tableblock halign-left valign-top">Description
</th>
7646 <th class=
"tableblock halign-left valign-top">Initial value
</th>
7651 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>O
</strong></em></p></td>
7652 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Unsigned integer
</p></td>
7653 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Current decoding offset/position (bits) from the beginning
7654 of
 <em><strong>S
</strong></em>.
</p></td>
7655 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">0</p></td>
7659 <div class=
"paragraph">
7660 <p>To decode a data stream
<em><strong>S
</strong></em>:
</p>
7665 <p>While there
’s remaining data in
<em><strong>S
</strong></em>:
</p>
7669 <p><a href=
"#pkt-dec">Decode one packet
</a>.
</p>
7677 <h3 id=
"pkt-dec">6.1. Packet decoding procedure
</h3>
7678 <div class=
"paragraph">
7679 <p>A
<a href=
"#consumer-def">consumer
</a> needs to keep a
<em>packet decoding state
</em>
7680 while decoding a
<a href=
"#pkt">packet
</a>. A packet decoding state comprises the
7681 following
<em>variables
</em>:
</p>
7683 <table class=
"tableblock frame-all grid-all fit-content">
7684 <caption class=
"title">Table
38. Variables needed to decode a packet
 <em><strong>P
</strong></em> within a data stream
 <em><strong>S
</strong></em>.
</caption>
7693 <th class=
"tableblock halign-left valign-top">Name
</th>
7694 <th class=
"tableblock halign-left valign-top">Type
</th>
7695 <th class=
"tableblock halign-left valign-top">Description
</th>
7696 <th class=
"tableblock halign-left valign-top">Initial value
</th>
7701 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>DEF_CLK_VAL
</strong></em></p></td>
7702 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Unsigned integer
</p></td>
7703 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Current value (clock cycles) of the
<a href=
"#def-clk">default
7704 clock
</a> of
 <em><strong>S
</strong></em>, if any.
</p></td>
7705 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">0</p></td>
7708 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>DSC_ID
</strong></em></p></td>
7709 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Unsigned integer
</p></td>
7710 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Current ID of the
<a href=
"#dsc-frag">class
</a> of
 <em><strong>S
</strong></em>.
</p></td>
7711 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">0</p></td>
7714 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>DSC
</strong></em></p></td>
7715 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Optional
<a href=
"#dsc-frag">data stream class
</a></p></td>
7716 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Current class of
 <em><strong>S
</strong></em>.
</p></td>
7717 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">None
</p></td>
7720 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>DS_ID
</strong></em></p></td>
7721 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Optional unsigned integer
</p></td>
7722 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Current ID of
 <em><strong>S
</strong></em>.
</p></td>
7723 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">None
</p></td>
7726 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>PKT_TOTAL_SZ
</strong></em></p></td>
7727 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Unsigned integer
</p></td>
7728 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Current total size (bits) of
 <em><strong>P
</strong></em>.
</p></td>
7729 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">∞
</p></td>
7732 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>PKT_CONTENT_SZ
</strong></em></p></td>
7733 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Unsigned integer
</p></td>
7734 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Current content size (bits) of
 <em><strong>P
</strong></em>.
</p></td>
7735 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">∞
</p></td>
7738 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>LAST_BO
</strong></em></p></td>
7739 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Optional string
</p></td>
7740 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Byte order of the last
<a href=
"#fl-ba-field-dec">decoded fixed-length bit array field
</a>.
</p></td>
7741 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">None
</p></td>
7745 <div class=
"paragraph">
7746 <p>To decode a packet
<em><strong>P
</strong></em> within a data stream
<em><strong>S
</strong></em>:
</p>
7748 <div class=
"olist arabic">
7751 <p>Let
<em><strong>PO
</strong></em> be the current value of
<em><strong>O
</strong></em>.
</p>
7752 <div class=
"paragraph">
7753 <p>While decoding the packet,
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em> is the current decoding
7754 offset/position (bits) from the beginning of
 <em><strong>P
</strong></em>.
</p>
7758 <p>If the
<code>packet-header-field-class
</code> property of the
<a href=
"#tc-frag">trace
7759 class fragment
</a> of the metadata stream exists, then
7760 <a href=
"#struct-field-dec">decode
</a> the
<a href=
"#pkt-header">header field
</a>
7761 of
 <em><strong>P
</strong></em> using this property.
</p>
7762 <div class=
"paragraph">
7763 <p>During the packet header field decoding procedure, after having decoded
7764 a field
 <em><strong>F
</strong></em> having the class
 <em><strong>C
</strong></em> with a
<code>roles
</code>
7770 <p>If
<em><strong>C
</strong></em> has the role
<code>packet-magic-number
</code>, then validate that the
7771 unsigned integer value of
 <em><strong>F
</strong></em> is
0xc1fc1fc1 (
3254525889).
</p>
7772 <div class=
"paragraph">
7773 <p>A
<a href=
"#consumer-def">consumer
</a> <em>SHOULD
</em> report an invalid packet magic
7774 number as an error.
</p>
7778 <p>If
<em><strong>C
</strong></em> has the role
<code>trace-type-uuid
</code>, then validate that the
7779 value of
 <em><strong>F
</strong></em> matches the
<code>uuid
</code> property of the trace
7781 <div class=
"paragraph">
7782 <p>A consumer
<em>SHOULD
</em> report a trace type UUID mismatch as an error.
</p>
7786 <p>If
<em><strong>C
</strong></em> has the role
<code>data-stream-class-id
</code>, then
7787 set
 <em><strong>DSC_ID
</strong></em> to the unsigned integer value
7788 of
 <em><strong>F
</strong></em>.
</p>
7791 <p>If
<em><strong>C
</strong></em> has the role
<code>data-stream-id
</code>, then
7792 set
 <em><strong>DS_ID
</strong></em> to the unsigned integer value
7793 of
 <em><strong>F
</strong></em>.
</p>
7797 <div class=
"paragraph">
7798 <p>After having decoded the whole packet header field,
7799 if
 <em><strong>DS_ID
</strong></em> is set, then it
’s the ID of
 <em><strong>S
</strong></em> within
7800 its
<a href=
"#dsc-frag">class
</a>. In other words, two data streams
<em>MAY
</em> have the
7801 same ID if they are instances of different data stream classes.
</p>
7805 <p>Set
<em><strong>DSC
</strong></em> to the
<a href=
"#dsc-frag">data stream class
</a>
7806 having
 <em><strong>DSC_ID
</strong></em> as the value of its
<code>id
</code> property.
</p>
7807 <div class=
"paragraph">
7808 <p>If no data stream class has the ID
 <em><strong>DSC_ID
</strong></em>, then report an
7809 error and abort the data stream decoding process.
</p>
7813 <p>If the
<code>packet-context-field-class
</code> property of
 <em><strong>DSC
</strong></em>
7814 exists, then
<a href=
"#struct-field-dec">decode
</a> the
<a href=
"#pkt-ctx">context field
</a>
7815 of
 <em><strong>P
</strong></em> using this property.
</p>
7816 <div class=
"paragraph">
7817 <p>During the packet context field decoding procedure, after having decoded
7818 a field
 <em><strong>F
</strong></em> having the class
 <em><strong>C
</strong></em> with a
<code>roles
</code>
7824 <p>If
<em><strong>C
</strong></em> has the role
<code>packet-total-size
</code>, then
7825 set
 <em><strong>PKT_TOTAL_SZ
</strong></em> to the unsigned integer value
7826 of
 <em><strong>F
</strong></em>.
</p>
7829 <p>If
<em><strong>C
</strong></em> has the role
<code>packet-content-size
</code>, then
7830 set
 <em><strong>PKT_CONTENT_SZ
</strong></em> to the unsigned integer value
7831 of
 <em><strong>F
</strong></em>.
</p>
7834 <p>If
<em><strong>C
</strong></em> has the role
<code>packet-beginning-default-clock-timestamp
</code>,
7835 then set
 <em><strong>DEF_CLK_VAL
</strong></em> to the unsigned integer value
7836 of
 <em><strong>F
</strong></em>.
</p>
7839 <p>If
<em><strong>C
</strong></em> has the role
<code>packet-end-default-clock-timestamp
</code>, then
7840 the unsigned integer value of
 <em><strong>F
</strong></em> is the value of the
7841 <a href=
"#def-clk">default clock
</a> of
 <em><strong>S
</strong></em> at the end of
 <em><strong>P
</strong></em>.
</p>
7844 <p>If
<em><strong>C
</strong></em> has the role
<code>discarded-event-record-counter-snapshot
</code>,
7845 then the unsigned integer value of
 <em><strong>F
</strong></em> is a snapshot of the
7846 <a href=
"#disc-er-counter">discarded event record counter
</a> of
 <em><strong>S
</strong></em> at
7847 the end of
 <em><strong>P
</strong></em>.
</p>
7850 <p>If
<em><strong>C
</strong></em> has the role
<code>packet-sequence-number
</code>, then the unsigned
7851 integer value of
 <em><strong>F
</strong></em> is the sequence number of
 <em><strong>P
</strong></em>
7852 within
 <em><strong>S
</strong></em>.
</p>
7856 <div class=
"paragraph">
7857 <p>A
<a href=
"#consumer-def">consumer
</a> <em>SHOULD
</em> report a beginning default clock
7858 timestamp greater than an end default clock timestamp as an error.
</p>
7862 <p>If
<em><strong>PKT_TOTAL_SZ
</strong></em> is
 âˆž and
<em><strong>PKT_CONTENT_SZ
</strong></em> is
7863 <em>not
</em> âˆž, then set
 <em><strong>PKT_TOTAL_SZ
</strong></em>
7864 to
 <em><strong>PKT_CONTENT_SZ
</strong></em>.
</p>
7867 <p>If
<em><strong>PKT_CONTENT_SZ
</strong></em> is
 âˆž and
<em><strong>PKT_TOTAL_SZ
</strong></em> is
7868 <em>not
</em> âˆž, then set
 <em><strong>PKT_CONTENT_SZ
</strong></em>
7869 to
 <em><strong>PKT_TOTAL_SZ
</strong></em>.
</p>
7872 <p>While
<em><strong>O
</strong></em> < <em><strong>PO
</strong></em> +
 <em><strong>PKT_CONTENT_SZ
</strong></em>
7873 and there
’s remaining data in
 <em><strong>S
</strong></em>:
</p>
7877 <p><a href=
"#er-dec">Decode an event record
</a>.
</p>
7883 <p>If
<em><strong>PKT_TOTAL_SZ
</strong></em> and
 <em><strong>PKT_CONTENT_SZ
</strong></em> both are
7884 <em>not
</em> âˆž, then set
 <em><strong>O
</strong></em> to
7885 <em><strong>PO
</strong></em> +
 <em><strong>PKT_TOTAL_SZ
</strong></em>, effectively
7886 skipping end-of-packet padding.
</p>
7892 <h3 id=
"er-dec">6.2. Event record decoding procedure
</h3>
7893 <div class=
"paragraph">
7894 <p>A
<a href=
"#consumer-def">consumer
</a> needs to keep an
<em>event record decoding
7895 state
</em> while decoding an
<a href=
"#er">event record
</a>. An event record decoding
7896 state comprises the following
<em>variables
</em>:
</p>
7898 <table class=
"tableblock frame-all grid-all fit-content">
7899 <caption class=
"title">Table
39. Variables needed to decode an event record
 <em><strong>E
</strong></em> within a data stream
 <em><strong>S
</strong></em>.
</caption>
7908 <th class=
"tableblock halign-left valign-top">Name
</th>
7909 <th class=
"tableblock halign-left valign-top">Type
</th>
7910 <th class=
"tableblock halign-left valign-top">Description
</th>
7911 <th class=
"tableblock halign-left valign-top">Initial value
</th>
7916 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>ERC_ID
</strong></em></p></td>
7917 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Unsigned integer
</p></td>
7918 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Current ID of the
<a href=
"#erc-frag">class
</a> of
 <em><strong>E
</strong></em> of which the
7919 parent is the
<a href=
"#dsc-frag">class
</a> of
 <em><strong>S
</strong></em>.
</p></td>
7920 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">0</p></td>
7923 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock"><em><strong>ERC
</strong></em></p></td>
7924 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Optional
<a href=
"#erc-frag">event record class
</a></p></td>
7925 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">Current class of
 <em><strong>E
</strong></em>.
</p></td>
7926 <td class=
"tableblock halign-left valign-top"><p class=
"tableblock">None
</p></td>
7930 <div class=
"paragraph">
7931 <p>To decode an event record
<em><strong>E
</strong></em> within a data stream
<em><strong>S
</strong></em>:
</p>
7933 <div class=
"olist arabic">
7936 <p>If the
<code>event-record-header-field-class
</code> property of
 <em><strong>DSC
</strong></em>
7937 exists, then
<a href=
"#struct-field-dec">decode
</a> the
<a href=
"#er-header">header
7938 field
</a> of
 <em><strong>E
</strong></em> using this property.
</p>
7939 <div class=
"paragraph">
7940 <p>During the event record header field decoding procedure, after having
7941 decoded a field
 <em><strong>F
</strong></em> having the class
 <em><strong>C
</strong></em> with a
7942 <code>roles
</code> property:
</p>
7947 <p>If
<em><strong>C
</strong></em> has the role
<code>event-record-class-id
</code>, then
7948 set
 <em><strong>ERC_ID
</strong></em> to the unsigned integer value
7949 of
 <em><strong>F
</strong></em>.
</p>
7952 <p>If
<em><strong>C
</strong></em> has the role
<code>default-clock-timestamp
</code>, then
7953 <a href=
"#clk-val-update">update
 <em><strong>DEF_CLK_VAL
</strong></em></a> from
 <em><strong>F
</strong></em>.
</p>
7957 <div class=
"paragraph">
7958 <p>After having decoded the whole event record header field,
7959 <em><strong>DEF_CLK_VAL
</strong></em> is the value of the
<a href=
"#def-clk">default clock
</a>
7960 of
 <em><strong>S
</strong></em> when
 <em><strong>E
</strong></em> occurs.
</p>
7964 <p>Set
<em><strong>ERC
</strong></em> to the
<a href=
"#erc-frag">event record class
</a> having:
</p>
7968 <p><em><strong>DSC_ID
</strong></em> as the value of its
<code>data-stream-class-id
</code> property.
</p>
7971 <p><em><strong>ERC_ID
</strong></em> as the value of its
<code>id
</code> property.
</p>
7975 <div class=
"paragraph">
7976 <p>If no event record class has the ID
 <em><strong>ERC_ID
</strong></em> within a data
7977 stream class having the ID
 <em><strong>DSC_ID
</strong></em>, then report an error and
7978 abort the data stream decoding process.
</p>
7982 <p>If the
<code>event-record-common-context-field-class
</code> property
7983 of
 <em><strong>DSC
</strong></em> exists, then
<a href=
"#struct-field-dec">decode
</a> the
7984 <a href=
"#er-common-ctx">common context field
</a> of
 <em><strong>E
</strong></em> using this
7988 <p>If the
<code>specific-context-field-class
</code> property of
 <em><strong>ERC
</strong></em>
7989 exists, then
<a href=
"#struct-field-dec">decode
</a> the
7990 <a href=
"#er-spec-ctx">specific context field
</a> of
 <em><strong>E
</strong></em>
7991 using this property.
</p>
7994 <p>If the
<code>payload-field-class
</code> property of
 <em><strong>ERC
</strong></em> exists, then
7995 <a href=
"#struct-field-dec">decode
</a> the
<a href=
"#er-payload">payload field
</a>
7996 of
 <em><strong>E
</strong></em> using this property.
</p>
8001 <h4 id=
"clk-val-update">6.2.1. Clock value update procedure
</h4>
8002 <div class=
"paragraph">
8003 <p>To update
<em><strong>DEF_CLK_VAL
</strong></em> from an unsigned integer
8004 field
 <em><strong>F
</strong></em> having the unsigned integer value
 <em><strong>V
</strong></em> and
8005 the
<a href=
"#fc">class
</a> <em><strong>C
</strong></em>:
</p>
8007 <div class=
"olist arabic">
8010 <p>Let
<em><strong>L
</strong></em> be an unsigned integer initialized to,
8011 depending on the
<code>type
</code> property of
 <em><strong>C
</strong></em>:
</p>
8012 <div class=
"openblock">
8013 <div class=
"content">
8016 <dt class=
"hdlist1"><a href=
"#fl-int-fc"><code>"fixed-length-unsigned-integer"</code></a></dt>
8017 <dt class=
"hdlist1"><a href=
"#fl-enum-fc"><code>"fixed-length-unsigned-enumeration"</code></a></dt>
8019 <p>The value of the
<code>length
</code> property of
 <em><strong>C
</strong></em>.
</p>
8021 <dt class=
"hdlist1"><a href=
"#vl-int-fc"><code>"variable-length-unsigned-integer"</code></a></dt>
8022 <dt class=
"hdlist1"><a href=
"#vl-enum-fc"><code>"variable-length-unsigned-enumeration"</code></a></dt>
8024 <p><em><strong>S
</strong></em> Ã—
7, where
 <em><strong>S
</strong></em> is the number of
8025 <a href=
"#byte-def">bytes
</a> which
 <em><strong>F
</strong></em> occupies
8026 with the
<a href=
"#ds">data stream
</a>.
</p>
8034 <p>Let
<em><strong>MASK
</strong></em> be an unsigned integer initialized to
8035 2<sup><em><strong>L
</strong></em></sup> âˆ’
 1.
</p>
8038 <p>Let
<em><strong>H
</strong></em> be an unsigned integer initialized to
8039 <em><strong>DEF_CLK_VAL
</strong></em> & ~
<em><strong>MASK
</strong></em>,
8040 where
“&” is the bitwise
<em>AND
</em> operator and
8041 “~
” is the bitwise
<em>NOT
</em> operator.
</p>
8044 <p>Let
<em><strong>CUR
</strong></em> be an unsigned integer initialized to
8045 <em><strong>DEF_CLK_VAL
</strong></em> & <em><strong>MASK
</strong></em>, where
“&” is the
8046 bitwise
<em>AND
</em> operator.
</p>
8049 <p>Set
<em><strong>DEF_CLK_VAL
</strong></em> to:
</p>
8050 <div class=
"openblock">
8051 <div class=
"content">
8054 <dt class=
"hdlist1">If
<em><strong>V
</strong></em> â‰¥
 <em><strong>CUR
</strong></em></dt>
8056 <p><em><strong>H
</strong></em> +
 <em><strong>V
</strong></em></p>
8058 <dt class=
"hdlist1">Else
</dt>
8060 <p><em><strong>H
</strong></em> +
 <em><strong>MASK
</strong></em> +
 1 +
 <em><strong>V
</strong></em></p>
8072 <h3 id=
"field-dec">6.3. Field decoding procedure
</h3>
8073 <div class=
"paragraph">
8074 <p>The
<a href=
"#fc">class
</a> of a field contains what
’s needed to decode it as a
8077 <div class=
"paragraph">
8078 <p>While a field is an actual
<a href=
"#seq-def">sequence
</a> of bits within a
8079 <a href=
"#ds">data stream
</a>, a value is its conceptual interpretation with
8080 attached semantics.
</p>
8082 <div class=
"paragraph">
8083 <p><a id=
"dec-val-type"></a> The types of values are:
</p>
8085 <table class=
"tableblock frame-all grid-all fit-content">
8092 <th class=
"tableblock halign-left valign-top">Value type
</th>
8093 <th class=
"tableblock halign-left valign-top">Possible values
</th>
8098 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8101 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8106 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8109 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8110 <p><em>True
</em> or
<em>false
</em>.
</p>
8114 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8115 <p>Unsigned/signed integer
</p>
8117 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8118 <p>Integral quantity.
</p>
8122 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8125 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8126 <p>Continuous quantity.
</p>
8130 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8133 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8134 <p><a href=
"#seq-def">Sequence
</a> of
<a href=
"https://home.unicode.org/">Unicode
</a> characters.
</p>
8138 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8141 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8142 <p>Sequence of values.
</p>
8146 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8149 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8150 <p>Sequence of named values (members).
</p>
8155 <div class=
"paragraph">
8156 <p>To decode an instance of a field class
 <em><strong>F
</strong></em>, depending on the
8157 value of its
<code>type
</code> property:
</p>
8159 <table class=
"tableblock frame-all grid-all fit-content">
8166 <th class=
"tableblock halign-left valign-top">Value of the
<code>type
</code> property of
 <em><strong>F
</strong></em></th>
8167 <th class=
"tableblock halign-left valign-top">Decoding procedure of
<em><strong>F
</strong></em></th>
8172 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8173 <p><a href=
"#fl-ba-fc"><code>"fixed-length-bit-array"</code></a></p>
8175 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8176 <p><a href=
"#fl-ba-field-dec">Decode a fixed-length bit array field
</a>.
</p>
8180 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8181 <p><a href=
"#fl-bool-fc"><code>"fixed-length-boolean"</code></a></p>
8183 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8184 <p><a href=
"#fl-bool-field-dec">Decode a fixed-length boolean field
</a>.
</p>
8188 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"ulist">
8191 <p><a href=
"#fl-int-fc"><code>"fixed-length-unsigned-integer"</code></a></p>
8194 <p><a href=
"#fl-enum-fc"><code>"fixed-length-unsigned-enumeration"</code></a></p>
8198 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8199 <p><a href=
"#fl-uint-field-dec">Decode a fixed-length unsigned integer field
</a>.
</p>
8203 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"ulist">
8206 <p><a href=
"#fl-int-fc"><code>"fixed-length-signed-integer"</code></a></p>
8209 <p><a href=
"#fl-enum-fc"><code>"fixed-length-signed-enumeration"</code></a></p>
8213 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8214 <p><a href=
"#fl-sint-field-dec">Decode a fixed-length signed integer field
</a>.
</p>
8218 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8219 <p><a href=
"#fl-fp-fc"><code>"fixed-length-floating-point-number"</code></a></p>
8221 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8222 <p><a href=
"#fl-fp-field-dec">Decode a fixed-length floating point number field
</a>.
</p>
8226 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8227 <p><a href=
"#vl-ba-fc"><code>"variable-length-bit-array"</code></a></p>
8229 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8230 <p><a href=
"#vl-ba-field-dec">Decode a variable-length bit array field
</a>.
</p>
8234 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"ulist">
8237 <p><a href=
"#vl-int-fc"><code>"variable-length-unsigned-integer"</code></a></p>
8240 <p><a href=
"#vl-enum-fc"><code>"variable-length-unsigned-enumeration"</code></a></p>
8244 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8245 <p><a href=
"#vl-uint-field-dec">Decode a variable-length unsigned integer field
</a>.
</p>
8249 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"ulist">
8252 <p><a href=
"#vl-int-fc"><code>"variable-length-signed-integer"</code></a></p>
8255 <p><a href=
"#vl-enum-fc"><code>"variable-length-signed-enumeration"</code></a></p>
8259 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8260 <p><a href=
"#vl-sint-field-dec">Decode a variable-length signed integer
</a>.
</p>
8264 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8265 <p><a href=
"#str-fc"><code>"null-terminated-string"</code></a></p>
8267 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8268 <p><a href=
"#str-field-dec">Decode a null-terminated string field
</a>.
</p>
8272 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8273 <p><a href=
"#sl-str-fc"><code>"static-length-string"</code></a></p>
8275 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8276 <p><a href=
"#sl-str-field-dec">Decode a static-length string field
</a>.
</p>
8280 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8281 <p><a href=
"#sl-blob-fc"><code>"static-length-blob"</code></a></p>
8283 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8284 <p><a href=
"#sl-blob-field-dec">Decode a static-length BLOB field
</a>.
</p>
8288 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8289 <p><a href=
"#dl-str-fc"><code>"dynamic-length-string"</code></a></p>
8291 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8292 <p><a href=
"#dl-str-field-dec">Decode a dynamic-length string field
</a>.
</p>
8296 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8297 <p><a href=
"#dl-blob-fc"><code>"dynamic-length-blob"</code></a></p>
8299 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8300 <p><a href=
"#dl-blob-field-dec">Decode a dynamic-length BLOB field
</a>.
</p>
8304 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8305 <p><a href=
"#struct-fc"><code>"structure"</code></a></p>
8307 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8308 <p><a href=
"#struct-field-dec">Decode a structure field
</a>.
</p>
8312 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8313 <p><a href=
"#sl-array-fc"><code>"static-length-array"</code></a></p>
8315 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8316 <p><a href=
"#sl-array-field-dec">Decode a static-length array field
</a>.
</p>
8320 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8321 <p><a href=
"#dl-array-fc"><code>"dynamic-length-array"</code></a></p>
8323 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8324 <p><a href=
"#dl-array-field-dec">Decode a dynamic-length array field
</a>.
</p>
8328 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8329 <p><a href=
"#opt-fc"><code>"optional"</code></a></p>
8331 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8332 <p><a href=
"#opt-field-dec">Decode an optional field
</a>.
</p>
8336 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8337 <p><a href=
"#var-fc"><code>"variant"</code></a></p>
8339 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8340 <p><a href=
"#var-field-dec">Decode a variant field
</a>.
</p>
8346 <h4 id=
"align-dec">6.3.1. Alignment procedure
</h4>
8347 <div class=
"paragraph">
8348 <p>The decoding procedure of many fields require
8349 <em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em> to have a specific
<em>alignment
</em>.
</p>
8351 <div class=
"paragraph">
8352 <p>The alignment
<em>requirement
</em> of an instance of a
<a href=
"#fc">field
8353 class
</a> <em><strong>F
</strong></em> is, depending on the value of its
<code>type
</code> property:
</p>
8355 <table class=
"tableblock frame-all grid-all stretch">
8357 <col style=
"width: 50%;">
8358 <col style=
"width: 50%;">
8362 <th class=
"tableblock halign-left valign-top"><code>type
</code> property of
<em><strong>F
</strong></em></th>
8363 <th class=
"tableblock halign-left valign-top">Alignment requirement of
<em><strong>F
</strong></em></th>
8368 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"ulist">
8371 <p><a href=
"#fl-ba-fc"><code>"fixed-length-bit-array"</code></a></p>
8374 <p><a href=
"#fl-bool-fc"><code>"fixed-length-boolean"</code></a></p>
8377 <p><a href=
"#fl-int-fc"><code>"fixed-length-unsigned-integer"</code></a></p>
8380 <p><a href=
"#fl-int-fc"><code>"fixed-length-signed-integer"</code></a></p>
8383 <p><a href=
"#fl-enum-fc"><code>"fixed-length-unsigned-enumeration"</code></a></p>
8386 <p><a href=
"#fl-enum-fc"><code>"fixed-length-signed-enumeration"</code></a></p>
8389 <p><a href=
"#fl-fp-fc"><code>"fixed-length-floating-point-number"</code></a></p>
8393 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8394 <p>The value of the
<code>alignment
</code> property of
 <em><strong>F
</strong></em>.
</p>
8398 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"ulist">
8401 <p><a href=
"#vl-ba-fc"><code>"variable-length-bit-array"</code></a></p>
8404 <p><a href=
"#vl-int-fc"><code>"variable-length-unsigned-integer"</code></a></p>
8407 <p><a href=
"#vl-int-fc"><code>"variable-length-signed-integer"</code></a></p>
8410 <p><a href=
"#vl-enum-fc"><code>"variable-length-unsigned-enumeration"</code></a></p>
8413 <p><a href=
"#vl-enum-fc"><code>"variable-length-signed-enumeration"</code></a></p>
8416 <p><a href=
"#str-fc"><code>"null-terminated-string"</code></a></p>
8419 <p><a href=
"#sl-str-fc"><code>"static-length-string"</code></a></p>
8422 <p><a href=
"#sl-blob-fc"><code>"static-length-blob"</code></a></p>
8425 <p><a href=
"#dl-str-fc"><code>"dynamic-length-string"</code></a></p>
8428 <p><a href=
"#dl-blob-fc"><code>"dynamic-length-blob"</code></a></p>
8432 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8437 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8438 <p><a href=
"#struct-fc"><code>"structure"</code></a></p>
8440 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8441 <p>The
<em>maximum
</em> value of:
</p>
8446 <p>The value of the
<code>minimum-alignment
</code> property of
 <em><strong>F
</strong></em>.
</p>
8449 <p>The alignment requirements of the instances of the
<code>field-class
</code>
8450 property of each
<a href=
"#struct-member-cls">member class
</a> of the
8451 <code>member-classes
</code> property of
 <em><strong>F
</strong></em>.
</p>
8457 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"ulist">
8460 <p><a href=
"#sl-array-fc"><code>"static-length-array"</code></a></p>
8463 <p><a href=
"#dl-array-fc"><code>"dynamic-length-array"</code></a></p>
8467 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8468 <p>The
<em>maximum
</em> value of:
</p>
8473 <p>The value of the
<code>minimum-alignment
</code> property of
 <em><strong>F
</strong></em>.
</p>
8476 <p>The alignment requirement of an instance of the
8477 <code>element-field-class
</code> property of
 <em><strong>F
</strong></em>.
</p>
8483 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"ulist">
8486 <p><a href=
"#opt-fc"><code>"optional"</code></a></p>
8489 <p><a href=
"#var-fc"><code>"variant"</code></a></p>
8493 <td class=
"tableblock halign-left valign-top"><div class=
"content"><div class=
"paragraph">
8499 <div class=
"paragraph">
8500 <p>To align
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em> to some alignment
8501 requirement
 <em><strong>A
</strong></em> (bits):
</p>
8506 <p>Set
<em><strong>O
</strong></em> to
8507 <em><strong>PO
</strong></em> +
 ((
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em> +
 <em><strong>A
</strong></em> âˆ’
 1)
 & âˆ’
<em><strong>A
</strong></em>),
8508 where
“&” is the bitwise
<em>AND
</em> operator.
</p>
8514 <h4 id=
"field-loc-dec">6.3.2. Field location procedure
</h4>
8515 <div class=
"paragraph">
8516 <p>To locate a previously decoded field using a
8517 <a href=
"#field-loc">field location
</a> <em><strong>FL
</strong></em>:
</p>
8519 <div class=
"olist arabic">
8522 <p>Let
<em><strong>V
</strong></em> be, depending on the first element of
 <em><strong>FL
</strong></em>:
</p>
8523 <div class=
"openblock">
8524 <div class=
"content">
8527 <dt class=
"hdlist1"><code>"packet-header"</code></dt>
8529 <p>The
<a href=
"#pkt-header">header
</a> structure of
 <em><strong>P
</strong></em>
8530 (
<a href=
"#pkt-dec">current packet
</a>).
</p>
8532 <dt class=
"hdlist1"><code>"packet-context"</code></dt>
8534 <p>The
<a href=
"#pkt-ctx">context
</a> structure of
 <em><strong>P
</strong></em>.
</p>
8536 <dt class=
"hdlist1"><code>"event-record-header"</code></dt>
8538 <p>The
<a href=
"#er-header">header
</a> structure of
 <em><strong>E
</strong></em>
8539 (
<a href=
"#er-dec">current event record
</a>).
</p>
8541 <dt class=
"hdlist1"><code>"event-record-common-context"</code></dt>
8543 <p>The
<a href=
"#er-common-ctx">common context
</a> structure of
 <em><strong>E
</strong></em>.
</p>
8545 <dt class=
"hdlist1"><code>"event-record-specific-context"</code></dt>
8547 <p>The
<a href=
"#er-spec-ctx">specific context
</a> structure of
 <em><strong>E
</strong></em>.
</p>
8549 <dt class=
"hdlist1"><code>"event-record-payload"</code></dt>
8551 <p>The
<a href=
"#er-payload">payload
</a> structure of
 <em><strong>E
</strong></em>.
</p>
8557 <div class=
"paragraph">
8558 <p>If the consumer cannot set
<em><strong>V
</strong></em> because there
’s no such structure or
8559 because it
’s not already decoded nor currently being decoded, then
8560 report an error and abort the data stream decoding process.
</p>
8564 <p>For each element
 <em><strong>FLE
</strong></em> of
 <em><strong>FL
</strong></em>, starting from
8565 the second element:
</p>
8566 <div class=
"olist loweralpha">
8567 <ol class=
"loweralpha" type=
"a">
8569 <p>Let
<em><strong>V
</strong></em> be the value of the member named
 <em><strong>FLE
</strong></em>
8570 within
 <em><strong>V
</strong></em>.
</p>
8571 <div class=
"paragraph">
8572 <p>If no member is named
 <em><strong>FLE
</strong></em> within
 <em><strong>V
</strong></em>, then
8573 report an error and abort the data stream decoding process.
</p>
8575 <div class=
"paragraph">
8576 <p>If the member named
 <em><strong>FLE
</strong></em> within
 <em><strong>V
</strong></em> is not already
8577 decoded nor currently being decoded, then report an error and abort
8578 the data stream decoding process.
</p>
8582 <p>Depending on the
<a href=
"#dec-val-type">type
</a> of
<em><strong>V
</strong></em>:
</p>
8583 <div class=
"openblock">
8584 <div class=
"content">
8587 <dt class=
"hdlist1">Boolean
</dt>
8588 <dt class=
"hdlist1">Signed integer
</dt>
8589 <dt class=
"hdlist1">Unsigned integer
</dt>
8591 <p>If
 <em><strong>FLE
</strong></em> is not the last element of
 <em><strong>FL
</strong></em>,
8592 then report an error and abort the data stream decoding process.
</p>
8594 <dt class=
"hdlist1">Structure
</dt>
8598 <dt class=
"hdlist1">Array
</dt>
8600 <p>While
<em><strong>V
</strong></em> is an array:
</p>
8604 <p>If
<em><strong>V
</strong></em> is not currently being decoded, then report an error and
8605 abort the data stream decoding process.
</p>
8606 <div class=
"paragraph">
8607 <p>Set
<em><strong>V
</strong></em> to the element of
<em><strong>V
</strong></em> currently being decoded.
</p>
8613 <dt class=
"hdlist1">Other
</dt>
8615 <p>Report an error and abort the data stream decoding process.
</p>
8627 <div class=
"paragraph">
8628 <p><em><strong>V
</strong></em> is the located field.
</p>
8630 <div class=
"exampleblock">
8631 <div class=
"title">Example
80.
<a href=
"#dl-array">Dynamic-length array
</a> field and its length field in the same root field.
</div>
8632 <div class=
"content">
8633 <div class=
"paragraph">
8634 <p>Assume the following JSON object is an event record payload
<a href=
"#struct-fc">structure field class
</a>.
</p>
8636 <div class=
"listingblock">
8637 <div class=
"content">
8638 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
8639 "type":
"structure",
8642 "name":
"corn",
<i class=
"conum" data-value=
"3"></i><b>(
3)
</b>
8644 "type":
"fixed-length-unsigned-integer",
8646 "byte-order":
"little-endian"
8652 "type":
"fixed-length-unsigned-integer",
8654 "byte-order":
"little-endian"
8660 "type":
"dynamic-length-array",
<i class=
"conum" data-value=
"1"></i><b>(
1)
</b>
8661 "length-field-location": [
"event-record-payload",
"corn"],
<i class=
"conum" data-value=
"2"></i><b>(
2)
</b>
8662 "element-field-class": {
8663 "type":
"null-terminated-string"
8671 <div class=
"colist arabic">
8674 <td><i class=
"conum" data-value=
"1"></i><b>1</b></td>
8675 <td><a href=
"#dl-array-fc">Dynamic-length array field class
</a>.
</td>
8678 <td><i class=
"conum" data-value=
"2"></i><b>2</b></td>
8679 <td>Length field location of the
<a href=
"#dl-array-fc">dynamic-length array field class
</a>.
</td>
8682 <td><i class=
"conum" data-value=
"3"></i><b>3</b></td>
8683 <td>Length member class.
</td>
8689 <div class=
"exampleblock">
8690 <div class=
"title">Example
81. Dynamic-length array field and its length field in the same root field, within the same array field element.
</div>
8691 <div class=
"content">
8692 <div class=
"paragraph">
8693 <p>Assume the following JSON object is an event record payload
<a href=
"#struct-fc">structure field class
</a>.
</p>
8695 <div class=
"paragraph">
8696 <p>Both the dynamic-length array field and its length field exist within the same
8697 element of the
<a href=
"#sl-array-fc">static-length array
</a> field named
<code>nature
</code>.
</p>
8699 <div class=
"listingblock">
8700 <div class=
"content">
8701 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
8702 "type":
"structure",
8707 "type":
"null-terminated-string"
8713 "type":
"static-length-array",
8715 "element-field-class": {
8716 "type":
"structure",
8719 "name":
"laser",
<i class=
"conum" data-value=
"3"></i><b>(
3)
</b>
8721 "type":
"variable-length-unsigned-integer"
8727 "type":
"dynamic-length-array",
<i class=
"conum" data-value=
"1"></i><b>(
1)
</b>
8728 "length-field-location": [
<i class=
"conum" data-value=
"2"></i><b>(
2)
</b>
8729 "event-record-payload",
8733 "element-field-class": {
8734 "type":
"null-terminated-string"
8746 <div class=
"colist arabic">
8749 <td><i class=
"conum" data-value=
"1"></i><b>1</b></td>
8750 <td><a href=
"#dl-array-fc">Dynamic-length array field class
</a>.
</td>
8753 <td><i class=
"conum" data-value=
"2"></i><b>2</b></td>
8754 <td>Length field location of the
<a href=
"#dl-array-fc">dynamic-length array field class
</a>.
</td>
8757 <td><i class=
"conum" data-value=
"3"></i><b>3</b></td>
8758 <td>Length member class.
</td>
8764 <div class=
"exampleblock">
8765 <div class=
"title">Example
82. Dynamic-length array and its length field in the same root field, within the same
<a href=
"#var-fc">variant
</a> field.
</div>
8766 <div class=
"content">
8767 <div class=
"paragraph">
8768 <p>Assume the following JSON object is an event record payload
<a href=
"#struct-fc">structure field class
</a>.
</p>
8770 <div class=
"paragraph">
8771 <p>Both the dynamic-length array field and its length field exist within the same
8772 option of the
<a href=
"#var-fc">variant
</a> field named
<code>clinic
</code>.
</p>
8774 <div class=
"paragraph">
8775 <p>Moreover, the selector field of the
<code>clinic
</code> variant field is the
8776 <code>lawyer
</code> field.
</p>
8778 <div class=
"listingblock">
8779 <div class=
"content">
8780 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
8781 "type":
"structure",
8784 "name":
"lawyer",
<i class=
"conum" data-value=
"5"></i><b>(
5)
</b>
8786 "type":
"fixed-length-signed-integer",
8788 "byte-order":
"little-endian"
8795 "selector-field-location": [
"event-record-payload",
"lawyer"],
<i class=
"conum" data-value=
"4"></i><b>(
4)
</b>
8798 "selector-field-ranges": [[
0,
0]],
8800 "type":
"null-terminated-string"
8804 "selector-field-ranges": [[
1,
4]],
8806 "type":
"structure",
8809 "name":
"lemon",
<i class=
"conum" data-value=
"3"></i><b>(
3)
</b>
8811 "type":
"fixed-length-unsigned-integer",
8813 "byte-order":
"big-endian"
8819 "type":
"dynamic-length-array",
<i class=
"conum" data-value=
"1"></i><b>(
1)
</b>
8820 "length-field-location": [
<i class=
"conum" data-value=
"2"></i><b>(
2)
</b>
8821 "event-record-payload",
8825 "element-field-class": {
8826 "type":
"null-terminated-string"
8834 "selector-field-ranges": [[
5,
5], [
7,
7]],
8836 "type":
"fixed-length-boolean",
8838 "byte-order":
"little-endian"
8848 <div class=
"colist arabic">
8851 <td><i class=
"conum" data-value=
"1"></i><b>1</b></td>
8852 <td><a href=
"#dl-array-fc">Dynamic-length array field class
</a>.
</td>
8855 <td><i class=
"conum" data-value=
"2"></i><b>2</b></td>
8856 <td>Length field location of the
<a href=
"#dl-array-fc">dynamic-length array field class
</a>.
</td>
8859 <td><i class=
"conum" data-value=
"3"></i><b>3</b></td>
8860 <td>Length member class.
</td>
8863 <td><i class=
"conum" data-value=
"4"></i><b>4</b></td>
8864 <td>Selector field location of the variant field class.
</td>
8867 <td><i class=
"conum" data-value=
"5"></i><b>5</b></td>
8868 <td>Selector member class.
</td>
8874 <div class=
"exampleblock">
8875 <div class=
"title">Example
83. Dynamic-length array and its length field in the same root field; length field is a variant field.
</div>
8876 <div class=
"content">
8877 <div class=
"paragraph">
8878 <p>Assume the following JSON object is an event record payload
<a href=
"#struct-fc">structure field class
</a>.
</p>
8880 <div class=
"paragraph">
8881 <p>The length field of the dynamic-length array field is a variant field: it can be
8882 an
8-bit, a
16-bit, or a
32-bit
<a href=
"#fl-int-fc">fixed-length integer
</a> field, depending
8883 on the selection of the variant field.
</p>
8885 <div class=
"paragraph">
8886 <p>Moreover, the selector field of the variant field is located in another
8887 root field (event record specific context).
</p>
8889 <div class=
"listingblock">
8890 <div class=
"content">
8891 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
8892 "type":
"structure",
8895 "name":
"glass",
<i class=
"conum" data-value=
"3"></i><b>(
3)
</b>
8898 "selector-field-location": [
"event-record-specific-context",
"sel"],
8901 "selector-field-ranges": [[
0,
0]],
8903 "type":
"fixed-length-unsigned-integer",
<i class=
"conum" data-value=
"4"></i><b>(
4)
</b>
8905 "byte-order":
"little-endian"
8909 "selector-field-ranges": [[
1,
1]],
8911 "type":
"fixed-length-unsigned-integer",
<i class=
"conum" data-value=
"4"></i><b>(
4)
</b>
8913 "byte-order":
"little-endian"
8917 "selector-field-ranges": [[
2,
2]],
8919 "type":
"fixed-length-unsigned-integer",
<i class=
"conum" data-value=
"4"></i><b>(
4)
</b>
8921 "byte-order":
"little-endian"
8930 "type":
"dynamic-length-array",
<i class=
"conum" data-value=
"1"></i><b>(
1)
</b>
8931 "length-field-location": [
"event-record-payload",
"glass"],
<i class=
"conum" data-value=
"2"></i><b>(
2)
</b>
8932 "element-field-class": {
8933 "type":
"null-terminated-string"
8941 <div class=
"colist arabic">
8944 <td><i class=
"conum" data-value=
"1"></i><b>1</b></td>
8945 <td><a href=
"#dl-array-fc">Dynamic-length array field class
</a>.
</td>
8948 <td><i class=
"conum" data-value=
"2"></i><b>2</b></td>
8949 <td>Length field location of the
<a href=
"#dl-array-fc">dynamic-length array field class
</a>.
</td>
8952 <td><i class=
"conum" data-value=
"3"></i><b>3</b></td>
8953 <td>Length member class.
</td>
8956 <td><i class=
"conum" data-value=
"4"></i><b>4</b></td>
8957 <td>Possible length field class.
</td>
8963 <div class=
"exampleblock">
8964 <div class=
"title">Example
84. Dynamic-length array and its length field in the same root field; structure field containing length field is a variant field.
</div>
8965 <div class=
"content">
8966 <div class=
"paragraph">
8967 <p>Assume the following JSON object is an event record payload
<a href=
"#struct-fc">structure field class
</a>.
</p>
8969 <div class=
"paragraph">
8970 <p>The length field of the dynamic-length array field is within a structure field
8971 which is a variant field.
</p>
8973 <div class=
"paragraph">
8979 <p>The selector field of the variant field is located in another root
8980 field (event record common context).
</p>
8983 <p>The field class of the third option of the
<code>glass
</code> variant field class
8984 contains a
<a href=
"#dl-blob-fc">dynamic-length BLOB field class
</a> (
<code>lock
</code> member); the
8985 length field of its instance is the previous member (
<code>eagle
</code>) within
8986 the same structure field.
</p>
8990 <div class=
"listingblock">
8991 <div class=
"content">
8992 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
8993 "type":
"structure",
8999 "selector-field-location": [
"event-record-common-context",
"sel"],
9002 "selector-field-ranges": [[
0,
0]],
9004 "type":
"structure",
9009 "type":
"fixed-length-unsigned-integer",
<i class=
"conum" data-value=
"3"></i><b>(
3)
</b>
9011 "byte-order":
"little-endian"
9017 "type":
"null-terminated-string"
9024 "selector-field-ranges": [[
32,
172]],
9026 "type":
"structure",
9031 "type":
"null-terminated-string"
9037 "type":
"fixed-length-unsigned-integer",
<i class=
"conum" data-value=
"3"></i><b>(
3)
</b>
9039 "byte-order":
"big-endian"
9046 "selector-field-ranges": [[
5,
5]],
9048 "type":
"structure",
9051 "name":
"eagle",
<i class=
"conum" data-value=
"5"></i><b>(
5)
</b>
9053 "type":
"variable-length-unsigned-integer" <i class=
"conum" data-value=
"3"></i><b>(
3)
</b>
9059 "type":
"dynamic-length-blob",
9060 "length-field-location": [
<i class=
"conum" data-value=
"4"></i><b>(
4)
</b>
9061 "event-record-payload",
9076 "type":
"dynamic-length-array",
<i class=
"conum" data-value=
"1"></i><b>(
1)
</b>
9077 "length-field-location": [
<i class=
"conum" data-value=
"2"></i><b>(
2)
</b>
9078 "event-record-payload",
9082 "element-field-class": {
9083 "type":
"null-terminated-string"
9091 <div class=
"colist arabic">
9094 <td><i class=
"conum" data-value=
"1"></i><b>1</b></td>
9095 <td><a href=
"#dl-array-fc">Dynamic-length array field class
</a>.
</td>
9098 <td><i class=
"conum" data-value=
"2"></i><b>2</b></td>
9099 <td>Length field location of the
<a href=
"#dl-array-fc">dynamic-length array field class
</a>.
</td>
9102 <td><i class=
"conum" data-value=
"3"></i><b>3</b></td>
9103 <td>Possible length field class.
</td>
9106 <td><i class=
"conum" data-value=
"4"></i><b>4</b></td>
9107 <td>Length field location of the
<a href=
"#dl-blob-fc">dynamic-length BLOB field class
</a>.
</td>
9110 <td><i class=
"conum" data-value=
"5"></i><b>5</b></td>
9111 <td>Length field class for the
<a href=
"#dl-blob-fc">dynamic-length BLOB field class
</a>.
</td>
9115 <div class=
"paragraph">
9116 <p>Note that both the dynamic-length array and dynamic-length BLOB field classes have the same
9117 length field location.
</p>
9121 <div class=
"exampleblock">
9122 <div class=
"title">Example
85. Dynamic-length array and its length field in another root field.
</div>
9123 <div class=
"content">
9124 <div class=
"paragraph">
9125 <p>Assume the following JSON objects are the event record specific context
9126 and payload
<a href=
"#struct-fc">structure field classes
</a> of the same
9127 <a href=
"#erc-frag">event record class
</a>.
</p>
9129 <div class=
"paragraph">
9130 <p>The length field of the dynamic-length array field of the event record payload is
9131 within the event record specific context.
</p>
9133 <div class=
"listingblock">
9134 <div class=
"title">Event record specific context field class.
</div>
9135 <div class=
"content">
9136 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
9137 "type":
"structure",
9142 "type":
"fixed-length-floating-point-number",
9144 "byte-order":
"little-endian"
9148 "name":
"vegetable",
<i class=
"conum" data-value=
"1"></i><b>(
1)
</b>
9150 "type":
"variable-length-unsigned-integer"
9157 <div class=
"colist arabic">
9160 <td><i class=
"conum" data-value=
"1"></i><b>1</b></td>
9161 <td>Length member class.
</td>
9165 <div class=
"listingblock">
9166 <div class=
"title">Event record payload field class.
</div>
9167 <div class=
"content">
9168 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
9169 "type":
"structure",
9174 "type":
"dynamic-length-array",
<i class=
"conum" data-value=
"1"></i><b>(
1)
</b>
9175 "length-field-location": [
<i class=
"conum" data-value=
"2"></i><b>(
2)
</b>
9176 "event-record-specific-context",
9179 "element-field-class": {
9180 "type":
"null-terminated-string"
9187 "type":
"null-terminated-string"
9194 <div class=
"colist arabic">
9197 <td><i class=
"conum" data-value=
"1"></i><b>1</b></td>
9198 <td><a href=
"#dl-array-fc">Dynamic-length array field class
</a>.
</td>
9201 <td><i class=
"conum" data-value=
"2"></i><b>2</b></td>
9202 <td>Length field location of the
<a href=
"#dl-array-fc">dynamic-length array field class
</a>.
</td>
9210 <h4 id=
"fl-ba-field-dec">6.3.3. Fixed-length bit array field decoding procedure
</h4>
9211 <div class=
"paragraph">
9212 <p>For this whole section about decoding an instance of a
9213 <a href=
"#fl-ba-fc">fixed-length bit array field class
</a> <em><strong>F
</strong></em>, let
<em><strong>BO
</strong></em> be the value of the
<code>byte-order
</code>
9214 property of
 <em><strong>F
</strong></em>.
</p>
9216 <div class=
"paragraph">
9217 <p><a id=
"fl-ba-field-dec-bit"></a> To read a single data stream bit from an
9218 instance of
 <em><strong>F
</strong></em>:
</p>
9220 <div class=
"olist arabic">
9227 <p><em><strong>BYTE_I
</strong></em> be (
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em>)
 /
 8 (integral
9228 division; remainder discarded).
</p>
9231 <p><em><strong>BIT_I
</strong></em> be:
</p>
9232 <div class=
"openblock">
9233 <div class=
"content">
9234 <div class=
"hdlist">
9237 <td class=
"hdlist1">
9238 <em><strong>BO
</strong></em> is
<code>"big-endian"</code>
9240 <td class=
"hdlist2">
9241 <p>7 âˆ’
 ((
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em>)
 mod
 8)
</p>
9245 <td class=
"hdlist1">
9246 <em><strong>BO
</strong></em> is
<code>"little-endian"</code>
9248 <td class=
"hdlist2">
9249 <p>(
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em>)
 mod
 8</p>
9261 <p>Depending on the value of the bit at the index
 <em><strong>BIT_I
</strong></em>,
9262 where
 0 is the index of the
9263 <a href=
"https://en.wikipedia.org/wiki/Bit_numbering#Least_significant_bit">least significant bit
</a>,
9264 within the byte at the index
 <em><strong>BYTE_I
</strong></em> from the beginning
9265 of
 <em><strong>P
</strong></em> (the current packet being decoded):
</p>
9266 <div class=
"openblock">
9267 <div class=
"content">
9268 <div class=
"hdlist">
9271 <td class=
"hdlist1">
9274 <td class=
"hdlist2">
9275 <p>The bit value is
<em>false
</em>.
</p>
9279 <td class=
"hdlist1">
9282 <td class=
"hdlist2">
9283 <p>The bit value is
<em>true
</em>.
</p>
9293 <div class=
"paragraph">
9294 <p>To decode an instance of
 <em><strong>F
</strong></em>:
</p>
9296 <div class=
"olist arabic">
9300 <div class=
"olist loweralpha">
9301 <ol class=
"loweralpha" type=
"a">
9303 <p><em><strong>L
</strong></em> be the value of the
<code>length
</code> property of
 <em><strong>F
</strong></em>.
</p>
9306 <p><em><strong>V
</strong></em> be an array of booleans of length
 <em><strong>L
</strong></em>.
</p>
9309 <p><em><strong>I
</strong></em> be an unsigned integer initialized to
 0.
</p>
9315 <p><a href=
"#align-dec">Align
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em></a> according
9316 to
 <em><strong>F
</strong></em>.
</p>
9319 <p><a id=
"fl-ba-field-dec-step-3"></a> If
9320 ((
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em>)
 mod
 8 â‰
 0) and
9321 <em><strong>LAST_BO
</strong></em> â‰
 <em><strong>BO
</strong></em>, then report an error
9322 and abort the data stream decoding process.
</p>
9325 <p>While
<em><strong>I
</strong></em> < <em><strong>L
</strong></em>:
</p>
9326 <div class=
"olist loweralpha">
9327 <ol class=
"loweralpha" type=
"a">
9329 <p>Let
<em><strong>VI
</strong></em> be an unsigned integer initialized to:
</p>
9330 <div class=
"hdlist">
9333 <td class=
"hdlist1">
9334 <em><strong>BO
</strong></em> is
<code>"big-endian"</code>
9336 <td class=
"hdlist2">
9341 <td class=
"hdlist1">
9342 <em><strong>BO
</strong></em> is
<code>"little-endian"</code>
9344 <td class=
"hdlist2">
9345 <p><em><strong>L
</strong></em> âˆ’
 <em><strong>I
</strong></em> âˆ’
 1</p>
9352 <p>Set the element at the index
 <em><strong>VI
</strong></em> of
 <em><strong>V
</strong></em>
9353 to the current
<a href=
"#fl-ba-field-dec-bit">single bit value
</a>.
</p>
9356 <p>Set
<em><strong>I
</strong></em> to
<em><strong>I
</strong></em> +
 1.
</p>
9359 <p>Set
<em><strong>O
</strong></em> to
<em><strong>O
</strong></em> +
 1.
</p>
9365 <p>Set
<em><strong>LAST_BO
</strong></em> to
 <em><strong>BO
</strong></em>.
</p>
9369 <div class=
"paragraph">
9370 <p><em><strong>V
</strong></em> is the decoded bit array value.
</p>
9372 <div class=
"paragraph">
9373 <p>To add to the decoding procedure above, note that the
“reading
9374 direction
” within a byte depends on
 <em><strong>BO
</strong></em>. Assuming
9375 <em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em> =
 0, the following diagrams show which
9376 bit is selected by
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em> within a
16-bit fixed-length bit array field
9377 depending on
 <em><strong>BO
</strong></em>:
</p>
9381 <dt class=
"hdlist1"><code>"big-endian"</code></dt>
9384 <div class=
"imageblock">
9385 <div class=
"content">
9386 <img src=
"CTF2-SPECRC-3.0-images/bit-array-decoding-be.svg" alt=
"bit array decoding be">
9390 <dt class=
"hdlist1"><code>"little-endian"</code></dt>
9393 <div class=
"imageblock">
9394 <div class=
"content">
9395 <img src=
"CTF2-SPECRC-3.0-images/bit-array-decoding-le.svg" alt=
"bit array decoding le">
9401 <div class=
"exampleblock">
9402 <div class=
"title">Example
86. Contiguous fixed-length bit array fields: big-endian versus little-endian.
</div>
9403 <div class=
"content">
9404 <div class=
"paragraph">
9405 <p>This example shows the binary layout of contiguous big-endian and
9406 little-endian fixed-length bit array fields.
</p>
9408 <div class=
"paragraph">
9409 <p>Assume that
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em> =
 16. All the fixed-length bit array
9410 fields of this example have an implicit
1-bit
<a href=
"#align-dec">aligment
9411 requirement
</a>.
</p>
9413 <div class=
"paragraph">
9414 <p>Considering the following
<a href=
"#struct-member-cls">member classes
</a> of some
9415 <a href=
"#struct-fc">structure field class
</a>:
</p>
9417 <div class=
"listingblock">
9418 <div class=
"content">
9419 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">[
9423 "type":
"fixed-length-bit-array",
9425 "byte-order":
"big-endian"
9431 "type":
"fixed-length-bit-array",
9433 "byte-order":
"big-endian"
9439 "type":
"fixed-length-bit-array",
9441 "byte-order":
"big-endian"
9447 "type":
"fixed-length-bit-array",
9449 "byte-order":
"big-endian"
9455 <div class=
"paragraph">
9456 <p>The binary layout is as such:
</p>
9458 <div class=
"imageblock">
9459 <div class=
"content">
9460 <img src=
"CTF2-SPECRC-3.0-images/bit-array-fields-be.svg" alt=
"bit array fields be">
9463 <div class=
"paragraph">
9464 <p>Considering the following member classes of some structure field class,
9465 the only difference with the previous sample being the values of the
9466 <code>byte-order
</code> property:
</p>
9468 <div class=
"listingblock">
9469 <div class=
"content">
9470 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">[
9474 "type":
"fixed-length-bit-array",
9476 "byte-order":
"little-endian"
9482 "type":
"fixed-length-bit-array",
9484 "byte-order":
"little-endian"
9490 "type":
"fixed-length-bit-array",
9492 "byte-order":
"little-endian"
9498 "type":
"fixed-length-bit-array",
9500 "byte-order":
"little-endian"
9506 <div class=
"paragraph">
9507 <p>The binary layout is as such:
</p>
9509 <div class=
"imageblock">
9510 <div class=
"content">
9511 <img src=
"CTF2-SPECRC-3.0-images/bit-array-fields-le.svg" alt=
"bit array fields le">
9516 <div class=
"exampleblock">
9517 <div class=
"title">Example
87. Padding between fixed-length bit array fields.
</div>
9518 <div class=
"content">
9519 <div class=
"paragraph">
9520 <p>This example shows how the
<a href=
"#align-dec">alignment requirement
</a> of a
9521 fixed-length bit array field can translate into padding bits to skip during the
9522 decoding process.
</p>
9524 <div class=
"paragraph">
9525 <p>Assume that
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em> =
 32.
</p>
9527 <div class=
"paragraph">
9528 <p>Considering the following
<a href=
"#struct-member-cls">member classes
</a> of some
9529 <a href=
"#struct-fc">structure field class
</a>:
</p>
9531 <div class=
"listingblock">
9532 <div class=
"content">
9533 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">[
9537 "type":
"fixed-length-bit-array",
9539 "byte-order":
"big-endian"
9545 "type":
"fixed-length-bit-array",
9547 "byte-order":
"big-endian",
9554 "type":
"fixed-length-bit-array",
9556 "byte-order":
"big-endian",
9563 <div class=
"paragraph">
9564 <p>The binary layout is as such:
</p>
9566 <div class=
"imageblock">
9567 <div class=
"content">
9568 <img src=
"CTF2-SPECRC-3.0-images/bit-array-fields-padding-be.svg" alt=
"bit array fields padding be">
9571 <div class=
"paragraph">
9572 <p>Considering the following member classes of some structure field class,
9573 the only difference with the previous sample being the values of the
9574 <code>byte-order
</code> property:
</p>
9576 <div class=
"listingblock">
9577 <div class=
"content">
9578 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">[
9582 "type":
"fixed-length-bit-array",
9584 "byte-order":
"little-endian"
9590 "type":
"fixed-length-bit-array",
9592 "byte-order":
"little-endian",
9599 "type":
"fixed-length-bit-array",
9601 "byte-order":
"little-endian",
9608 <div class=
"paragraph">
9609 <p>The binary layout is as such:
</p>
9611 <div class=
"imageblock">
9612 <div class=
"content">
9613 <img src=
"CTF2-SPECRC-3.0-images/bit-array-fields-padding-le.svg" alt=
"bit array fields padding le">
9618 <div class=
"exampleblock">
9619 <div class=
"title">Example
88. Contiguous fixed-length bit array fields with different byte orders.
</div>
9620 <div class=
"content">
9621 <div class=
"paragraph">
9622 <p><a href=
"#fl-ba-field-dec-step-3">Step
 3</a> of the decoding procedure above
9623 requires that a
<a href=
"#consumer-def">consumer
</a> stops the data stream decoding
9624 process if the byte order between two contiguous fixed-length bit array fields changes
9625 when
 <em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em> is not a mutliple of
 8.
</p>
9627 <div class=
"paragraph">
9628 <p>In other words, a given data stream
<a href=
"#byte-def">byte
</a> <em>MUST
 NOT
</em> contain
9629 bits of two fixed-length bit array fields having different byte orders.
</p>
9631 <div class=
"paragraph">
9632 <p>This example shows how contiguous fixed-length bit array fields may have different byte
9633 orders with correct
<a href=
"#align-dec">alignment
</a>.
</p>
9635 <div class=
"paragraph">
9636 <p>Assume that
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em> =
 16.
</p>
9638 <div class=
"paragraph">
9639 <p>Considering the following
<a href=
"#struct-member-cls">member classes
</a> of some
9640 <a href=
"#struct-fc">structure field class
</a>:
</p>
9642 <div class=
"listingblock">
9643 <div class=
"content">
9644 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">[
9648 "type":
"fixed-length-bit-array",
9650 "byte-order":
"big-endian"
9656 "type":
"fixed-length-bit-array",
9658 "byte-order":
"big-endian"
9664 "type":
"fixed-length-bit-array",
9666 "byte-order":
"little-endian"
9672 "type":
"fixed-length-bit-array",
9674 "byte-order":
"little-endian"
9680 "type":
"fixed-length-bit-array",
9682 "byte-order":
"big-endian",
9689 <div class=
"paragraph">
9690 <p>The binary layout is as such:
</p>
9692 <div class=
"imageblock">
9693 <div class=
"content">
9694 <img src=
"CTF2-SPECRC-3.0-images/bit-array-fields-be-le.svg" alt=
"bit array fields be le">
9701 <h4 id=
"fl-bool-field-dec">6.3.4. Fixed-length boolean field decoding procedure
</h4>
9702 <div class=
"paragraph">
9703 <p>To decode an instance of a
<a href=
"#fl-bool-fc">fixed-length boolean field class
</a>:
</p>
9705 <div class=
"olist arabic">
9708 <p>Let
<em><strong>VB
</strong></em> be a boolean.
</p>
9711 <p><a href=
"#fl-ba-field-dec">Decode the instance as a fixed-length bit array field
</a>.
</p>
9714 <p>If all the elements of
 <em><strong>V
</strong></em> are
<em>false
</em>, then set
 <em><strong>VB
</strong></em>
9715 to
<em>false
</em>.
</p>
9716 <div class=
"paragraph">
9717 <p>Else, set
<em><strong>VB
</strong></em> to
<em>true
</em>.
</p>
9722 <div class=
"paragraph">
9723 <p><em><strong>VB
</strong></em> is the decoded boolean value.
</p>
9727 <h4 id=
"fl-uint-field-dec">6.3.5. Fixed-length unsigned integer field decoding procedure
</h4>
9728 <div class=
"paragraph">
9729 <p>To decode an instance of a
<a href=
"#fl-int-fc">fixed-length unsigned integer field class
</a>:
</p>
9731 <div class=
"olist arabic">
9734 <p>Let
<em><strong>VI
</strong></em> be an unsigned integer.
</p>
9737 <p><a href=
"#fl-ba-field-dec">Decode the instance as a fixed-length bit array field
</a>.
</p>
9740 <p>Set
<em><strong>VI
</strong></em> as the unsigned integer interpretation
9741 of
 <em><strong>V
</strong></em>, where the first element of
 <em><strong>V
</strong></em> is the most
9742 significant bit.
</p>
9746 <div class=
"paragraph">
9747 <p><em><strong>VI
</strong></em> is the decoded unsigned integer value.
</p>
9751 <h4 id=
"fl-sint-field-dec">6.3.6. Fixed-length signed integer field decoding procedure
</h4>
9752 <div class=
"paragraph">
9753 <p>To decode an instance of a
<a href=
"#fl-int-fc">fixed-length signed integer field class
</a>:
</p>
9755 <div class=
"olist arabic">
9758 <p>Let
<em><strong>VI
</strong></em> be a signed integer.
</p>
9761 <p><a href=
"#fl-ba-field-dec">Decode the instance as a fixed-length bit array field
</a>.
</p>
9764 <p>Set
<em><strong>VI
</strong></em> as the signed integer interpretation, following the
9765 two
’s complement format, of
 <em><strong>V
</strong></em>, where the first element
9766 of
 <em><strong>V
</strong></em> is the most significant bit.
</p>
9770 <div class=
"paragraph">
9771 <p><em><strong>VI
</strong></em> is the decoded signed integer value.
</p>
9775 <h4 id=
"fl-fp-field-dec">6.3.7. Fixed-length floating point number field decoding procedure
</h4>
9776 <div class=
"paragraph">
9777 <p>To decode an instance of a
<a href=
"#fl-fp-fc">fixed-length floating point number field class
</a>:
</p>
9779 <div class=
"olist arabic">
9782 <p>Let
<em><strong>VR
</strong></em> be a real value.
</p>
9785 <p><a href=
"#fl-ba-field-dec">Decode the instance as a fixed-length bit array field
</a>.
</p>
9788 <p>Set
<em><strong>VR
</strong></em> to the real number interpretation, following the
9789 <a href=
"https://standards.ieee.org/standard/754-2008.html">IEEE
754-
2008</a> binary interchange format, of
 <em><strong>V
</strong></em>, where the first element of
 <em><strong>V
</strong></em> is
9790 the most significant bit.
</p>
9794 <div class=
"paragraph">
9795 <p><em><strong>VR
</strong></em> is the decoded real value.
</p>
9799 <h4 id=
"vl-ba-field-dec">6.3.8. Variable-length bit array field decoding procedure
</h4>
9800 <div class=
"paragraph">
9801 <p>To decode an instance of a
<a href=
"#vl-ba-fc">variable-length bit array field class
</a> <em><strong>F
</strong></em>:
</p>
9803 <div class=
"olist arabic">
9806 <p>Let
<em><strong>V
</strong></em> be an empty array of booleans.
</p>
9809 <p><a href=
"#align-dec">Align
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em></a> according
9810 to
 <em><strong>F
</strong></em>.
</p>
9813 <p>Read
<em><strong>N
</strong></em> bytes of data from
 <em><strong>S
</strong></em> at the
9814 offset
 <em><strong>O
</strong></em>, as many as needed following the unsigned
9815 <a href=
"https://en.wikipedia.org/wiki/LEB128">LEB128
</a> format, appending the
9816 decoded bits to
 <em><strong>V
</strong></em> as booleans from the most
9817 significant to the least significant.
</p>
9820 <p>Set
<em><strong>O
</strong></em> to
<em><strong>O
</strong></em> +
 <em><strong>N
</strong></em> Ã—
 8.
</p>
9824 <div class=
"paragraph">
9825 <p><em><strong>V
</strong></em> is the decoded value.
</p>
9827 <div class=
"exampleblock">
9828 <div class=
"title">Example
89.
3-byte variable-length bit array field decoding.
</div>
9829 <div class=
"content">
9830 <div class=
"paragraph">
9831 <p>Consider the following
<a href=
"#vl-ba-fc">variable-length bit array field class
</a> <em><strong>F
</strong></em>:
</p>
9833 <div class=
"listingblock">
9834 <div class=
"content">
9835 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
9836 "type":
"variable-length-bit-array"
9840 <div class=
"paragraph">
9841 <p>The following diagram shows the three bytes of an instance
9842 of
 <em><strong>F
</strong></em> and the resulting bit array value.
</p>
9844 <div class=
"imageblock">
9845 <div class=
"content">
9846 <img src=
"CTF2-SPECRC-3.0-images/vl-ba.svg" alt=
"vl ba">
9849 <div class=
"paragraph">
9850 <p>Note that the data bits of the last byte (in red) become the first
9851 elements of the resulting bit array value because LEB128 is a
9852 little-endian encoding.
</p>
9858 <h4 id=
"vl-uint-field-dec">6.3.9. Variable-length unsigned integer field decoding procedure
</h4>
9859 <div class=
"paragraph">
9860 <p>To decode an instance of a
<a href=
"#vl-int-fc">variable-length unsigned integer field class
</a>:
</p>
9862 <div class=
"olist arabic">
9865 <p>Let
<em><strong>VI
</strong></em> be an unsigned integer.
</p>
9868 <p><a href=
"#vl-ba-field-dec">Decode the instance as a variable-length bit array field
</a>.
</p>
9871 <p>Set
<em><strong>VI
</strong></em> as the unsigned integer interpretation of
 <em><strong>V
</strong></em>,
9872 where the first element of
 <em><strong>V
</strong></em> is the most significant bit.
</p>
9876 <div class=
"paragraph">
9877 <p><em><strong>VI
</strong></em> is the decoded unsigned integer value.
</p>
9881 <h4 id=
"vl-sint-field-dec">6.3.10. Variable-length signed integer field decoding procedure
</h4>
9882 <div class=
"paragraph">
9883 <p>To decode an instance of a
<a href=
"#vl-int-fc">variable-length signed integer field class
</a>:
</p>
9885 <div class=
"olist arabic">
9888 <p>Let
<em><strong>VI
</strong></em> be a signed integer.
</p>
9891 <p><a href=
"#vl-ba-field-dec">Decode the instance as a variable-length bit array field
</a>.
</p>
9894 <p>Set
<em><strong>VI
</strong></em> as the signed integer interpretation, following the
9895 two
’s complement format, of
 <em><strong>V
</strong></em>, where the first element
9896 of
 <em><strong>V
</strong></em> is the most significant bit.
</p>
9900 <div class=
"paragraph">
9901 <p><em><strong>VI
</strong></em> is the decoded signed integer value.
</p>
9905 <h4 id=
"str-field-dec">6.3.11. Null-terminated string field decoding procedure
</h4>
9906 <div class=
"paragraph">
9907 <p>To decode an instance of a
<a href=
"#str-fc">null-terminated string field class
</a> <em><strong>F
</strong></em>:
</p>
9909 <div class=
"olist arabic">
9916 <p><em><strong>B
</strong></em> be a byte.
</p>
9919 <p><em><strong>A
</strong></em> be an empty sequence of bytes.
</p>
9922 <p><em><strong>V
</strong></em> be a string.
</p>
9928 <p><a href=
"#align-dec">Align
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em></a> according
9929 to
 <em><strong>F
</strong></em>.
</p>
9932 <p>Read one byte of data from
 <em><strong>S
</strong></em> at the offset
 <em><strong>O
</strong></em>
9933 as
 <em><strong>B
</strong></em>.
</p>
9936 <p>Set
<em><strong>O
</strong></em> to
<em><strong>O
</strong></em> +
 8.
</p>
9939 <p>While
<em><strong>B
</strong></em> â‰
 0:
</p>
9940 <div class=
"olist loweralpha">
9941 <ol class=
"loweralpha" type=
"a">
9943 <p>Append
<em><strong>B
</strong></em> to
 <em><strong>A
</strong></em>.
</p>
9946 <p>Read one byte of data from
 <em><strong>S
</strong></em> at the
9947 offset
 <em><strong>O
</strong></em> as
 <em><strong>B
</strong></em>.
</p>
9950 <p>Set
<em><strong>O
</strong></em> to
<em><strong>O
</strong></em> +
 8.
</p>
9956 <p>Decode
<em><strong>A
</strong></em>, following UTF-
8, as
<em><strong>V
</strong></em>.
</p>
9960 <div class=
"paragraph">
9961 <p><em><strong>V
</strong></em> is the decoded string value.
</p>
9963 <div class=
"exampleblock">
9964 <div class=
"title">Example
90.
22-byte null-terminated string field decoding.
</div>
9965 <div class=
"content">
9966 <div class=
"paragraph">
9967 <p>Consider the following
<a href=
"#str-fc">null-terminated string field class
</a> <em><strong>F
</strong></em>:
</p>
9969 <div class=
"listingblock">
9970 <div class=
"content">
9971 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
9972 "type":
"null-terminated-string"
9976 <div class=
"paragraph">
9977 <p>The following diagram shows
<a href=
"#pkt">packet
</a> bytes including a
22-byte
9978 instance of
 <em><strong>F
</strong></em> (in blue) and its resulting string value.
</p>
9980 <div class=
"paragraph">
9981 <p>The offset of the null-terminated string field, from the beginning of the packet,
9982 is
0xfc23 bytes, which means
9983 <em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em> =
 516,
376.
</p>
9985 <div class=
"imageblock">
9986 <div class=
"content">
9987 <img src=
"CTF2-SPECRC-3.0-images/str.svg" alt=
"str">
9990 <div class=
"paragraph">
9991 <p>The field contains
21 UTF-
8 bytes and a null terminating byte.
</p>
9993 <div class=
"paragraph">
9994 <p>The resulting string value contains
19 Unicode characters.
</p>
9996 <div class=
"paragraph">
9997 <p>After the field is decoded,
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em> =
 516,
552.
</p>
10002 <div class=
"sect3">
10003 <h4 id=
"sl-str-field-dec">6.3.12. Static-length string field decoding procedure
</h4>
10004 <div class=
"paragraph">
10005 <p>To decode an instance of a
<a href=
"#sl-str-fc">static-length string field class
</a> <em><strong>F
</strong></em>:
</p>
10007 <div class=
"olist arabic">
10008 <ol class=
"arabic">
10011 <div class=
"ulist">
10014 <p><em><strong>L
</strong></em> be the
<code>length
</code> property of
 <em><strong>F
</strong></em>.
</p>
10017 <p><em><strong>I
</strong></em> be an unsigned integer initialized to
0.
</p>
10020 <p><em><strong>B
</strong></em> be a byte.
</p>
10023 <p><em><strong>R
</strong></em> be a boolean initialized to
<em>true
</em>.
</p>
10026 <p><em><strong>A
</strong></em> be an empty sequence of bytes.
</p>
10029 <p><em><strong>V
</strong></em> be a string.
</p>
10035 <p><a href=
"#align-dec">Align
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em></a> according
10036 to
 <em><strong>F
</strong></em>.
</p>
10039 <p>While
<em><strong>I
</strong></em> < <em><strong>L
</strong></em>:
</p>
10040 <div class=
"olist loweralpha">
10041 <ol class=
"loweralpha" type=
"a">
10043 <p>Read one byte of data from
 <em><strong>S
</strong></em> at the
10044 offset
 <em><strong>O
</strong></em> as
 <em><strong>B
</strong></em>.
</p>
10047 <p>If
<em><strong>B
</strong></em> =
 0, then set
<em><strong>R
</strong></em> to
<em>false
</em>.
</p>
10048 <div class=
"paragraph">
10049 <p>Else, if
<em><strong>R
</strong></em> is
<em>true
</em>, then append
 <em><strong>B
</strong></em>
10050 to
 <em><strong>A
</strong></em>.
</p>
10054 <p>Set
<em><strong>O
</strong></em> to
<em><strong>O
</strong></em> +
 8.
</p>
10057 <p>Set
<em><strong>I
</strong></em> to
<em><strong>I
</strong></em> +
 1.
</p>
10063 <p>Decode
<em><strong>A
</strong></em>, following UTF-
8, as
<em><strong>V
</strong></em>.
</p>
10067 <div class=
"paragraph">
10068 <p><em><strong>V
</strong></em> is the decoded string value.
</p>
10070 <div class=
"exampleblock">
10071 <div class=
"title">Example
91.
18-byte static-length string field decoding.
</div>
10072 <div class=
"content">
10073 <div class=
"paragraph">
10074 <p>Consider the following
<a href=
"#str-fc">null-terminated string field class
</a> <em><strong>F
</strong></em>:
</p>
10076 <div class=
"listingblock">
10077 <div class=
"content">
10078 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
10079 "type":
"static-length-string",
10084 <div class=
"paragraph">
10085 <p>The following diagram shows
<a href=
"#pkt">packet
</a> bytes including a
18-byte
10086 instance of
 <em><strong>F
</strong></em> (in green) and its resulting string value.
</p>
10088 <div class=
"paragraph">
10089 <p>The offset of the static-length string field, from the beginning of the packet, is
10090 0x8c46 bytes, which means
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em> =
 287,
280.
</p>
10092 <div class=
"imageblock">
10093 <div class=
"content">
10094 <img src=
"CTF2-SPECRC-3.0-images/sl-str.svg" alt=
"sl str">
10097 <div class=
"paragraph">
10098 <p>The field contains
14 UTF-
8 bytes, a null terminating byte,
10099 and three garbage data bytes to ignore.
</p>
10101 <div class=
"paragraph">
10102 <p>The resulting string value contains seven Unicode characters.
</p>
10104 <div class=
"paragraph">
10105 <p>After the field is decoded,
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em> =
 287,
424.
</p>
10110 <div class=
"sect3">
10111 <h4 id=
"sl-blob-field-dec">6.3.13. Static-length BLOB field decoding procedure
</h4>
10112 <div class=
"paragraph">
10113 <p>To decode an instance of a
<a href=
"#sl-blob-fc">static-length BLOB field class
</a> <em><strong>F
</strong></em>:
</p>
10115 <div class=
"olist arabic">
10116 <ol class=
"arabic">
10119 <div class=
"olist loweralpha">
10120 <ol class=
"loweralpha" type=
"a">
10122 <p><em><strong>L
</strong></em> be the
<code>length
</code> property of
 <em><strong>F
</strong></em>.
</p>
10125 <p><em><strong>V
</strong></em> be an array of bytes of length
 <em><strong>L
</strong></em>.
</p>
10131 <p><a href=
"#align-dec">Align
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em></a> according
10132 to
 <em><strong>F
</strong></em>.
</p>
10135 <p>Read
<em><strong>L
</strong></em> bytes of data from
 <em><strong>S
</strong></em> at the
10136 offset
 <em><strong>O
</strong></em> as
 <em><strong>V
</strong></em>.
</p>
10139 <p>Set
<em><strong>O
</strong></em> to
<em><strong>O
</strong></em> +
 <em><strong>L
</strong></em> Ã—
 8.
</p>
10143 <div class=
"paragraph">
10144 <p><em><strong>V
</strong></em> is the decoded BLOB value.
</p>
10147 <div class=
"sect3">
10148 <h4 id=
"dl-str-field-dec">6.3.14. Dynamic-length string field decoding procedure
</h4>
10149 <div class=
"paragraph">
10150 <p>To decode an instance of a
<a href=
"#dl-str-fc">dynamic-length string field class
</a> <em><strong>F
</strong></em>:
</p>
10152 <div class=
"olist arabic">
10153 <ol class=
"arabic">
10156 <div class=
"ulist">
10159 <p><em><strong>L
</strong></em> be the value of the previously decoded unsigned integer
10160 field of which the
<code>length-field-location
</code> property of
 <em><strong>F
</strong></em>
10161 indicates the
<a href=
"#field-loc-dec">location
</a>.
</p>
10164 <p><em><strong>I
</strong></em> be an unsigned integer initialized to
0.
</p>
10167 <p><em><strong>B
</strong></em> be a byte.
</p>
10170 <p><em><strong>R
</strong></em> be a boolean initialized to
<em>true
</em>.
</p>
10173 <p><em><strong>A
</strong></em> be an empty sequence of bytes.
</p>
10176 <p><em><strong>V
</strong></em> be a string.
</p>
10182 <p><a href=
"#align-dec">Align
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em></a> according
10183 to
 <em><strong>F
</strong></em>.
</p>
10186 <p>While
<em><strong>I
</strong></em> < <em><strong>L
</strong></em>:
</p>
10187 <div class=
"olist loweralpha">
10188 <ol class=
"loweralpha" type=
"a">
10190 <p>Read one byte of data from
 <em><strong>S
</strong></em> at the
10191 offset
 <em><strong>O
</strong></em> as
 <em><strong>B
</strong></em>.
</p>
10194 <p>If
<em><strong>B
</strong></em> =
 0, then set
<em><strong>R
</strong></em> to
<em>false
</em>.
</p>
10195 <div class=
"paragraph">
10196 <p>Else, if
<em><strong>R
</strong></em> is
<em>true
</em>, then append
 <em><strong>B
</strong></em>
10197 to
 <em><strong>A
</strong></em>.
</p>
10201 <p>Set
<em><strong>O
</strong></em> to
<em><strong>O
</strong></em> +
 8.
</p>
10204 <p>Set
<em><strong>I
</strong></em> to
<em><strong>I
</strong></em> +
 1.
</p>
10210 <p>Decode
<em><strong>A
</strong></em>, following UTF-
8, as
<em><strong>V
</strong></em>.
</p>
10214 <div class=
"paragraph">
10215 <p><em><strong>V
</strong></em> is the decoded string value.
</p>
10218 <div class=
"sect3">
10219 <h4 id=
"dl-blob-field-dec">6.3.15. Dynamic-length BLOB field decoding procedure
</h4>
10220 <div class=
"paragraph">
10221 <p>To decode an instance of a
<a href=
"#dl-blob-fc">dynamic-length BLOB field class
</a> <em><strong>F
</strong></em>:
</p>
10223 <div class=
"olist arabic">
10224 <ol class=
"arabic">
10227 <div class=
"olist loweralpha">
10228 <ol class=
"loweralpha" type=
"a">
10230 <p><em><strong>L
</strong></em> be the value of the previously decoded unsigned integer
10231 field of which the
<code>length-field-location
</code> property of
 <em><strong>F
</strong></em>
10232 indicates the
<a href=
"#field-loc-dec">location
</a>.
</p>
10235 <p><em><strong>V
</strong></em> be an array of bytes of length
 <em><strong>L
</strong></em>.
</p>
10241 <p><a href=
"#align-dec">Align
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em></a> according
10242 to
 <em><strong>F
</strong></em>.
</p>
10245 <p>Read
<em><strong>L
</strong></em> bytes of data from
 <em><strong>S
</strong></em> at the
10246 offset
 <em><strong>O
</strong></em> as
 <em><strong>V
</strong></em>.
</p>
10249 <p>Set
<em><strong>O
</strong></em> to
<em><strong>O
</strong></em> +
 <em><strong>L
</strong></em> Ã—
 8.
</p>
10253 <div class=
"paragraph">
10254 <p><em><strong>V
</strong></em> is the decoded BLOB value.
</p>
10257 <div class=
"sect3">
10258 <h4 id=
"struct-field-dec">6.3.16. Structure field decoding procedure
</h4>
10259 <div class=
"paragraph">
10260 <p>To decode an instance of a
<a href=
"#struct-fc">structure field class
</a> <em><strong>F
</strong></em>:
</p>
10262 <div class=
"olist arabic">
10263 <ol class=
"arabic">
10266 <div class=
"ulist">
10269 <p><em><strong>M
</strong></em> be the
<code>member-classes
</code> property of
 <em><strong>F
</strong></em>.
</p>
10272 <p><em><strong>V
</strong></em> be an empty structure.
</p>
10278 <p><a href=
"#align-dec">Align
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em></a> according
10279 to
 <em><strong>F
</strong></em>.
</p>
10282 <p>For each member class
 <em><strong>MC
</strong></em> of
 <em><strong>M
</strong></em>:
</p>
10283 <div class=
"olist loweralpha">
10284 <ol class=
"loweralpha" type=
"a">
10287 <div class=
"ulist">
10290 <p><em><strong>MF
</strong></em> be the
<code>field-class
</code> property of
 <em><strong>MC
</strong></em>.
</p>
10293 <p><em><strong>MN
</strong></em> be the
<code>name
</code> property of
 <em><strong>MC
</strong></em>.
</p>
10299 <p><a href=
"#field-dec">Decode
</a> one instance of
 <em><strong>MF
</strong></em>, appending the
10300 resulting value as a member of
 <em><strong>V
</strong></em> named
 <em><strong>MN
</strong></em>.
</p>
10307 <div class=
"paragraph">
10308 <p><em><strong>V
</strong></em> is the decoded value.
</p>
10311 <div class=
"sect3">
10312 <h4 id=
"sl-array-field-dec">6.3.17. Static-length array field decoding procedure
</h4>
10313 <div class=
"paragraph">
10314 <p>To decode an instance of a
<a href=
"#sl-array-fc">static-length array field class
</a> <em><strong>F
</strong></em>:
</p>
10316 <div class=
"olist arabic">
10317 <ol class=
"arabic">
10320 <div class=
"olist loweralpha">
10321 <ol class=
"loweralpha" type=
"a">
10323 <p><em><strong>L
</strong></em> be the
<code>length
</code> property of
 <em><strong>F
</strong></em>.
</p>
10326 <p><em><strong>EF
</strong></em> be the
<code>element-field-class
</code> property of
 <em><strong>F
</strong></em>.
</p>
10329 <p><em><strong>I
</strong></em> be an unsigned integer initialized to
0.
</p>
10332 <p><em><strong>V
</strong></em> be an array of values of length
 <em><strong>L
</strong></em>.
</p>
10338 <p><a href=
"#align-dec">Align
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em></a> according
10339 to
 <em><strong>F
</strong></em>.
</p>
10342 <p>While
<em><strong>I
</strong></em> < <em><strong>L
</strong></em>:
</p>
10343 <div class=
"olist loweralpha">
10344 <ol class=
"loweralpha" type=
"a">
10346 <p><a href=
"#field-dec">Decode
</a> one instance of
 <em><strong>EF
</strong></em>
10347 as element
 <em><strong>I
</strong></em> of
 <em><strong>V
</strong></em>.
</p>
10350 <p>Set
<em><strong>I
</strong></em> to
<em><strong>I
</strong></em> +
 1.
</p>
10357 <div class=
"paragraph">
10358 <p><em><strong>V
</strong></em> is the decoded value.
</p>
10361 <div class=
"sect3">
10362 <h4 id=
"dl-array-field-dec">6.3.18. Dynamic-length array field decoding procedure
</h4>
10363 <div class=
"paragraph">
10364 <p>To decode an instance of a
<a href=
"#dl-array-fc">dynamic-length array field class
</a> <em><strong>F
</strong></em>:
</p>
10366 <div class=
"olist arabic">
10367 <ol class=
"arabic">
10370 <div class=
"olist loweralpha">
10371 <ol class=
"loweralpha" type=
"a">
10373 <p><em><strong>L
</strong></em> be the value of the previously decoded unsigned integer field
10374 of which the
<code>length-field-location
</code> property of
 <em><strong>F
</strong></em>
10375 indicates the
<a href=
"#field-loc-dec">location
</a>.
</p>
10378 <p><em><strong>EF
</strong></em> be the
<code>element-field-class
</code> property of
 <em><strong>F
</strong></em>.
</p>
10381 <p><em><strong>I
</strong></em> be an unsigned integer initialized to
0.
</p>
10384 <p><em><strong>V
</strong></em> be an array of values of length
 <em><strong>L
</strong></em></p>
10390 <p><a href=
"#align-dec">Align
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em></a> according
10391 to
 <em><strong>F
</strong></em>.
</p>
10394 <p>While
<em><strong>I
</strong></em> < <em><strong>L
</strong></em>:
</p>
10395 <div class=
"olist loweralpha">
10396 <ol class=
"loweralpha" type=
"a">
10398 <p><a href=
"#field-dec">Decode
</a> one instance of
 <em><strong>EF
</strong></em>
10399 as element
 <em><strong>I
</strong></em> of
 <em><strong>V
</strong></em>.
</p>
10402 <p>Set
<em><strong>I
</strong></em> to
<em><strong>I
</strong></em> +
 1.
</p>
10409 <div class=
"paragraph">
10410 <p><em><strong>V
</strong></em> is the decoded value.
</p>
10412 <div class=
"exampleblock">
10413 <div class=
"title">Example
92.
5-element dynamic-length array field decoding.
</div>
10414 <div class=
"content">
10415 <div class=
"paragraph">
10416 <p>Consider the following
<a href=
"#er-payload">event record payload
</a>
10417 <a href=
"#struct-fc">structure field class
</a> <em><strong>F
</strong></em>:
</p>
10419 <div class=
"listingblock">
10420 <div class=
"content">
10421 <pre class=
"highlight"><code class=
"language-json" data-lang=
"json">{
10422 "type":
"structure",
10423 "member-classes": [
10427 "type":
"fixed-length-unsigned-integer",
10429 "byte-order":
"big-endian"
10435 "type":
"null-terminated-string"
10442 "type":
"dynamic-length-array",
10443 "length-field-location": [
"event-record-payload",
"len"],
10444 "element-field-class": {
10445 "type":
"fixed-length-unsigned-integer",
10447 "byte-order":
"little-endian",
10456 <div class=
"paragraph">
10457 <p>The following diagram shows
<a href=
"#pkt">packet
</a> bytes including an instance
10458 of
 <em><strong>F
</strong></em> (starting in green and ending in blue) and the resulting
10459 signed integer values of its
<code>vals
</code> member.
</p>
10461 <div class=
"paragraph">
10462 <p>The offset of the
<code>len
</code> fixed-length unsigned integer field, from the beginning of the packet, is
10463 0x42c1 bytes, which means
<em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em> =
 136,
712.
</p>
10465 <div class=
"paragraph">
10466 <p>The offset of the
<code>vals
</code> dynamic-length array field, from the beginning of the
10467 packet, is
0x42c8 bytes, which means
10468 <em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em> =
 136,
768.
</p>
10470 <div class=
"imageblock">
10471 <div class=
"content">
10472 <img src=
"CTF2-SPECRC-3.0-images/dl-array.svg" alt=
"dl array">
10475 <div class=
"paragraph">
10476 <p>The unsigned integer value of the
<code>len
</code> field is
 5, which means the
10477 <code>vals
</code> field contains five fixed-length signed integer fields.
</p>
10479 <div class=
"paragraph">
10480 <p>After the structure field is decoded,
10481 <em><strong>O
</strong></em> âˆ’
 <em><strong>PO
</strong></em> =
 136,
928.
</p>
10486 <div class=
"sect3">
10487 <h4 id=
"opt-field-dec">6.3.19. Optional field decoding procedure
</h4>
10488 <div class=
"paragraph">
10489 <p>To decode an instance of an
<a href=
"#opt-fc">optional field class
</a> <em><strong>F
</strong></em>:
</p>
10491 <div class=
"olist arabic">
10492 <ol class=
"arabic">
10495 <div class=
"ulist">
10498 <p><em><strong>SEL
</strong></em> be the value of the previously decoded
<a href=
"#bool-fc">boolean
</a>
10499 or
<a href=
"#int-fc">integer
</a> field of which the
<code>selector-field-location
</code>
10500 property of
 <em><strong>F
</strong></em> indicates the
<a href=
"#field-loc-dec">location
</a>.
</p>
10503 <p><em><strong>OF
</strong></em> be the
<code>field-class
</code> property of
<em><strong>F
</strong></em>.
</p>
10506 <p><em><strong>V
</strong></em> be a nil value.
</p>
10512 <p>If the class of
 <em><strong>SEL
</strong></em> is a
<a href=
"#fl-bool-fc">fixed-length boolean field class
</a>
10513 and
<em><strong>SEL
</strong></em> is
<em>true
</em>, then:
</p>
10514 <div class=
"ulist">
10517 <p><a href=
"#field-dec">Decode
</a> one instance of
 <em><strong>OF
</strong></em>
10518 as
 <em><strong>V
</strong></em>.
</p>
10522 <div class=
"paragraph">
10523 <p>Else, if
<em><strong>SEL
</strong></em> is an element of any
<a href=
"#int-range-set">integer range
</a>
10524 of the
<code>selector-field-ranges
</code> property of
 <em><strong>F
</strong></em>, then:
</p>
10526 <div class=
"ulist">
10529 <p><a href=
"#field-dec">Decode
</a> one instance of
 <em><strong>OF
</strong></em>
10530 as
 <em><strong>V
</strong></em>.
</p>
10537 <div class=
"paragraph">
10538 <p><em><strong>V
</strong></em> is the decoded value.
</p>
10541 <div class=
"sect3">
10542 <h4 id=
"var-field-dec">6.3.20. Variant field decoding procedure
</h4>
10543 <div class=
"paragraph">
10544 <p>To decode an instance of an
<a href=
"#var-fc">variant field class
</a> <em><strong>F
</strong></em>:
</p>
10546 <div class=
"olist arabic">
10547 <ol class=
"arabic">
10550 <div class=
"olist loweralpha">
10551 <ol class=
"loweralpha" type=
"a">
10553 <p><em><strong>SEL
</strong></em> be the value of the previously decoded
<a href=
"#int-fc">integer
</a>
10554 field of which the
<code>selector-field-location
</code> property of
 <em><strong>F
</strong></em>
10555 indicates the
<a href=
"#field-loc-dec">location
</a>.
</p>
10558 <p><em><strong>OPTS
</strong></em> be the
<code>options
</code> property of
 <em><strong>F
</strong></em>.
</p>
10561 <p><em><strong>OF
</strong></em> be the
<code>field-class
</code> property of the
<a href=
"#var-fc-opt">variant
10562 field class option
</a> <em><strong>OPT
</strong></em> of
 <em><strong>OPTS
</strong></em> of
10563 which
 <em><strong>SEL
</strong></em> is an element of any
<a href=
"#int-range-set">integer
10564 range
</a> of the
<code>selector-field-ranges
</code> property of
 <em><strong>OPT
</strong></em>.
</p>
10567 <p><em><strong>V
</strong></em> be a value.
</p>
10573 <p><a href=
"#field-dec">Decode
</a> one instance of
 <em><strong>OF
</strong></em>
10574 as
 <em><strong>V
</strong></em>.
</p>
10578 <div class=
"paragraph">
10579 <p><em><strong>V
</strong></em> is the decoded value.
</p>