ios-xe renderer - initial push
[groupbasedpolicy.git] / renderers / ios-xe / src / main / yang / netconf / tailf-common.yang
1 module tailf-common {
2   namespace "http://tail-f.com/yang/common";
3   prefix tailf;
4
5   include tailf-meta-extensions {
6     revision-date 2013-11-07;
7   }
8
9   include tailf-cli-extensions {
10     revision-date 2015-03-19;
11   }
12
13   organization "Tail-f Systems";
14
15   description
16     "This module defines all Tail-f YANG extensions statements
17     and common YANG types.";
18
19   revision 2015-05-22 {
20     description
21       "Released as part of ConfD-5.4.2 / NCS-3.4.2.
22
23        Allow tailf:export and tailf:unique-selector in
24          tailf:annotate-module.";
25   }
26
27   revision 2015-03-19 {
28     description
29       "Released as part of ConfD-5.4 / NCS-3.4.
30
31        Added if-feature as substatement to tailf:annotate.
32
33        Added tailf:no-dependency.
34
35        Updated the description for tailf:dependency.
36
37        Allow tailf:id-value as substatement to 'module',
38        tailf:annotate-module, 'choice', and 'case'.";
39   }
40
41   revision 2014-11-13 {
42     description
43       "Released as part of ConfD-5.3 / NCS-3.3.
44
45        Added tailf:export.";
46   }
47
48   revision 2014-06-30 {
49     description
50       "Released as part of ConfD-5.2 / NCS-3.2.
51
52        Added tailf:sha-256-digest-string and tailf:sha-512-digest-string.";
53   }
54
55   revision 2014-03-27 {
56     description
57       "Released as part of ConfD-5.1 / NCS-3.1.
58
59        Added tailf:actionpoint as substatement to refine.
60        Removed must as substatement to tailf:symlink.";
61   }
62
63   revision 2014-02-20 {
64     description
65       "Released as part of ConfD-5.0.2 / NCS-3.0.2.
66
67        Added tailf:snmp-ned-recreate-when-modified.";
68   }
69
70   revision 2013-12-23 {
71     description
72       "Released as part of ConfD-5.0.1 / NCS-3.0.1.
73
74        Allow 'unique' in tailf:annotate and tailf:annotate-statement.
75
76        Added tailf:snmp-ned-delete-before-create.";
77   }
78
79   revision 2013-11-07 {
80     description
81       "Released as part of ConfD-5.0 / NCS-3.0.
82
83        Allow tailf:code-name as substatement to 'bit'.
84
85        Disallow tailf:id-value as substatement to 'enum'. Use the
86        standard YANG 'value' statement instead.
87
88        Deprecated tailf:hex-list.  Use yang:hex-string instead.
89          There are no plans to remove tailf:hex-list.
90
91        Added the types tailf:ipv4-address-and-prefix-length,
92        tailf:ipv6-address-and-prefix-length, and
93        tailf:ip-address-and-prefix-length,";
94   }
95
96   revision 2013-09-05 {
97     description
98       "Released as part of ConfD-4.3.
99
100        Added tailf:auto-compact as substatement to tailf:indexed-view.";
101   }
102
103   revision 2013-06-14 {
104     description
105       "Released as part of ConfD-4.3.
106
107        Deprecated tailf:symlink.  Use tailf:link instead.
108
109        Allow tailf:alt-name as substatement to tailf:action and rpc.
110
111        Allow status as substatement to tailf:action.
112
113        Allow description in tailf:annotate and tailf:annotate-statement.";
114   }
115
116   revision 2013-05-16 {
117     description
118       "Released as part of ConfD-4.2.2.
119
120        Added tailf:link";
121   }
122
123   revision 2013-03-07 {
124     description
125       "Released as part of ConfD-4.2.
126
127        Allow 'pattern' in tailf:annotate-statement.";
128   }
129
130   revision 2012-11-08 {
131     description
132       "Released as part of ConfD-4.1.
133
134        Added tailf:unique-selector and tailf:unique-leaf.
135
136        Allow tailf:info in bit.
137
138        Allow tailf:code-name as substatement to all statements that
139        define data nodes in the schema tree and the 'rpc',
140        'notification', 'identity', and 'tailf:action' statements.
141
142        Allow status in tailf:symlink";
143   }
144
145   revision 2012-08-23 {
146     description
147       "Released as part of ConfD-4.0.1.
148
149        Allow tailf:cli-operational-mode and tailf:cli-configure-mode in
150          rpc.";
151   }
152
153   revision 2012-06-14 {
154     description
155       "Released as part of ConfD-4.0.
156
157        Added tailf:display-hint.";
158   }
159
160   revision 2012-05-24 {
161     description
162       "Released as part of ConfD-3.9.2.";
163   }
164
165   revision 2012-03-08 {
166     description
167       "Released as part of ConfD-3.9.
168
169       Added tailf:timeout.
170       Added tailf:non-strict-leafref.";
171   }
172
173   revision 2011-12-08 {
174     description
175       "Released as part of ConfD-3.8.
176
177       Allow validation statements in tailf:annotate and
178       tailf:annotate-statement.
179
180       Allow tailf:validate in must, in order to override the evaluation
181       of the must expression with a callback function.
182
183       Disallow tailf:info in range, length and pattern.
184
185       Added tailf:snmp-ned-* statements to control the SNMP NED
186       behavior in NCS.";
187   }
188
189   revision 2011-10-20 {
190     description
191       "Released as part of ConfD-3.7.1.
192
193       Added tailf:priority.";
194   }
195
196   revision 2011-09-22 {
197     description
198       "Released as part of ConfD-3.7.
199
200       Allow tailf:typepoint as substatement to leaf and leaf-list.
201       Allow tailf:id as substatement to tailf:annotate-module.
202       Allow tailf:sort-priority as substatement to tailf:symlink.
203       Added tailf:interruptibale.
204       Added tailf:error-info.
205       Added tailf:snmp-delete-value and tailf:snmp-send-delete-value.
206       Added tailf:step.
207       Added tailf:annotate-statement.
208
209       Clarified how tailf:display-when is evaluated for lists.";
210   }
211
212   revision 2011-08-25 {
213     description
214       "Released as part of ConfD-3.6.2.
215
216       Included latest tailf-cli-extension submodule.";
217   }
218
219   revision 2011-06-30 {
220     description
221       "Released as part of ConfD-3.6.1.
222
223       Clarified what statements are allowed in tailf:annotate and
224       tailf:annotate-module.  Specifically, that 'symlink' and 'action'
225       are not allowed.";
226   }
227
228   revision 2011-05-26 {
229     description
230       "Released as part of ConfD-3.6.
231
232       Allow multiple tailf:snmp-name on leafs that represent MIB scalars.";
233   }
234
235   revision 2011-03-31 {
236     description
237       "Released as part of ConfD-3.5.1.
238
239       Allow tailf:alt-name as substatement to tailf:symlink.";
240   }
241
242   revision 2011-02-24 {
243     description
244       "Released as part of ConfD-3.5.
245
246       Allow tailf:info as substatement to type.
247       Added tailf:writable.
248       Removed the deprecated tailf:cli-default-order statement.
249       Removed the deprecated tailf:instance-info-leafs statement.";
250   }
251
252   revision 2010-11-04 {
253     description
254       "Released as part of ConfD-3.4.
255
256       Added tailf:snmp-exclude-object.
257       Allow tailf:hidden as substatement to tailf:symlink.
258       Allow multiple tailf:hidden statements to be specified on a node.
259       Allow special value '*' ar argument to tailf:annotate.";
260   }
261
262
263   revision 2010-09-16 {
264     description
265       "Released as part of ConfD-3.3.2.
266
267       Included latest tailf-cli-extension submodule.";
268   }
269
270   revision 2010-08-19 {
271     description
272       "Released as part of ConfD-3.3.1.
273
274        Allow multiple tailf:snmp-name statements, and expanded the
275        semantic meaning of this statement.";
276   }
277
278   revision 2010-07-21 {
279     description
280       "Released as part of ConfD-3.3.0.3.
281
282        Added tailf:sort-priority.";
283   }
284
285   revision 2010-06-17 {
286     description
287       "Released as part of ConfD-3.3.
288
289       Added tailf:value-length.
290
291       Added tailf:info-html.
292
293       Added tailf:display-default-order, and deprecated
294       tailf:cli-default-order.
295
296       Added tailf:dependency as a substatement to when.
297
298       Removed the deprecated statements tailf:constant-leaf and
299       tailf:constant-value.";
300   }
301
302   revision 2010-04-22 {
303     description
304       "Released as part of ConfD-3.2.1.
305
306        Added tailf:invocation-mode,
307
308        Fixed bug in tailf:octet-list pattern.";
309   }
310
311   revision 2010-03-18 {
312     description
313       "Released as part of ConfD-3.2.
314
315       Split this module into the main module and two submodules,
316       tailf-meta-extensions, and tailf-cli-extensions.
317
318       Added many tailf:cli- statements in the submodule
319       tailf-cli-extensions.
320
321       Added tailf:info.
322
323       Allow tailf:display-when in tailf:action.
324
325       Added tailf:snmp-lax-type-check.
326
327       Deprecated tailf:instance-info-leafs.  Use
328       tailf:cli-instance-info-leafs instead.
329
330       Removed the argument in tailf:cli-show-no to better match
331       all the other tailf:cli- statements.";
332   }
333
334   revision 2010-01-28 {
335     description
336       "Released as part of ConfD-3.1.1.
337
338       Allow tailf:snmp-oid and tailf:snmp-name in tailf:symlink.
339
340       Added tailf:key-default.
341
342       Allow tailf:suppress-echo in leaf and leaf-list.";
343   }
344
345   revision 2009-12-17 {
346     description
347       "Released as part of ConfD-3.1.
348
349       Added tailf:dependency as a substatement to must.
350
351       Added must and tailf:display-when as children to tailf:symlink.
352
353       Added tailf:interrupt to tailf:exec.
354
355       Allow many tailf statement as substatements to 'refine'.
356
357       Allow tailf:symlink statement in 'augment' and 'case'.
358
359       Added tailf:internal to tailf:actionpoint.
360
361       Deprecated tailf:constant-leaf and tailf:constant-value.";
362   }
363
364   revision 2009-11-06 {
365     description
366       "Released as part of ConfD-3.0.1.
367
368        Added tailf:annotate-module statement.
369
370        Added tailf:code-name statement.
371
372        Clarified the tailf:path-filters statement, and added
373        tailf:no-subtree-match.";
374   }
375
376   revision 2009-10-01 {
377     description
378       "Released as part of ConfD-3.0.
379
380        Clarified that tailf:annotate is applied on the expanded tree.
381        Bugfixes in some typedef patterns.";
382   }
383
384   revision 2009-03-17 {
385     description
386       "Released as part of ConfD-2.8.
387
388       Changed module name from tailf-extensions to reflect the content
389       better.";
390   }
391
392   /*
393    * Common types, natively supported by ConfD.
394    */
395
396   typedef size {
397     type string {
398       pattern
399         "S(\d+G)?(\d+M)?(\d+K)?(\d+B)?";
400     }
401     description
402       "A value that represents a number of bytes.  An example could be
403        S1G8M7K956B; meaning 1GB + 8MB + 7KB + 956B = 1082138556 bytes.
404        The value must start with an S.  Any byte magnifier can be left
405        out, e.g. S1K1B equals 1025 bytes.  The order is significant
406        though, i.e. S1B56G is not a valid byte size.
407
408        In ConfD, a 'size' value is represented as an uint64.";
409   }
410
411   typedef octet-list {
412     type string {
413       pattern '(\d*(.\d*)*)?';
414     }
415     description
416       "A list of dot-separated octets e.g. '192.168.255.1.0'.
417
418       The statement tailf:value-length can be used to restrict the number
419       of octets.  Note that using the 'length' restriction limits the
420       number of characters in the lexical representation.";
421   }
422
423   typedef md5-digest-string {
424     type string;
425     description
426       "The md5-digest-string type automatically computes a MD5 digest for
427       a value adhering to this type.
428
429       This is best explained using an example.  Suppose we have a
430       leaf:
431
432           leaf key {
433               type tailf:md5-digest-string;
434           }
435
436       A valid configuration is:
437
438           <key>$0$In god we trust.</key>
439
440       The '$0$' prefix signals that this is plain text.  When a plain
441       text value is received by the server, an MD5 digest is
442       calculated, and the string '$1$<salt>$' is prepended to the
443       result, where <salt> is a random eight character salt used to
444       generate the digest.  This value is stored in the configuration
445       data store.
446
447       When a value of this type is read, the computed MD5 value is
448       always returned.  In the example above, the following value
449       could be returned:
450
451           <key>$1$fB$ndk2z/PIS0S1SvzWLqTJb.</key>
452
453       If a value starting with '$1$' is received, the server
454       knows that the value already represents an MD5 digest, and
455       stores it as is in the data store.
456
457       A value adhering to this type must have a '$0$' or a
458       '$1$<salt>$' prefix.
459
460       If a default value is specified, it must have a '$1$<salt>$' prefix.
461
462       The digest algorithm used is the same as the md5 crypt function
463       used for encrypting passwords for various UNIX systems, see e.g.
464       http://www.freebsd.org/cgi/cvsweb.cgi/~checkout/~/src/lib/libcrypt/crypt.c
465       ";
466     reference
467       "IEEE Std 1003.1-2008 - crypt() function
468        RFC 1321 - The MD5 Message-Digest Algorithm";
469   }
470
471   typedef sha-256-digest-string {
472     type string {
473       pattern
474         '$0$.*'
475       + '|$5$(rounds=\d+$)?[a-zA-Z0-9./]{1,16}$[a-zA-Z0-9./]{43}';
476     }
477     description
478       "The sha-256-digest-string type automatically computes a SHA-256
479       digest for a value adhering to this type.
480
481       A value of this type matches one of the forms:
482
483         $0$<clear text password>
484         $5$<salt>$<password hash>
485         $5$rounds=<number>$<salt>$<password hash>
486
487       The '$0$' prefix signals that this is plain text. When a plain
488       text value is received by the server, a SHA-256 digest is
489       calculated, and the string '$5$<salt>$' is prepended to the
490       result, where <salt> is a random 16 character salt used to
491       generate the digest.  This value is stored in the configuration
492       data store. The algorithm can be tuned via the
493       /confdConfig/cryptHash/rounds parameter, which if set to a number
494       other than the default will cause '$5$rounds=<number>$<salt>$' to
495       be prepended instead of only '$5$<salt>$'.
496
497       If a value starting with '$5$' is received, the server
498       knows that the value already represents a SHA-256 digest, and
499       stores it as is in the data store.
500
501       If a default value is specified, it must have a '$5$' prefix.
502
503       The digest algorithm used is the same as the SHA-256 crypt function
504       used for encrypting passwords for various UNIX systems, see e.g.
505       http://www.akkadia.org/drepper/SHA-crypt.txt";
506     reference
507       "IEEE Std 1003.1-2008 - crypt() function
508        FIPS.180-3.2008: Secure Hash Standard";
509   }
510
511   typedef sha-512-digest-string {
512     type string {
513       pattern
514         '$0$.*'
515       + '|$6$(rounds=\d+$)?[a-zA-Z0-9./]{1,16}$[a-zA-Z0-9./]{86}';
516     }
517
518     description
519       "The sha-512-digest-string type automatically computes a SHA-512
520       digest for a value adhering to this type.
521
522       A value of this type matches one of the forms:
523
524         $0$<clear text password>
525         $6$<salt>$<password hash>
526         $6$rounds=<number>$<salt>$<password hash>
527
528       The '$0$' prefix signals that this is plain text.  When a plain
529       text value is received by the server, a SHA-512 digest is
530       calculated, and the string '$6$<salt>$' is prepended to the
531       result, where <salt> is a random 16 character salt used to
532       generate the digest.  This value is stored in the configuration
533       data store. The algorithm can be tuned via the
534       /confdConfig/cryptHash/rounds parameter, which if set to a number
535       other than the default will cause '$6$rounds=<number>$<salt>$' to
536       be prepended instead of only '$6$<salt>$'.
537
538       If a value starting with '$6$' is received, the server
539       knows that the value already represents a SHA-512 digest, and
540       stores it as is in the data store.
541
542       If a default value is specified, it must have a '$6$' prefix.
543
544       The digest algorithm used is the same as the SHA-512 crypt function
545       used for encrypting passwords for various UNIX systems, see e.g.
546       http://www.akkadia.org/drepper/SHA-crypt.txt";
547     reference
548       "IEEE Std 1003.1-2008 - crypt() function
549        FIPS.180-3.2008: Secure Hash Standard";
550   }
551
552   typedef des3-cbc-encrypted-string {
553     type string;
554     description
555       "The des3-cbc-encrypted-string type automatically encrypts a value
556       adhering to this type using DES in CBC mode followed by a base64
557       conversion.  If the value isn't encrypted already, that is.
558
559       This is best explained using an example.  Suppose we have a leaf:
560
561           leaf enc {
562               type tailf:des3-cbc-encrypted-string;
563           }
564
565       A valid configuration is:
566
567           <enc>$0$In god we trust.</enc>
568
569       The '$0$' prefix signals that this is plain text.  When a plain
570       text value is received by the server, the value is DES3/Base64
571       encrypted, and the string '$3$' is prepended.  The resulting
572       string is stored in the configuration data store.
573
574       When a value of this type is read, the encrypted value is always
575       returned.  In the example above, the following value could be
576       returned:
577
578           <enc>$3$lyPjszaQq4EVqK7OPOxybQ==</enc>
579
580       If a value starting with '$3$' is received, the server knows
581       that the value is already encrypted, and stores it as is in the
582       data store.
583
584       A value adhering to this type must have a '$0$' or a '$3$' prefix.
585
586       ConfD uses a configurable set of encryption keys to encrypt the
587       string.  For details, see 'encryptedStrings' in the
588       confd.conf(5) manual page.";
589   }
590
591   typedef aes-cfb-128-encrypted-string {
592     type string;
593     description
594       "The aes-cfb-128-encrypted-string works exactly like
595       des3-cbc-encrypted-string but AES/128bits in CFB mode is used to
596       encrypt the string.  The prefix for encrypted values is '$4$'.";
597   }
598
599   typedef ipv4-address-and-prefix-length {
600     type string {
601       pattern
602          '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
603        +  '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
604        + '/(([0-9])|([1-2][0-9])|(3[0-2]))';
605     }
606     description
607       "The ipv4-address-and-prefix-length type represents a combination
608       of an IPv4 address and a prefix length. The prefix length is given
609       by the number following the slash character and must be less than
610       or equal to 32.";
611   }
612
613   typedef ipv6-address-and-prefix-length {
614     type string {
615       pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
616             + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
617             + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}'
618             + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))'
619             + '(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))';
620       pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
621             + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)'
622             + '(/.+)';
623     }
624     description
625       "The ipv6-address-and-prefix-length type represents a combination
626       of an IPv6 address and a prefix length. The prefix length is given
627       by the number following the slash character and must be less than
628       or equal to 128.";
629   }
630
631   typedef ip-address-and-prefix-length {
632     type union {
633       type tailf:ipv4-address-and-prefix-length;
634       type tailf:ipv6-address-and-prefix-length;
635     }
636     description
637       "The ip-address-and-prefix-length type represents a combination of
638       an IP address and a prefix length and is IP version neutral. The
639       format of the textual representations implies the IP version.";
640   }
641
642
643   /*
644    * Meta extensions
645    */
646
647   extension export {
648     argument agent {
649       tailf:arg-type {
650         type union {
651           type enumeration {
652             enum "none";
653             enum "netconf";
654             enum "rest";
655             enum "cli";
656             enum "snmp";
657             enum "webui";
658           }
659           type string;
660         }
661       }
662     }
663     tailf:use-in "module";
664     tailf:occurence "*";
665
666     description
667       "Makes this data model visible in the northbound interface 'agent'.
668
669        This statement makes it possible to have a data model visible
670        through some northbound interface but not others.  For example,
671        if a MIB is used to generate a YANG module, the resulting YANG
672        module can be exposed through SNMP only.
673
674        Use the special agent 'none' to make the data model completely
675        hidden to all notherbound interfaces.
676
677        The agent can also be a free-form string.  In this case, the data
678        model will be visible to maapi applications using this string as its
679        'context'.";
680   }
681
682   extension annotate {
683     argument target {
684       tailf:arg-type {
685         type string;
686       }
687     }
688     tailf:use-in "module";
689     tailf:use-in "submodule";
690     tailf:occurence "*";
691
692     tailf:substatement "tailf:annotate" {
693       tailf:occurence "*";
694     }
695     tailf:substatement "if-feature" {
696       tailf:occurence "*";
697     }
698     description
699       "Annotates an existing statement with a 'tailf' statement or a
700       validation statement.  This is useful in order to add tailf
701       statements to a module without touching the module source.
702       Annotation statements can be put in a separate annotation
703       module, and then passed to 'confdc' (or 'pyang') when the
704       original module is compiled.
705
706       Any 'tailf' statement, except 'symlink' and 'action' can be
707       annotated.  The statements 'symlink' and 'action' modifies the
708       data model, and are thus not allowed.
709
710       The validation statements 'must', 'min-elements',
711       'max-elements', 'mandatory', 'unique', and 'when' can also be
712       annotated.
713
714       A 'description' can also be annotated.
715
716       'tailf:annotate' can occur on the top-level in a module, or in
717       another 'tailf:annotate' statement.
718
719       The argument is a 'schema-nodeid', i.e. the same as for
720       'augment', or a '*'.  It identifies a target node in the schema
721       tree to annotate with new statements.  The special value '*' can
722       be used within another 'tailf:annotate' statetement, to select all
723       children for annotation.
724
725       The target node is searched for after 'uses' and 'augment'
726       expansion.  All substatements to 'tailf:annotate' are treated as
727       if they were written inline in the target node, with the
728       exception of any 'tailf:annotate' substatements.  These are
729       treated recursively.  For example, the following snippet adds
730       one callpoint to /x and one to /x/y:
731
732         tailf:annotate /x {
733           tailf:callpoint xcp;
734           tailf:annotate y {
735             tailf:callpoint ycp;
736           }
737         }
738       ";
739   }
740
741   extension annotate-module {
742     argument module-name {
743       tailf:arg-type {
744         type tailf:identifier;
745       }
746     }
747     tailf:use-in "module";
748     tailf:occurence "*";
749
750     tailf:substatement "tailf:snmp-oid";
751     tailf:substatement "tailf:snmp-mib-module-name";
752     tailf:substatement "tailf:id";
753     tailf:substatement "tailf:id-value";
754     tailf:substatement "tailf:export";
755     tailf:substatement "tailf:unique-selector";
756     tailf:substatement "tailf:annotate-statement" {
757       tailf:occurence "*";
758     }
759     description
760       "Annotates an existing module or submodule statement with a 'tailf'
761       statement.  This is useful in order to add tailf statements to a
762       module without touching the module source.  Annotation
763       statements can be put in a separate annotation module, and then
764       passed to 'confdc' (or 'pyang') when the original module is
765       compiled.
766
767       'tailf:annotate-module' can occur on the top-level in a module,
768       and is used to add 'tailf' statements to the module statement
769       itself.
770
771       The argument is a name of the module or submodule to annotate.";
772   }
773
774   extension annotate-statement {
775     argument statement-path {
776       tailf:arg-type {
777         type string;
778       }
779     }
780     tailf:use-in "tailf:annotate-module";
781     tailf:use-in "tailf:annotate-statement";
782     tailf:occurence "*";
783
784     tailf:substatement "tailf:annotate-statement" {
785       tailf:occurence "*";
786     }
787     description
788       "Annotates an existing statement with a 'tailf' statement, a
789       validation statement, or a type restrcition statement.  This is
790       useful in order to add tailf statements to a module without
791       touching the module source.  Annotation statements can be put in
792       a separate annotation module, and then passed to 'confdc' (or
793       'pyang') when the original module is compiled.
794
795       Any 'tailf' statement, except 'symlink' and 'action' can be
796       annotated.  The statements 'symlink' and 'action' modifies the
797       data model, and are thus not allowed.
798
799       The validation statements 'must', 'min-elements',
800       'max-elements', 'mandatory', 'unique', and 'when' can also be
801       annotated.
802
803       The type restriction statement 'pattern' can also be annotated.
804
805       A 'description' can also be annotated.
806
807       The argument is an XPath-like expression that selects a
808       statement to annotate.  The syntax is:
809
810          <statement-name> ( '[' <arg-name> '=' <arg-value> ']' )
811
812       where <statement-name> is the name of the statement to annotate,
813       and if there are more than one such statement in the parent,
814       <arg-value> is the quoted value of the statement's argument.
815
816       All substatements to 'tailf:annotate-statement' are treated as
817       if they were written inline in the target node, with the
818       exception of any 'tailf:annotate-statement' substatements.
819       These are treated recursively.
820
821       For example, given the grouping:
822
823         grouping foo {
824           leaf bar {
825             type string;
826           }
827           leaf baz {
828             type string;
829           }
830         }
831
832       the following snippet adds a callpoint to the leaf 'baz':
833
834         tailf:annotate-statement grouping[name='foo'] {
835           tailf:annotate-statement leaf[name='baz'] {
836             tailf:callpoint xcp;
837           }
838         }
839       ";
840   }
841
842   /*
843    * Type restriction statements
844    */
845
846   extension value-length {
847     argument value {
848       tailf:arg-type {
849         type string;
850       }
851     }
852     tailf:use-in "type";
853     tailf:substatement "error-message";
854     tailf:substatement "error-app-tag";
855     description
856       "Used only for the types:
857          yang:object-identifier
858          yang:object-identifier-128
859          yang:phys-address
860          yang:hex-string
861          tailf:hex-list
862          tailf:octet-list
863          xs:hexBinary
864
865       This type restriction is used to limit the length of the
866       value-space value of the type.  Note that since all these types are
867       derived from 'string', the standard 'length' statement restricts the
868       lexical representation of the value.
869
870       The argument is a length expression string, with the same syntax as
871       for the standard YANG 'length' statement.";
872   }
873
874   extension path-filters {
875     argument value {
876       tailf:arg-type {
877         type string;
878       }
879     }
880     tailf:use-in "type";
881     tailf:substatement "tailf:no-subtree-match";
882     description
883       "Used for type 'instance-identifier' only.
884
885       The argument is a space separated list of absolute or relative XPath
886       expressions.
887
888       This statement declares that the instance-identifier value must match
889       one of the specified paths, according to the following rules:
890
891         1.  each XPath expression is evaluated, and returns a node set.
892
893         2.  if there is no 'tailf:no-subtree-match' statement, the
894             instance-identifier matches if it refers to a node in this
895             node set, or if it refers to any descendant node of this
896             node set.
897
898         3.  if there is a 'tailf:no-subtree-match' statement, the
899             instance-identifier matches if it refers to a node in this
900             node set.
901
902        For example:
903
904          The value /a/b[key='k1']/c matches the XPath expression
905          /a/b[key='k1']/c.
906
907          The value /a/b[key='k1']/c matches the XPath expression /a/b/c.
908
909          The value /a/b[key='k1']/c matches the XPath expression /a/b, if
910          there is no 'tailf:no-subtree-match' statement.
911
912          The value /a/b[key='k1'] matches the XPath expression /a/b, if
913          there is a 'tailf:no-subtree-match' statement.
914        ";
915   }
916
917   extension step {
918     argument value {
919       tailf:arg-type {
920         type string;
921       }
922     }
923     tailf:use-in "range";
924     description
925       "Used to further restrict the range of integer and decimal types.  The
926        argument is a positive integer or decimal value greater than
927        zero.  The allowed values for the type is further restricted to
928        only those values that matches the expression:
929
930          'low' + n * 'step'
931
932        where 'low' is the lowest allowed value in the range, n is a
933        non-negative integer.
934
935        For example, the following type:
936
937          type int32 {
938            range '-2 .. 9' {
939              tailf:step 3;
940            }
941          }
942
943        has the value space { -2, 1, 4, 7 }";
944   }
945
946   /*
947    * Data implementation statements
948    */
949
950   extension callpoint {
951     argument id {
952       tailf:arg-type {
953         type tailf:identifier;
954       }
955     }
956     tailf:use-in "leaf";
957     tailf:use-in "leaf-list";
958     tailf:use-in "list";
959     tailf:use-in "container";
960     tailf:use-in "refine";
961     tailf:use-in "grouping";
962     tailf:occurence "*";
963
964     tailf:substatement "description";
965     tailf:substatement "tailf:config";
966     tailf:substatement "tailf:transform";
967     tailf:substatement "tailf:set-hook";
968     tailf:substatement "tailf:transaction-hook";
969     tailf:substatement "tailf:cache";
970     tailf:substatement "tailf:opaque";
971     tailf:substatement "tailf:internal";
972     description
973       "Identifies a callback in a data provider.  A data provider implements
974       access to external data, either configuration data in a database or
975       operational data.  By default ConfD uses the embedded database
976       (CDB) to store all data. However, some or all of
977       the configuration data may be stored in an external source.  In
978       order for ConfD to be able to manipulate external data, a data
979       provider registers itself using the callpoint id as described in
980       confd_lib_dp(3).
981
982       A callpoint is inherited to all child nodes unless another
983       'callpoint' or an 'cdb-oper' is defined.";
984   }
985
986   extension config {
987     argument value {
988       tailf:arg-type {
989         type boolean;
990       }
991     }
992     tailf:use-in "tailf:callpoint";
993     description
994       "If this statement is present, the callpoint is applied to nodes with a
995       matching value of their 'config' property.";
996   }
997
998   extension transform {
999     argument value {
1000       tailf:arg-type {
1001         type boolean;
1002       }
1003     }
1004     tailf:use-in "tailf:callpoint";
1005     description
1006       "If set to 'true', the callpoint is a transformation callpoint.  How
1007       transformation callpoints are used is described in the
1008       'Transformations, Hooks, Hidden Data and Symlinks' chapter
1009       in the User's Guide.";
1010   }
1011
1012   extension set-hook {
1013     argument value {
1014       tailf:arg-type {
1015         type enumeration {
1016           enum subtree;
1017           enum object;
1018           enum node;
1019         }
1020       }
1021     }
1022     tailf:use-in "tailf:callpoint";
1023     description
1024       "Set hooks are a means to associate user code to the
1025       transaction.  Whenever an element gets written, created, or
1026       deleted, user code gets invoked and can optionally write more
1027       data into the same transaction.
1028
1029       The difference between set- and transaction hooks are that set
1030       hooks are invoked immediately when an element is modified, but
1031       transaction hooks are invoked at commit time.
1032
1033       The value 'subtree' means that all nodes in the configuration
1034       below where the hook is defined are affected.
1035
1036       The value 'object' means that the hook only applies to the list
1037       where it is defined, i.e.  it applies to all child nodes that
1038       are not themselves lists.
1039
1040       The value 'node' means that the hook only applies to
1041       the node where it is defined and none of its children.
1042
1043       For more details on hooks,
1044       see the 'Transformations, Hooks, Hidden Data and Symlinks'
1045       chapter in the User's Guide.";
1046   }
1047
1048   extension transaction-hook {
1049     argument value {
1050       tailf:arg-type {
1051         type enumeration {
1052           enum subtree;
1053           enum object;
1054           enum node;
1055         }
1056       }
1057     }
1058     tailf:use-in "tailf:callpoint";
1059     tailf:substatement "tailf:invocation-mode";
1060     description
1061       "Transaction hooks are a means to associate user code to the
1062       transaction.  Whenever an element gets written, created, or
1063       deleted, user code gets invoked and can optionally write more
1064       data into the same transaction.
1065
1066       The difference between set- and transaction hooks are that set
1067       hooks are invoked immediately when an element is modified, but
1068       transaction hooks are invoked at commit time.
1069
1070       The value 'subtree' means that all nodes in the configuration
1071       below where the hook is defined are affected.
1072
1073       The value 'object' means that the hook only applies to the list
1074       where it is defined, i.e.  it applies to all child nodes that
1075       are not themselves lists.
1076
1077       The value 'node' means that the hook only applies to
1078       the node where it is defined and none of its children.
1079
1080       For more details on hooks,
1081       see the 'Transformations, Hooks, Hidden Data and Symlinks'
1082       chapter in the User's Guide.";
1083   }
1084
1085   extension invocation-mode {
1086     argument value {
1087       tailf:arg-type {
1088         type enumeration {
1089           enum per-operation;
1090           enum per-transaction;
1091         }
1092         default per-operation;
1093       }
1094     }
1095     tailf:use-in "tailf:transaction-hook";
1096     description
1097       "By default, the node-specific write callbacks (create(), set_elem(),
1098       etc) for a transaction hook are invoked for the invidual data nodes
1099       that are modified in the transaction. If 'tailf:invocation-mode' is
1100       set to 'per-transaction', there will instead be a single invocation
1101       of a generic write callback (write_all()).";
1102   }
1103
1104   extension cache {
1105     argument value {
1106       tailf:arg-type {
1107         type boolean;
1108       }
1109     }
1110     tailf:use-in "tailf:callpoint";
1111     tailf:substatement "tailf:timeout";
1112     description
1113       "If set to 'true', the operational data served by the callpoint will
1114       be cached by ConfD.  If set to 'true' in a node that represents
1115       configuration data, the statement 'tailf:config' must be present
1116       and set to 'false'.  This feature is further described in the section
1117       'Caching operational data' in the 'Operational data' chapter in
1118       the User's Guide.";
1119   }
1120
1121   extension timeout {
1122     argument value {
1123       tailf:arg-type {
1124         type uint64;
1125       }
1126     }
1127     tailf:use-in "tailf:cache";
1128     description
1129       "Specifies how long the operational data will be cached, in seconds.
1130        This value will override the global value specified via
1131        /confdConfig/opcache/timeout in the confd.conf(5) file.";
1132   }
1133
1134   extension opaque {
1135     argument value {
1136       tailf:arg-type {
1137         type string {
1138           length "1..255";
1139         }
1140       }
1141     }
1142     tailf:use-in "tailf:callpoint";
1143     tailf:use-in "tailf:validate";
1144     tailf:use-in "tailf:actionpoint";
1145     description
1146       "Defines an opaque string which is passed to the callback function
1147       in the context.";
1148   }
1149
1150   extension id {
1151     argument name {
1152       tailf:arg-type {
1153         type string;
1154       }
1155     }
1156     tailf:use-in "module";
1157     description
1158       "This statement is used when old confspec models are translated to
1159       YANG.  It needs to be present if systems deployed with data
1160       based on confspecs are updated to YANG based data models.
1161
1162       In confspec, the 'id' of a data model was a string that never
1163       would change, even if the namespace URI would change.  It is not
1164       needed in YANG, since the namespace URi cannot change as a module
1165       is updated.
1166
1167       This statement is typically present in YANG modules generated by
1168       cs2yang.  If no live upgrade needs to be done from a confspec
1169       based system to a YANG based system, this statement can be
1170       removed from such a generated module.";
1171   }
1172
1173   extension cdb-oper {
1174     tailf:use-in "leaf";
1175     tailf:use-in "leaf-list";
1176     tailf:use-in "list";
1177     tailf:use-in "container";
1178     tailf:use-in "refine";
1179     tailf:substatement "description";
1180     tailf:substatement "tailf:persistent";
1181     description
1182       "Indicates that operational data nodes below this node are stored in
1183       CDB.";
1184   }
1185
1186   extension persistent {
1187     argument value {
1188       tailf:arg-type {
1189         type boolean;
1190       }
1191     }
1192     tailf:use-in "tailf:cdb-oper";
1193     description
1194       "If it is set to 'true', the operational data is stored on disk.  If
1195       set to 'false', the operational data is not persistent across
1196       ConfD restarts.  The default is 'false'.";
1197   }
1198
1199   extension id-value {
1200     argument value {
1201       tailf:arg-type {
1202         type uint32 {
1203           range "1..4294967294";
1204         }
1205       }
1206     }
1207     tailf:use-in "module";
1208     tailf:use-in "leaf";
1209     tailf:use-in "leaf-list";
1210     tailf:use-in "list";
1211     tailf:use-in "container";
1212     tailf:use-in "rpc";
1213     tailf:use-in "identity";
1214     tailf:use-in "notification";
1215     tailf:use-in "choice";
1216     tailf:use-in "case";
1217     tailf:use-in "tailf:action";
1218     description
1219       "This statement lets you specify a hard wired numerical id value to
1220       associate with the parent node.  This id value is normally auto
1221       generated by confdc and is used when working with the ConfD API
1222       to refer to a tag name, to avoid expensive string comparison.
1223       Under certain rare circumstances this auto generated hash value
1224       may collide with a hash value generated for a node in another
1225       data model.  Whenever such a collision occurs the ConfD daemon
1226       fails to start and instructs the developer to use the 'id-value'
1227       statement to resolve the collision.
1228
1229
1230       A thorough discussion on id-value can be found in the section Hash
1231       Values and the id-value Statement in the YANG chapter in the User
1232       Guide.";
1233   }
1234
1235   extension default-ref {
1236     argument path {
1237       tailf:arg-type {
1238         type string;
1239       }
1240     }
1241     tailf:use-in "leaf";
1242     tailf:use-in "refine";
1243     description
1244       "This statement defines a dynamic default value.  It is a reference to
1245       some other leaf in the datamodel.  If no value has been set for
1246       this leaf, it defaults to the value of the leaf that the
1247       'default-ref' argument points to.
1248
1249       The textual format of a 'default-ref' is an XPath location path with
1250       no predicates.
1251
1252       The type of the leaf with a 'default-ref' will be set to the
1253       type of the referred leaf.  This means that the type statement in
1254       the leaf with the 'default-ref' is ignored, but it SHOULD match the
1255       type of the referred leaf.
1256
1257       Here is an example, where a group without a 'hold-time' will get as
1258       default the value of another leaf up in the hierarchy:
1259
1260         leaf hold-time {
1261             mandatory true;
1262             type int32;
1263         }
1264         list group {
1265             key 'name';
1266             leaf name {
1267                 type string;
1268             }
1269             leaf hold-time {
1270                 type int32;
1271                 tailf:default-ref '../../hold-time';
1272             }
1273         }
1274       ";
1275   }
1276
1277   extension sort-order {
1278     argument how {
1279       tailf:arg-type {
1280         type enumeration {
1281           enum normal {
1282             description
1283               "Entries are sorted on the key values.";
1284           }
1285           enum snmp {
1286             description
1287               "All string key values are considered to
1288               start with a length byte for the purpose of sorting.";
1289           }
1290           enum snmp-implied {
1291             description
1292               "As 'snmp', but uses a length byte for all except the last key.";
1293           }
1294           enum unsorted {
1295             description
1296               "Entries do not have any special order.  Note that it is
1297                not possible to use the function 'find_next' on an
1298                unsorted list.  If an unsorted list is filtered (e.g.,
1299                in the CLI, the entire list must be traversed.
1300
1301                If this value is given for a list stored in CDB, it
1302                has no effect.";
1303           }
1304         }
1305         default normal;
1306       }
1307     }
1308     tailf:use-in "list";
1309     tailf:use-in "leaf-list";
1310     tailf:use-in "tailf:secondary-index";
1311     description
1312       "This statement can be used for 'ordered-by system' lists and
1313        leaf-lists only.  It indicates in which way the list entries
1314        are sorted.";
1315   }
1316
1317   extension link {
1318     argument target {
1319       tailf:arg-type {
1320         type string;
1321       }
1322     }
1323     tailf:use-in "leaf";
1324     tailf:use-in "leaf-list";
1325     tailf:substatement "tailf:inherit-set-hook";
1326     description
1327       "This statement specifies that the data node should be
1328        implemented as a link to another data node, called the target
1329        data node.  This means that whenever the node is modified, the
1330        system modifies the target data node instead, and whenever the
1331        data node is read, the system returns the value of target data
1332        node.
1333
1334        Note that if the data node is a leaf, the target node MUST also
1335        be a leaf, and if the data node is a leaf-list, the target node
1336        MUST also be a leaf-list.
1337
1338        Note that the type of the data node MUST be the same as the
1339        target data node.  Currently the compiler cannot check this.
1340
1341        The argument is an XPath absolute location path.  If
1342        the target lies within lists, all keys must be specified.
1343        A key either has a value, or is a reference to a key in the path of the
1344        source node, using the function current() as starting
1345        point for an XPath location path.  For example:
1346
1347          /a/b[k1='paul'][k2=current()/../k]/c";
1348   }
1349
1350   extension lower-case {
1351     tailf:use-in "leaf";
1352     tailf:use-in "leaf-list";
1353     description
1354       "Use for config false leafs and leaf-lists only.
1355
1356        This extension serves as a hint to the system that the
1357        leaf's type has the implict pattern '[^A-Z]*', i.e., all
1358        strings returned by the data provider are lower case (in
1359        the 7-bit ASCII range).
1360
1361        The CLI uses this hint when it is run in case-insensitive mode
1362        to optimize the lookup calls towards the data provider.";
1363   }
1364
1365   extension inherit-set-hook {
1366     argument value {
1367       tailf:arg-type {
1368         type boolean;
1369         default "false";
1370       }
1371     }
1372     tailf:use-in "tailf:symlink";
1373     tailf:use-in "tailf:link";
1374     description
1375       "This statement specifies that a 'tailf:set-hook' statement should
1376        survive through symlinks. If set to true a set hook gets called as
1377        soon as the value is set via a symlink but also during commit. The
1378        normal behaviour is to only call the set hook during commit time.";
1379   }
1380
1381   extension secondary-index {
1382     argument name {
1383       tailf:arg-type {
1384         type string;
1385       }
1386     }
1387     tailf:use-in "list";
1388     tailf:occurence "*";
1389     tailf:substatement "tailf:index-leafs" {
1390       tailf:occurence "1";
1391     }
1392     tailf:substatement "tailf:sort-order";
1393     tailf:substatement "tailf:display-default-order";
1394     description
1395       "This statement creates a secondary index with a given name in the
1396       parent list.  The secondary index can be used to control the
1397       displayed sort order of the instances of the list.
1398
1399       Read more about sort order in 'The ConfD Command-Line Interface
1400       (CLI)' chapters in the User Guide, confd_lib_dp(3), and
1401       confd_lib_maapi(3).
1402
1403       NOTE: Currently secondary-index is not supported for config false
1404       data stored in CDB.";
1405   }
1406
1407   extension index-leafs {
1408     argument value {
1409       tailf:arg-type {
1410         type string;
1411       }
1412     }
1413     tailf:use-in "tailf:secondary-index";
1414     tailf:occurence "1";
1415     description
1416       "This statement contains a space separated list of leaf names.  Each
1417       such leaf must be a direct child to the list.  The secondary
1418       index is kept sorted according to the values of these leafs.";
1419   }
1420
1421   extension typepoint {
1422     argument id {
1423       tailf:arg-type {
1424         type tailf:identifier;
1425       }
1426     }
1427     tailf:use-in "typedef";
1428     tailf:use-in "leaf";
1429     tailf:use-in "leaf-list";
1430     tailf:occurence "*";
1431     description
1432       "If a typedef, leaf, or leaf-list has a 'typepoint' statement, a
1433       user-defined type is specified, as opposed to a derivation or
1434       specification of an existing type.  The implementation of a
1435       user-defined type must be provided in the form of a shared object
1436       with C callback functions that is loaded into the ConfD daemon at
1437       startup time. Read more about user-defined types in the
1438       confd_types(3) manual page.
1439
1440       The argument defines the ID associated with a typepoint.  This
1441       ID is provided by the shared object, and used by the ConfD
1442       daemon to locate the implementation of a specific user-defined
1443       type.";
1444   }
1445
1446   /*
1447    * Validation related statements
1448    */
1449
1450   extension unique-selector {
1451     argument context-path {
1452       tailf:arg-type {
1453         type string;
1454       }
1455     }
1456     tailf:use-in "module";
1457     tailf:use-in "submodule";
1458     tailf:use-in "grouping";
1459     tailf:use-in "augment";
1460     tailf:use-in "container";
1461     tailf:use-in "list";
1462     tailf:occurence "*";
1463
1464     tailf:substatement "tailf:unique-leaf" {
1465       tailf:occurence "+";
1466     }
1467     description
1468       "The standard YANG statement 'unique' can be used to check for
1469        uniqueness within a single list only.  Specifically, it cannot
1470        be used to check for uniqueness of leafs within a sublist.
1471
1472        For example:
1473
1474          container a {
1475            list b {
1476              ...
1477              unique 'server/ip server/port';
1478              list server {
1479                ...
1480                leaf ip { ... };
1481                leaf port { ... };
1482              }
1483            }
1484          }
1485
1486        The unique expression above is not legal.  The intention is
1487        that there must not be any two 'server' entries in any 'b' with
1488        the same combination of ip and port.  This would be illegal:
1489
1490          <a>
1491            <b>
1492              <name>b1</name>
1493              <server>
1494                <ip>10.0.0.1</ip>
1495                <port>80</port>
1496              </server>
1497            </b>
1498            <b>
1499              <name>b2</name>
1500              <server>
1501                <ip>10.0.0.1</ip>
1502                <port>80</port>
1503              </server>
1504            </b>
1505          </a>
1506
1507        With 'tailf:unique-selector' and 'tailf:unique-leaf', this kind
1508        of constraint can be defined.
1509
1510        The argument to 'tailf:unique-selector' is an XPath descendant
1511        location path (matches the rule 'descendant-schema-nodeid' in
1512        RFC 6020).  The first node in the path MUST be a list node, and
1513        it MUST be defined in the same module as the
1514        tailf:unique-selector.  For example, the following is illegal:
1515
1516          module y {
1517            ...
1518            import x {
1519              prefix x;
1520            }
1521            tailf:unique-selector '/x:server' { // illegal
1522              ...
1523            }
1524          }
1525
1526        For each instance of the node where the selector is defined, it
1527        is evaluated, and for each node selected by the selector, a
1528        tuple is constructed by evaluating the 'tailf:unique-leaf'
1529        expression.  All such tuples must be unique.  If a
1530        'tailf:unique-leaf' expression refers to a non-existing leaf,
1531        the corresponding tuple is ignored.
1532
1533        In the example above, the unique expression can be replaced by:
1534
1535          container a {
1536            tailf:unique-selector 'b/server' {
1537              tailf:unique-leaf 'ip';
1538              tailf:unique-leaf 'port';
1539            }
1540            list b {
1541              ...
1542            }
1543          }
1544
1545        For each container 'a', the XPath expression 'b/server' is
1546        evaluated.  For each such server, a 2-tuple is constructed with
1547        the 'ip' and 'port' leafs.  Each such 2-tuple is guaranteed to
1548        be unique.";
1549   }
1550
1551   extension unique-leaf {
1552     argument leaf-expr {
1553       tailf:arg-type {
1554         type string;
1555       }
1556     }
1557     tailf:use-in "tailf:unique-selector";
1558     tailf:occurence "+";
1559     description
1560       "See 'tailf:unique-selector' for a description of how this statement
1561        is used.
1562
1563        The argument is an XPath descendant location path (matches the
1564        rule 'descendant-schema-nodeid' in RFC 6020), and it MUST refer to
1565        a leaf.";
1566   }
1567
1568   extension validate {
1569     argument id {
1570       tailf:arg-type {
1571         type tailf:identifier;
1572       }
1573     }
1574     tailf:use-in "leaf";
1575     tailf:use-in "leaf-list";
1576     tailf:use-in "list";
1577     tailf:use-in "container";
1578     tailf:use-in "grouping";
1579     tailf:use-in "refine";
1580     tailf:use-in "must";
1581     tailf:occurence "*";
1582     tailf:substatement "description";
1583     tailf:substatement "tailf:call-once";
1584     tailf:substatement "tailf:dependency" {
1585       tailf:occurence "*";
1586     }
1587     tailf:substatement "tailf:opaque";
1588     tailf:substatement "tailf:internal";
1589     tailf:substatement "tailf:priority";
1590     description
1591       "Identifies a validation callback which is invoked when a configuration
1592       value is to be validated.  The callback validates a value and
1593       typically checks it towards other values in the data store.
1594       Validation callbacks are used when the YANG built-in validation
1595       constructs ('must', 'unique') are not expressive enough.
1596
1597       Callbacks use the API described in confd_lib_maapi(3) to
1598       access whatever other configuration values needed to perform the
1599       validation.
1600
1601       Validation callbacks are typically assigned to individual nodes
1602       in the data model, but it may be feasible to use a single
1603       validation callback on a root node.  In that case the callback
1604       is responsible for validation of all values and their
1605       relationships throughout the data store.
1606
1607       The 'validate' statment should in almost all cases have a
1608       'tailf:dependency' substatement.  If such a statement is not
1609       given, the validate function is evaluated at every commit,
1610       leading to overall performance degradation.
1611
1612       If the 'validate' statement is defined in a 'must' statement,
1613       validation callback is called instead of evaluating the must
1614       expression.  This is useful if the evaluation of the must statement
1615       uses too much resources, and the condition expressed with the must
1616       statement is easier to check with a validation callback function.";
1617   }
1618
1619   extension call-once {
1620     argument value {
1621       tailf:arg-type {
1622         type boolean;
1623       }
1624     }
1625     tailf:use-in "tailf:validate";
1626     description
1627       "This optional statement can be used only if the parent statement is
1628       a list.  If 'call-once' is 'true'. the validation callback is
1629       only called once even though there exists many list entries in
1630       the data store.  This is useful if we have a huge amount of
1631       instances or if values assigned to each instance have to be
1632       validated in comparison with its siblings.";
1633   }
1634
1635   extension dependency {
1636     argument path {
1637       tailf:arg-type {
1638         type string;
1639       }
1640     }
1641     tailf:use-in "must";
1642     tailf:use-in "when";
1643     tailf:use-in "tailf:validate";
1644     tailf:substatement "tailf:xpath-root";
1645     tailf:occurence "*";
1646     description
1647       "This statement is used to specify that the must or when expression
1648       or validation function depends on a set of subtrees in the data
1649       store.  Whenever a node in one of those subtrees are modified,
1650       the must or when expression is evaluated, or validation code executed.
1651
1652       The textual format of a 'dependency' is an XPath location path with
1653       no predicates.
1654
1655       If the node that declares the dependency is a leaf, there is an
1656       implicit dependency to the leaf itself.
1657
1658       For example, with the leafs below, the validation code for'vp'
1659       will be called whenever 'a' or 'b' is modified.
1660
1661         leaf a {
1662             type int32;
1663             tailf:validate vp {
1664                 tailf:dependency '../b';
1665             }
1666         }
1667         leaf b {
1668             type int32;
1669         }
1670
1671        For 'when' and 'must' expressions, the compiler can derive the
1672        dependencies automatically from the XPath expression in most
1673        cases.  The exception is if any wildcards are used in the expression.
1674
1675        For 'when' expressions to work, a 'tailf:dependency' statement
1676        must be given, unless the compiler can figure out the dependency
1677        by itself.
1678
1679        Note that having 'must' expressions or a 'tailf:validate'
1680        statement without dependencies impacts the overall performance
1681        of the system, since all such 'must' expressions or validation
1682        functions are evaluated at every commit.";
1683   }
1684
1685   extension no-dependency {
1686     tailf:use-in "must";
1687     tailf:use-in "tailf:validate";
1688     tailf:occurence "?";
1689     description
1690       "This optional statements can be used to explicitly say that a 'must'
1691       expression or a validation function is evaluated at every
1692       commit.  Use this with care, since the overall performance of
1693       the system is impacted if this statement is used.";
1694   }
1695
1696   extension priority {
1697     tailf:use-in "tailf:validate";
1698     argument value {
1699       tailf:arg-type {
1700         type uint32;
1701       }
1702     }
1703     description
1704       "This extension takes an integer parameter specifying the order
1705        validation code will be evaluated, in order of increasing
1706        priority.
1707
1708        The default priority is 0.";
1709   }
1710
1711   extension no-subtree-match {
1712     tailf:use-in "tailf:path-filters";
1713     description
1714       "See tailf:path-filters.";
1715   }
1716
1717
1718   /*
1719    * User interface related statements
1720    */
1721
1722   extension info {
1723     argument text {
1724       yin-element true;
1725       tailf:arg-type {
1726         type string;
1727       }
1728     }
1729     tailf:use-in "typedef";
1730     tailf:use-in "leaf";
1731     tailf:use-in "leaf-list";
1732     tailf:use-in "list";
1733     tailf:use-in "container";
1734     tailf:use-in "rpc";
1735     tailf:use-in "identity";
1736     tailf:use-in "type";
1737     tailf:use-in "enum";
1738     tailf:use-in "bit";
1739     tailf:use-in "length";
1740     tailf:use-in "pattern";
1741     tailf:use-in "range";
1742     tailf:use-in "refine";
1743     tailf:use-in "tailf:action";
1744     tailf:use-in "tailf:symlink";
1745     tailf:use-in "tailf:cli-exit-command";
1746     description
1747       "Contains a textual description of the definition, suitable for
1748       being presented to the CLI and WebUI users.
1749
1750       The first sentence of this textual description is used in the
1751       CLI as a summary, and displayed to the user when a short
1752       explanation is presented.
1753
1754       The 'description' statement is related, but targeted to the module
1755       reader, rather than the CLI or WebUI user.
1756
1757       The info string may contain a ';;' keyword. It is used in type
1758       descriptions for leafs when the builtin type info needs to be
1759       customized.  A 'normal' info string describing a type is assumed
1760       to contain a short textual description.  When ';;' is present it
1761       works as a delimiter where the text before the keyword is
1762       assumed to contain a short description and the text after the
1763       keyword a long(er) description.  In the context of completion in
1764       the CLI the text will be nicely presented in two columns where
1765       both descriptions are aligned when displayed.";
1766   }
1767
1768   extension info-html {
1769     argument text {
1770       yin-element true;
1771       tailf:arg-type {
1772         type string;
1773       }
1774     }
1775     tailf:use-in "leaf";
1776     tailf:use-in "leaf-list";
1777     tailf:use-in "list";
1778     tailf:use-in "container";
1779     tailf:use-in "rpc";
1780     tailf:use-in "identity";
1781     tailf:use-in "tailf:action";
1782     tailf:use-in "tailf:symlink";
1783     tailf:use-in "refine";
1784     description
1785       "This statement works exactly as 'tailf:info', with the exception
1786       that it can contain HTML markup.  The WebUI will display the
1787       string with the HTML markup, but the CLI will remove all HTML markup
1788       before displaying the string to the user.  In most cases,
1789       using this statement avoids using special descriptions in webspecs
1790       and clispecs.
1791
1792       If this statement is present, 'tailf:info' cannot be given at the same
1793       time.";
1794   }
1795
1796   extension sort-priority {
1797     argument value {
1798       tailf:arg-type {
1799         type int32;
1800       }
1801     }
1802     tailf:use-in "leaf";
1803     tailf:use-in "leaf-list";
1804     tailf:use-in "list";
1805     tailf:use-in "container";
1806     tailf:use-in "refine";
1807     description
1808       "This extension takes an integer parameter specifying the order and
1809        can be placed on leafs, containers, lists and leaf-lists.
1810        When showing, or getting configuration, leaf values will be returned
1811        in order of increasing sort-priority.
1812
1813        The default sort-priority is 0.";
1814   }
1815
1816   extension writable {
1817     argument value {
1818       tailf:arg-type {
1819         type boolean;
1820       }
1821     }
1822     tailf:use-in "leaf";
1823     description
1824       "This extension makes operational data (i.e., config false data)
1825        writable.  Only valid for leafs.";
1826   }
1827
1828   extension suppress-echo {
1829     argument value {
1830       tailf:arg-type {
1831         type boolean;
1832       }
1833     }
1834     tailf:use-in "typedef";
1835     tailf:use-in "leaf";
1836     tailf:use-in "leaf-list";
1837     description
1838       "If this statetement is set to 'true', leafs of this type will not have
1839       their values echoed when input in the webui or when the CLI prompts
1840       for the value. The value will also not be included in the audit
1841       log in clear text but will appear as ***.";
1842   }
1843
1844   extension hidden {
1845     argument tag {
1846       tailf:arg-type {
1847         type string {
1848           pattern '[^\*].*|..+'; // must not be single '*'
1849 // YANG 1.1:
1850 //          pattern '\*' {
1851 //            modifier invert-match;
1852 //          }
1853         }
1854       }
1855     }
1856     tailf:use-in "leaf";
1857     tailf:use-in "leaf-list";
1858     tailf:use-in "list";
1859     tailf:use-in "container";
1860     tailf:use-in "tailf:action";
1861     tailf:use-in "refine";
1862     tailf:use-in "tailf:symlink";
1863     tailf:use-in "rpc";
1864     tailf:occurence "*";
1865
1866     description
1867       "This statement can be used to hide a node from some, or all,
1868       northbound interfaces.  All nodes with the same value are
1869       considered a hide group and are treated the same with regards to
1870       being visible or not in a northbound interface.
1871
1872       A node with an hidden property is not shown in the northbound
1873       user interfaces (CLI and Web UI) unless an 'unhide' operation has
1874       been performed in the user interface.
1875
1876       The hidden value 'full' indicates that the node should be hidden
1877       from all northbound interfaces, including programmatical interfaces
1878       such as NETCONF.
1879
1880       The value '*' is not valid.
1881
1882       A hide group can be unhidden only if this has been explicitly
1883       allowed in the confd.conf(5) daemon configuration.
1884
1885       Multiple hide groups can be specified by giving this statement
1886       multiple times.  The node is shown if any of the specified hide groups
1887       has been given in the 'unhide' operation.
1888
1889       Note that if a mandatory node is hidden, a hook callback
1890       function (or similar) might be needed in order to set the
1891       element.";
1892   }
1893
1894   extension display-when {
1895     argument condition {
1896       tailf:arg-type {
1897         type string;
1898       }
1899     }
1900     tailf:use-in "leaf";
1901     tailf:use-in "leaf-list";
1902     tailf:use-in "list";
1903     tailf:use-in "container";
1904     tailf:use-in "refine";
1905     tailf:substatement "tailf:xpath-root";
1906     description
1907       "The argument contains an XPath expression which specifies when
1908       the node should be displayed in the CLI and WebUI.  For example,
1909       when the CLI performs completion, and one of the candidates is
1910       a node with a 'display-when' expression, the expression is
1911       evaluated by the CLI.  If the XPath expression evaluates to
1912       true, the node is shown as a possible completion candidate,
1913       otherwise not.
1914
1915       For a list, the display-when expression is evaluated once for the
1916       entire list.  In this case, the XPath context node is the list's parent
1917       node.
1918
1919       This feature is further described in the 'Transformations, Hooks,
1920       Hidden Data and Symlinks' chapter in the User Guide.";
1921   }
1922
1923   extension display-groups {
1924     argument value {
1925       tailf:arg-type {
1926         type string;
1927       }
1928     }
1929     tailf:use-in "leaf";
1930     tailf:use-in "leaf-list";
1931     tailf:use-in "list";
1932     tailf:use-in "container";
1933     tailf:use-in "refine";
1934     description
1935       "This property is used in the CLI when 'enableDisplayGroups' has been
1936       set to true in the confd.conf(5) file.  Display groups are used
1937       to control which elements should be displayed by the show command.
1938
1939       The argument is a space-separated string of tags.
1940
1941       In the J-style CLI the 'show status', 'show table' and 'show
1942       all' commands use display groups.  In the C- and I-style
1943       CLIs the 'show <pattern>' command uses display groups.
1944
1945       If no display groups are specified when running the commands, the
1946       node will be displayed if it does not have the 'display-groups'
1947       property, or if the property value includes the special value 'none'.
1948
1949       If display groups are specified when running the command, then
1950       the node will be displayed only if its 'display-group'
1951       property contains one of the specified display groups.";
1952   }
1953
1954   extension display-default-order {
1955     tailf:use-in "tailf:secondary-index";
1956     description
1957       "Specifies that the list should be displayed sorted according
1958       to this secondary index in the show command.
1959
1960       If the list has more than one secondary index,
1961       'display-default-order' must be present in one index only.
1962
1963       Used in J-, I- and C-style CLIs and WebUI.";
1964   }
1965
1966   extension alt-name {
1967     argument name {
1968       tailf:arg-type {
1969         type string;
1970       }
1971     }
1972     tailf:use-in "rpc";
1973     tailf:use-in "leaf";
1974     tailf:use-in "leaf-list";
1975     tailf:use-in "list";
1976     tailf:use-in "container";
1977     tailf:use-in "refine";
1978     description
1979       "This property is used to specify an alternative name for the
1980       node in the CLI.  It is used instead of the node name in the CLI,
1981       both for input and output.";
1982   }
1983
1984   extension display-status-name {
1985     argument name {
1986       tailf:arg-type {
1987         type string;
1988       }
1989     }
1990     tailf:use-in "leaf";
1991     tailf:use-in "leaf-list";
1992     tailf:use-in "list";
1993     tailf:use-in "container";
1994     tailf:use-in "refine";
1995     description
1996       "This property is used to specify an alternative name for the
1997       element in the CLI.  It is used when displaying status
1998       information in the C- and I-style CLIs.";
1999   }
2000
2001   extension display-column-name {
2002     argument name {
2003       tailf:arg-type {
2004         type string;
2005       }
2006     }
2007     tailf:use-in "leaf";
2008     tailf:use-in "leaf-list";
2009     tailf:use-in "refine";
2010     description
2011       "This property is used to specify an alternative column name for the
2012       leaf in the CLI.  It is used when displaying the leaf in a
2013       table in the CLI.";
2014   }
2015
2016   extension display-hint {
2017     argument hint {
2018       tailf:arg-type {
2019         type string;
2020       }
2021     }
2022     tailf:use-in "leaf";
2023     tailf:use-in "typedef";
2024     description
2025       "This statement can be used to add a display-hint to a leaf or
2026        typedef of type binary.  The display-hint is used in the CLI
2027        and WebUI instead of displaying the binary as a base64-encoded
2028        string.  It is also used for input.
2029
2030        The value of a 'display-hint' is defined in RFC 2579.
2031
2032        For example, with the display-hint value '1x:', the value is
2033        printed and inputted as a colon-separated hex list.";
2034   }
2035
2036   /*
2037    * SNMP mapping statements
2038    */
2039
2040   extension snmp-oid {
2041     argument oid {
2042       tailf:arg-type {
2043         type tailf:tailf-oid;
2044       }
2045     }
2046     tailf:use-in "leaf";
2047     tailf:use-in "leaf-list";
2048     tailf:use-in "list";
2049     tailf:use-in "container";
2050     tailf:use-in "tailf:symlink";
2051     tailf:use-in "module";
2052     tailf:use-in "refine";
2053     description
2054       "Used when the YANG module is mapped to an SNMP module.
2055
2056       If this statement is present as a direct child to 'module',
2057       it indicates the top level OID for the module.
2058
2059       When the parent node is mapped to an SNMP object, this statement
2060       specifies the OID of the SNMP object.  It may be either a full
2061       OID or just a suffix (a period, followed by an integer).  In the
2062       latter case, a full OID must be given for some ancestor element.
2063
2064       NOTE: when this statement is set in a list, it refers to the OID of
2065       the correspondig table, not the table entry.";
2066   }
2067
2068   extension snmp-name {
2069     argument name {
2070       tailf:arg-type {
2071         type tailf:snmp-identifier;
2072       }
2073     }
2074     tailf:use-in "leaf";
2075     tailf:use-in "leaf-list";
2076     tailf:use-in "list";
2077     tailf:use-in "container";
2078     tailf:use-in "tailf:symlink";
2079     tailf:use-in "enum";
2080     tailf:use-in "refine";
2081     tailf:occurence "*";
2082     description
2083       "Used when the YANG module is mapped to an SNMP module.
2084
2085       When the parent node is mapped to an SNMP object, this statement
2086       specifies the name of the SNMP object.
2087
2088       If the parent node is mapped to multiple SNMP objects, this
2089       statement can be given multiple times.  The first statement
2090       specifies the primary table.
2091
2092       In a list, the argument is interpreted as:
2093
2094              [MIB-MODULE-NAME:]TABLE-NAME
2095
2096       For a leaf representing a table column, it is interpreted as:
2097
2098              [[MIB-MODULE-NAME:]TABLE-NAME:]NAME
2099
2100       For a leaf representing a scalar variable, it is interpreted as:
2101
2102              [MIB-MODULE-NAME:]NAME
2103
2104       If a YANG list is mapped to multiple SNMP tables, each such SNMP
2105       table must be specified with a 'tailf:snmp-name' statement.  If
2106       the table is defined in another MIB than the MIB specified in
2107       'tailf:snmp-mib-module-name', the MIB name must be specified in this
2108       argument.
2109
2110       A leaf in a list that is mapped to multiple SNMP tables must specify
2111       the name of the table it is mapped to if it is different from the
2112       primary table.
2113
2114       In the following example, a single YANG list 'interface' is mapped
2115       to the MIB tables ifTable, ifXTable, and ipv4InterfaceTable:
2116
2117         list interface {
2118           key index;
2119           tailf:snmp-name 'ifTable'; // primary table
2120           tailf:snmp-name 'ifXTable';
2121           tailf:snmp-name 'IP-MIB:ipv4InterfaceTable';
2122
2123           leaf index {
2124             type int32;
2125           }
2126           leaf description {
2127             type string;
2128             tailf:snmp-name 'ifDescr';  // mapped to primary table
2129           }
2130           leaf name {
2131             type string;
2132             tailf:snmp-name 'ifXTable:ifName';
2133           }
2134           leaf ipv4-enable {
2135             type boolean;
2136             tailf:snmp-name
2137               'IP-MIB:ipv4InterfaceTable:ipv4InterfaceEnableStatus';
2138           }
2139           ...
2140         }
2141
2142       When emitting a mib from yang, enum labels are used as-is if they
2143       follow the SMI rules for labels (no '.' or '_' characters and beginning
2144       with a lowercase letter). Any label that doesn't satisfy the SMI rules
2145       will be converted as follows:
2146
2147         An initial uppercase character will be downcased.
2148
2149         If the initial character is not a letter it will be prepended with
2150         an 'a'.
2151
2152         Any '.' or '_' characters elsewhere in the label will be substituted
2153         with '-' characters.
2154
2155         In the resulting label, any multiple '-' character sequence will be
2156         replaced with a single '-' character.
2157
2158       If this automatic conversion is not suitable, snmp-name can be used
2159       to specify the label to use when emitting a MIB.";
2160   }
2161
2162   extension snmp-mib-module-name {
2163     argument name {
2164       tailf:arg-type {
2165         type tailf:identifier;
2166       }
2167     }
2168     tailf:use-in "leaf";
2169     tailf:use-in "leaf-list";
2170     tailf:use-in "list";
2171     tailf:use-in "container";
2172     tailf:use-in "module";
2173     tailf:use-in "refine";
2174     description
2175       "Used when the YANG module is mapped to an SNMP module.
2176
2177       Specifies the name of the SNMP MIB module where the SNMP objects
2178       are defined.
2179
2180       This property is inherited by all child nodes.";
2181   }
2182
2183   extension snmp-row-status-column {
2184     argument value {
2185       tailf:arg-type {
2186         type uint32 {
2187           range "1..max";
2188         }
2189       }
2190     }
2191     tailf:use-in "list";
2192     tailf:use-in "refine";
2193     description
2194       "Used when an SNMP module is generated from the YANG module.
2195
2196       When the parent list node is mapped to an SNMP table, this
2197       statement specifies the column number of the generated RowStatus
2198       column.  If it is not specified, the generated RowStatus column
2199       will be the last in the table.";
2200   }
2201
2202   extension snmp-lax-type-check {
2203     argument value {
2204       tailf:arg-type {
2205         type boolean;
2206       }
2207     }
2208     tailf:use-in "leaf";
2209     description
2210       "Normally, the ConfD MIB compiler checks that the data type of an SNMP
2211       object matches the data type of the corresponding YANG leaf.  If
2212       both objects are writeble, the data types need to precisely
2213       match, but if the SNMP object is read-only, or if
2214       snmp-lax-type-check is set to 'true', the compiler accepts the
2215       object if the SNMP type's value space is a superset of the YANG
2216       type's value space.
2217
2218       If snmp-lax-type-check is true and the MIB object is writable, the SNMP
2219       agent will reject values outside the YANG data type range in runtime.";
2220   }
2221
2222   extension snmp-exclude-object {
2223     tailf:use-in "leaf";
2224     tailf:use-in "leaf-list";
2225     tailf:use-in "list";
2226     tailf:use-in "container";
2227     tailf:use-in "tailf:symlink";
2228     tailf:use-in "refine";
2229     description
2230       "Used when an SNMP MIB is generated from a YANG module, using
2231       the --generate-oids option to confdc.
2232
2233       If this statement is present, confdc will exclude this object
2234       from the resulting MIB.";
2235   }
2236
2237   extension snmp-delete-value {
2238     argument value {
2239       tailf:arg-type {
2240         type string;
2241       }
2242     }
2243     tailf:use-in "leaf";
2244     tailf:substatement "tailf:snmp-send-delete-value";
2245     description
2246       "This statement is used to define a value to be used in SNMP
2247        to delete an optional leaf.  The argument to this statement is the
2248        special value.  This special value must not be part of the value
2249        space for the YANG leaf.
2250
2251        If the optional leaf does not exists, reading it over SNMP returns
2252        'noSuchInstance', unless the statement 'tailf:snmp-send-delete-value'
2253        is used, in which case the same value as used to delete the node
2254        is returned.
2255
2256        For example, the YANG leaf:
2257
2258             leaf opt-int {
2259               type int32 {
2260                 range '1..255';
2261               }
2262               tailf:snmp-delete-value 0 {
2263                 tailf:snmp-send-delete-value;
2264               }
2265             }
2266
2267        can be mapped to a SMI object with syntax:
2268
2269             SYNTAX       Integer32 (0..255)
2270
2271        Setting such an object to '0' over SNMP will delete the node
2272        from the datastore.  If the node does not exsist, reading it over
2273        SNMP will return '0'.";
2274   }
2275
2276   extension snmp-send-delete-value {
2277     tailf:use-in "tailf:snmp-delete-value";
2278     description
2279       "See tailf:snmp-delete-value.";
2280   }
2281
2282   /*
2283    * SNMP NED statements
2284    */
2285
2286   extension snmp-ned-set-before-row-modification {
2287     argument value {
2288       tailf:arg-type {
2289         type string;
2290       }
2291     }
2292     tailf:use-in "leaf";
2293     description
2294       "If this statement is present on a leaf, it tells the SNMP NED
2295        that if a column in the row is modified, and it is marked with
2296        'tailf:snmp-ned-modification-dependent', then the column marked
2297        with 'tailf:snmp-ned-set-before-modification' needs to be set to
2298        <value> before the other column is modified.  After all such
2299        columns have been modified, the column marked with
2300        'tailf:snmp-ned-set-before-modification' is reset to its initial
2301        value.";
2302   }
2303
2304   extension snmp-ned-modification-dependent {
2305     tailf:use-in "leaf";
2306     description
2307       "This statement is used on all columns in a table that
2308        require the usage of the column marked with
2309        tailf:snmp-ned-set-before-row-modification.
2310
2311        This statement can be used on any column in a table where one
2312        leaf is marked with tailf:snmp-ned-set-before-row-modification,
2313        or a table that AUGMENTS such a table, or a table with a
2314        foreign index in such a table.";
2315   }
2316
2317   extension snmp-ned-accessible-column {
2318     argument leaf-name {
2319       tailf:arg-type {
2320         type union {
2321           type tailf:identifier;
2322           type int32;
2323         }
2324       }
2325     }
2326     tailf:use-in "list";
2327     description
2328       "The name or subid number of an accessible column that is
2329        instantiated in all table entries in a table.  The column does
2330        not have to be writable.  The SNMP NED will use this column
2331        when it uses GET-NEXT to loop through the list entries, and
2332        when doing existence tests.
2333
2334        If this column is not given, the SNMP NED uses the following
2335        algorithm:
2336
2337          1.  If there is a RowStatus column, it will be used.
2338          2.  If an INDEX leaf is accessible, it will be used.
2339          3.  Otherwise, use the first accessible column returned
2340              by the SNMP agent.";
2341   }
2342
2343   extension snmp-ned-delete-before-create {
2344     tailf:use-in "list";
2345     description
2346       "This statement is used in a list to make the SNMP NED always send
2347        deletes before creates.  Normally, creates are sent before deletes.";
2348   }
2349
2350   extension snmp-ned-recreate-when-modified {
2351     tailf:use-in "list";
2352     description
2353       "This statement is used in a list to make the SNMP NED delete
2354        and recreate the row when a column in the row is modified.";
2355   }
2356
2357   /*
2358    * Java code generation statements
2359    */
2360
2361   extension java-class-name {
2362     argument name {
2363       tailf:arg-type {
2364         type string;
2365       }
2366     }
2367     tailf:use-in "leaf";
2368     tailf:use-in "leaf-list";
2369     tailf:use-in "list";
2370     tailf:use-in "container";
2371     tailf:use-in "refine";
2372     description
2373       "Used to give another name than the default name to generated Java
2374       classes.  This statemement is typically used to avoid name conflicts
2375       in the Java classes.";
2376   }
2377
2378   /*
2379    * Common code generation statemements
2380    */
2381
2382   extension code-name {
2383     argument name {
2384       tailf:arg-type {
2385         type string;
2386       }
2387     }
2388     tailf:use-in "enum";
2389     tailf:use-in "bit";
2390     tailf:use-in "leaf";
2391     tailf:use-in "leaf-list";
2392     tailf:use-in "list";
2393     tailf:use-in "container";
2394     tailf:use-in "rpc";
2395     tailf:use-in "identity";
2396     tailf:use-in "notification";
2397     tailf:use-in "tailf:action";
2398     description
2399       "Used to give another name to the enum or node name in generated
2400       header files. This statement is typically used to avoid name
2401       conflicts if there is a data node with the same name as the
2402       enumeration, if there are multiple enumerations in different
2403       types with the same name but different values, or if there are
2404       multiple node names that are mapped to the same name in the
2405       header file.";
2406   }
2407
2408   /*
2409    * Data modeling extensions
2410    */
2411
2412   extension action {
2413     argument name {
2414       tailf:arg-type {
2415         type tailf:identifier;
2416       }
2417     }
2418     tailf:use-in "augment";
2419     tailf:use-in "list";
2420     tailf:use-in "container";
2421     tailf:use-in "grouping";
2422     tailf:occurence "*";
2423
2424     tailf:substatement "description";
2425     tailf:substatement "input";
2426     tailf:substatement "output";
2427     tailf:substatement "status";
2428     tailf:substatement "tailf:actionpoint";
2429     tailf:substatement "tailf:alt-name";
2430     tailf:substatement "tailf:cli-mount-point";
2431     tailf:substatement "tailf:cli-configure-mode";
2432     tailf:substatement "tailf:cli-operational-mode";
2433     tailf:substatement "tailf:cli-oper-info";
2434     tailf:substatement "tailf:code-name";
2435     tailf:substatement "tailf:confirm-text";
2436     tailf:substatement "tailf:display-when";
2437     tailf:substatement "tailf:exec";
2438     tailf:substatement "tailf:hidden";
2439     tailf:substatement "tailf:info";
2440     tailf:substatement "tailf:info-html";
2441     description
2442       "Defines an action (method) in the data model.
2443
2444       When the action is invoked, the instance on which the action is
2445       invoked is explicitly identified by an hierarchy of
2446       configuration or state data.
2447
2448       The action statement can have either a 'tailf:actionpoint' or a
2449       'tailf:exec' substatement.  If the action is implemented as a
2450       callback in an application daemon, 'tailf:actionpoint' is used,
2451       whereas 'tailf:exec' is used for an action implemented as a
2452       standalone executable (program or script).  Additionally, 'action'
2453       can have the same substatements as the standard YANG 'rpc'
2454       statement, e.g., 'description', 'input', and 'output'.
2455
2456       For example:
2457
2458            container sys {
2459              list interface {
2460                key name;
2461                leaf name {
2462                  type string;
2463                }
2464                tailf:action reset {
2465                  tailf:actionpoint my-ap;
2466                  input {
2467                    leaf after-seconds {
2468                      mandatory false;
2469                      type int32;
2470                    }
2471                  }
2472                }
2473              }
2474            }
2475
2476       We can also add a 'tailf:confirm-text', which defines a string to
2477       be used in the user interfaces to prompt the user for
2478       confirmation before the action is executed.  The optional
2479       'tailf:confirm-default' and 'tailf:cli-batch-confirm-default' can be set
2480       to control if the default is to proceed or to abort. The latter will only
2481       be used during batch processing in the CLI (e.g. non-interactive mode).
2482
2483            tailf:action reset {
2484              tailf:actionpoint my-ap;
2485              input {
2486                leaf after-seconds {
2487                  mandatory false;
2488                  type int32;
2489                }
2490              }
2491              tailf:confirm-text 'Really want to do this?' {
2492                tailf:confirm-default true;
2493              }
2494            }
2495
2496        The 'tailf:actionpoint' statement can have a 'tailf:opaque'
2497        substatement, to define an opaque string that is passed to the
2498        callback function.
2499
2500            tailf:action reset {
2501              tailf:actionpoint my-ap {
2502                tailf:opaque 'reset-interface';
2503              }
2504              input {
2505                leaf after-seconds {
2506                  mandatory false;
2507                  type int32;
2508                }
2509              }
2510            }
2511
2512        When we use the 'tailf:exec' substatement, the argument to exec
2513        specifies the program or script that should be executed.  For
2514        example:
2515
2516            tailf:action reboot {
2517              tailf:exec '/opt/sys/reboot.sh' {
2518                tailf:args '-c $(context) -p $(path)';
2519              }
2520              input {
2521                leaf when {
2522                  type enumeration {
2523                    enum now;
2524                    enum 10secs;
2525                    enum 1min;
2526                  }
2527                }
2528              }
2529            }";
2530   }
2531
2532   extension actionpoint {
2533     argument name {
2534       tailf:arg-type {
2535         type tailf:identifier;
2536       }
2537     }
2538     tailf:use-in "rpc";
2539     tailf:use-in "tailf:action";
2540     tailf:use-in "refine";
2541     tailf:substatement "tailf:opaque";
2542     tailf:substatement "tailf:internal";
2543     description
2544       "Identifies the callback in a data provider that implements the
2545       action.  See confd_lib_dp(3) for details on the API.";
2546   }
2547
2548   extension confirm-text {
2549     argument text {
2550       yin-element true;
2551       tailf:arg-type {
2552         type string;
2553       }
2554     }
2555     tailf:use-in "rpc";
2556     tailf:use-in "tailf:action";
2557     tailf:substatement "tailf:confirm-default";
2558     tailf:substatement "tailf:cli-batch-confirm-default";
2559     description
2560       "A string which is used in the user interfaces to prompt the user for
2561       confirmation before the action is executed. The optional
2562       'confirm-default' and 'cli-batch-confirm-default' can be set to control
2563       if the default is to proceed or to abort. The latter will only
2564       be used during batch processing in the CLI (e.g. non-interactive mode).";
2565   }
2566
2567   extension confirm-default {
2568     argument name {
2569       tailf:arg-type {
2570         type boolean;
2571       }
2572     }
2573     tailf:use-in "tailf:confirm-text";
2574     description
2575       "Specifies if the default is to proceed or abort the action when a
2576       confirm-text is set.  If this value is not specified, a ConfD
2577       global default value can be set in clispec(5).";
2578   }
2579
2580   extension indexed-view {
2581     tailf:use-in "list";
2582     tailf:substatement "tailf:auto-compact";
2583     description
2584       "This element can only be used if the list has a single key of
2585       an integer type.
2586
2587       It is used to signal that lists instances uses an indexed view,
2588       i.e., making it possible to insert a new list entry at a certain
2589       position.  If a list entry is inserted at a certain position, list
2590       entries following this position are automatically renumbered by the
2591       system, if needed, to make room for the new entry.
2592
2593       This statement is mainly provided for backwards compatibility with
2594       confspecs.  New data models should consider using YANG's ordered-by
2595       user statement instead.";
2596   }
2597
2598   extension auto-compact {
2599     tailf:use-in "tailf:indexed-view";
2600     description
2601       "If an indexed-view list is marked with this statement, it means that
2602        the server will automatically renumber entires after a delete
2603        operation so that the list entries are strictly monotonically
2604        increasing, starting from 1, with no holes.  New list entries
2605        can either be insterted anywhere in the list, or created at the
2606        end; but it is an error to try to create a list entry with a
2607        key that would result in a hole in the sequence.
2608
2609        For example, if the list has entries 1,2,3 it is an error to
2610        create entry 5, but correct to create 4.";
2611   }
2612
2613   extension key-default {
2614     argument value {
2615       tailf:arg-type {
2616         type string;
2617       }
2618     }
2619     tailf:use-in "leaf";
2620     description
2621       "Must be used for key leafs only.
2622
2623       Specifies a value that the CLI and WebUI will use when a list entry is
2624       created, and this key leaf is not given a value.
2625
2626       If one key leaf has a key-default value, all key leafs that
2627       follow this key leaf must also have key-default values.";
2628   }
2629
2630   extension error-info {
2631     tailf:use-in "module";
2632     tailf:use-in "submodule";
2633     tailf:occurence "?";
2634
2635     tailf:substatement "description";
2636     tailf:substatement "leaf" {
2637       tailf:occurence "*";
2638     }
2639     tailf:substatement "leaf-list" {
2640       tailf:occurence "*";
2641     }
2642     tailf:substatement "list" {
2643       tailf:occurence "*";
2644     }
2645     tailf:substatement "container" {
2646       tailf:occurence "*";
2647     }
2648     tailf:substatement "choice" {
2649       tailf:occurence "*";
2650     }
2651     tailf:substatement "uses" {
2652       tailf:occurence "*";
2653     }
2654     description
2655       "Declares a set of data nodes to be used in the NETCONF <error-info>
2656       element.
2657
2658       A data provider can use one of the
2659       confd_*_seterr_extended_info() functions (see confd_lib_dp(3))
2660       to set these data nodes on errors.
2661
2662       This statement may be used multiple times.
2663
2664       For example:
2665
2666           tailf:error-info {
2667              leaf severity {
2668                type enumeration {
2669                  enum info;
2670                  enum error;
2671                  enum critical;
2672                }
2673              }
2674              container detail {
2675                leaf class {
2676                  type uint8;
2677                }
2678                leaf code {
2679                  type uint8;
2680                }
2681              }
2682            }";
2683   }
2684
2685   extension non-strict-leafref {
2686     tailf:use-in "leaf";
2687     tailf:use-in "leaf-list";
2688     tailf:substatement "path" {
2689       tailf:occurence "1";
2690     }
2691     description
2692       "This statement can be used in leafs and leaf-lists similar
2693        to 'leafref', but allows reference to non-existing leafs,
2694        and allows reference from config to non-config.
2695
2696        This statement takes no argument, but expects the core YANG
2697        statement 'path' as a substatement.  The function 'deref' cannot
2698        be used in the path, since it works on nodes of type leafref
2699        only.
2700
2701        The type of the leaf or leaf-list must be exactly the same
2702        as the type of the target.
2703
2704        This statement can be viewed as a substitute for a standard
2705        'require-instance false' on leafrefs, which isn't allowed.
2706
2707        The CLI uses this statement to provide completion with
2708        existing values, and the WebUI uses it to provide a
2709        drop-down box with existing values.";
2710   }
2711
2712   /*
2713    * RPC and action implementation statements
2714    */
2715
2716   extension exec {
2717     argument cmd {
2718       tailf:arg-type {
2719         type string;
2720       }
2721     }
2722     tailf:use-in "rpc";
2723     tailf:use-in "tailf:action";
2724
2725     tailf:substatement "tailf:args";
2726     tailf:substatement "tailf:uid";
2727     tailf:substatement "tailf:gid";
2728     tailf:substatement "tailf:wd";
2729     tailf:substatement "tailf:global-no-duplicate";
2730     tailf:substatement "tailf:raw-xml";
2731     tailf:substatement "tailf:interruptible";
2732     tailf:substatement "tailf:interrupt";
2733     description
2734       "Specifies that the rpc or action is implemented as an OS executable.
2735       The argument 'cmd' is the path to the executable file.  If the
2736       command is in the $PATH of ConfD, the 'cmd' can be just the name
2737       of the executable.";
2738   }
2739
2740   extension args {
2741     argument value {
2742       tailf:arg-type {
2743         type string;
2744       }
2745     }
2746     tailf:use-in "tailf:exec";
2747     description
2748       "Specifies arguments to send to the executable when it is invoked by
2749       ConfD.  The argument 'value' is a space separated list of
2750       argument strings.  It may contain variables on the form
2751       $(variablename).  These variables will be expanded before the
2752       command is executed.  The following variables are always available:
2753
2754         $(user)   The name of the user which runs the operation.
2755
2756         $(groups) A comma separated string of the names of the groups
2757                   the user belongs to.
2758
2759         $(ip)     The source ip address of the user session.
2760
2761         $(uid)    The user id of the user.
2762
2763         $(gid)    The group id of the user.
2764
2765       When the parent 'exec' statement is a substatement of 'action', the
2766       following additional variablenames are available:
2767
2768         $(keypath)   The path that identifies the parent container of 'action'
2769                      in string keypath form, e.g.,
2770                      '/sys:host{earth}/interface{eth0}'.
2771
2772         $(path)      The path that identifies the parent container of 'action'
2773                      in CLI path form, e.g., 'host earth interface eth0'.
2774
2775         $(context)   cli | webui | netconf | any string provided by MAAPI
2776
2777       For  example:
2778          args '-user $(user) $(uid)';
2779       might expand to:
2780          -user bob 500
2781       ";
2782   }
2783
2784   extension raw-xml {
2785     tailf:use-in "tailf:exec";
2786     tailf:substatement "tailf:batch";
2787     description
2788       "Specifies that ConfD should not convert the RPC XML parameters to
2789       command line arguments.  Instead, ConfD just passes the raw XML on
2790       stdin to the program.
2791
2792       This statement is not allowed in 'tailf:action'.";
2793   }
2794
2795   extension interruptible {
2796     argument value {
2797       tailf:arg-type {
2798         type boolean;
2799         default "true";
2800       }
2801     }
2802     tailf:use-in "tailf:exec";
2803     description
2804       "Specifies whether the client can abort the
2805       execution of the executable.";
2806   }
2807
2808   extension interrupt {
2809     argument signal {
2810       tailf:arg-type {
2811         type enumeration {
2812           enum sigkill;
2813           enum sigint;
2814           enum sigterm;
2815         }
2816         default "sigkill";
2817       }
2818     }
2819     tailf:use-in "tailf:exec";
2820     description
2821       "This statement specifies which signal is sent to executable by ConfD
2822       in case the client terminates or aborts the execution.
2823
2824       If not specified, 'sigkill' is sent.";
2825   }
2826
2827
2828   extension uid {
2829     argument value {
2830       tailf:arg-type {
2831         type union {
2832           type enumeration {
2833             enum confd {
2834               description
2835                 "The command is run as the same user id as the ConfD daemon.";
2836             }
2837             enum user {
2838               description
2839                 "The command is run as the same user id as the user logged
2840                 in to ConfD.  This user id MUST exist as an actual user id
2841                 in the underlying operating system.";
2842             }
2843             enum root {
2844               description
2845                 "The command is run as root.";
2846             }
2847           }
2848           type uint32;
2849         }
2850       }
2851     }
2852     tailf:use-in "tailf:exec";
2853     description
2854       "Specifies which user id to use when executing the command.
2855
2856       If 'uid' is an integer value, the command is run as the user with
2857       this user id.
2858
2859       If 'uid' is set to either 'user', 'root' or an integer user id, the
2860       ConfD daemon must have been started as root (or setuid), or the
2861       ConfD executable program 'cmdwrapper' must have setuid root
2862       permissions.";
2863   }
2864
2865   extension gid {
2866     argument value {
2867       tailf:arg-type {
2868         type union {
2869           type enumeration {
2870             enum confd {
2871               description
2872                 "The command is run as the same group id as the ConfD daemon.";
2873             }
2874             enum user {
2875               description
2876                 "The command is run as the same group id as the user logged
2877                 in to ConfD.  This group id MUST exist as an actual group id
2878                 in the underlying operating system.";
2879             }
2880             enum root {
2881               description
2882                 "The command is run as root.";
2883             }
2884           }
2885           type uint32;
2886         }
2887       }
2888     }
2889     tailf:use-in "tailf:exec";
2890     description
2891       "Specifies which group id to use when executing the command.
2892
2893       If 'gid' is an integer value, the command is run as the group with
2894       this group id.
2895
2896       If 'gid' is set to either 'user', 'root' or an integer group id, the
2897       ConfD daemon must have been started as root (or setuid), or the
2898       ConfD executable program 'cmdwrapper' must have setuid root
2899       permissions.";
2900   }
2901
2902   extension wd {
2903     argument value {
2904       tailf:arg-type {
2905         type string;
2906       }
2907     }
2908     tailf:use-in "tailf:exec";
2909     description
2910       "Specifies which working directory to use when executing the
2911       command. If not given the command is executed from the homedir
2912       of the user logged in to ConfD.";
2913   }
2914
2915   extension global-no-duplicate {
2916     argument value {
2917       tailf:arg-type {
2918         type string;
2919       }
2920     }
2921     tailf:use-in "tailf:exec";
2922     description
2923       "Specifies that only one instance with the same name can be run at any
2924       one time in the system. The command can be started either from
2925       the CLI, the WebUI or through NETCONF. If a client tries to
2926       execute this command while another operation with the same
2927       'global-no-duplicate' name is running, a 'resource-denied' error is
2928       generated.";
2929   }
2930
2931   extension batch {
2932     tailf:use-in "tailf:raw-xml";
2933     description
2934       "Specifies that the command returns immediately, but still runs in the
2935       background.";
2936   }
2937
2938   /*
2939    * Deprecated types
2940    */
2941
2942   typedef hex-list {
2943     type string {
2944       pattern '(([0-9a-fA-F]){2}(:([0-9a-fA-F]){2})*)?';
2945     }
2946     status deprecated;
2947     description
2948       "DEPRECATED: Use yang:hex-string instead.  There are no plans to remove
2949        tailf:hex-list.
2950
2951       A list of colon-separated hexa-decimal octets e.g. '4F:4C:41:71'.
2952
2953       The statement tailf:value-length can be used to restrict the number
2954       of octets.  Note that using the 'length' restriction limits the
2955       number of characters in the lexical representation.";
2956   }
2957
2958   /*
2959    * Deprecated statements
2960    */
2961
2962   extension symlink {
2963     argument name {
2964       tailf:arg-type {
2965         type tailf:identifier;
2966       }
2967     }
2968     status deprecated;
2969     tailf:use-in "list";
2970     tailf:use-in "container";
2971     tailf:use-in "module";
2972     tailf:use-in "submodule";
2973     tailf:use-in "augment";
2974     tailf:use-in "case";
2975     tailf:occurence "*";
2976
2977     tailf:substatement "status";
2978     tailf:substatement "tailf:alt-name";
2979     tailf:substatement "tailf:cli-add-mode";
2980     tailf:substatement "tailf:cli-allow-join-with-key";
2981     tailf:substatement "tailf:cli-allow-join-with-value";
2982     tailf:substatement "tailf:cli-allow-key-abbreviation";
2983     tailf:substatement "tailf:cli-allow-range";
2984     tailf:substatement "tailf:cli-allow-wildcard";
2985     tailf:substatement "tailf:cli-autowizard";
2986     tailf:substatement "tailf:cli-boolean-no";
2987     tailf:substatement "tailf:cli-break-sequence-commands";
2988     tailf:substatement "tailf:cli-column-align";
2989     tailf:substatement "tailf:cli-column-stats";
2990     tailf:substatement "tailf:cli-column-width";
2991     tailf:substatement "tailf:cli-compact-stats";
2992     tailf:substatement "tailf:cli-compact-syntax";
2993     tailf:substatement "tailf:cli-completion-actionpoint";
2994     tailf:substatement "tailf:cli-custom-error";
2995     tailf:substatement "tailf:cli-custom-range";
2996     tailf:substatement "tailf:cli-custom-range-actionpoint";
2997     tailf:substatement "tailf:cli-custom-range-enumerator";
2998     tailf:substatement "tailf:cli-delayed-auto-commit";
2999     tailf:substatement "tailf:cli-delete-container-on-delete";
3000     tailf:substatement "tailf:cli-delete-when-empty";
3001     tailf:substatement "tailf:cli-diff-dependency" {
3002       tailf:occurence "*";
3003     }
3004     tailf:substatement "tailf:cli-disabled-info";
3005     tailf:substatement "tailf:cli-disallow-value";
3006     tailf:substatement "tailf:cli-display-empty-config";
3007     tailf:substatement "tailf:cli-display-separated";
3008     tailf:substatement "tailf:cli-drop-node-name";
3009     tailf:substatement "tailf:cli-no-keyword";
3010     tailf:substatement "tailf:cli-enforce-table";
3011     tailf:substatement "tailf:cli-embed-no-on-delete";
3012     tailf:substatement "tailf:cli-exit-command";
3013     tailf:substatement "tailf:cli-explicit-exit";
3014     tailf:substatement "tailf:cli-expose-key-name";
3015     tailf:substatement "tailf:cli-expose-ns-prefix";
3016     tailf:substatement "tailf:cli-flat-list-syntax";
3017     tailf:substatement "tailf:cli-flatten-container";
3018     tailf:substatement "tailf:cli-full-command";
3019     tailf:substatement "tailf:cli-full-no";
3020     tailf:substatement "tailf:cli-full-show-path";
3021     tailf:substatement "tailf:cli-hide-in-submode";
3022     tailf:substatement "tailf:cli-ignore-modified";
3023     tailf:substatement "tailf:cli-incomplete-command";
3024     tailf:substatement "tailf:cli-incomplete-no";
3025     tailf:substatement "tailf:cli-incomplete-show-path";
3026     tailf:substatement "tailf:cli-instance-info-leafs";
3027     tailf:substatement "tailf:cli-key-format";
3028     tailf:substatement "tailf:cli-list-syntax";
3029     tailf:substatement "tailf:cli-min-column-width";
3030     tailf:substatement "tailf:cli-mode-name";
3031     tailf:substatement "tailf:cli-mode-name-actionpoint";
3032     tailf:substatement "tailf:cli-multi-value";
3033     tailf:substatement "tailf:cli-multi-word-key";
3034     tailf:substatement "tailf:cli-multi-line-prompt";
3035     tailf:substatement "tailf:cli-no-key-completion";
3036     tailf:substatement "tailf:cli-no-match-completion";
3037     tailf:substatement "tailf:cli-no-name-on-delete";
3038     tailf:substatement "tailf:cli-no-value-on-delete";
3039     tailf:substatement "tailf:cli-oper-info";
3040     tailf:substatement "tailf:cli-optional-in-sequence";
3041     tailf:substatement "tailf:cli-prefix-key";
3042     tailf:substatement "tailf:cli-preformatted";
3043     tailf:substatement "tailf:cli-range-delimiters";
3044     tailf:substatement "tailf:cli-range-list-syntax";
3045     tailf:substatement "tailf:cli-recursive-delete";
3046     tailf:substatement "tailf:cli-remove-before-change";
3047     tailf:substatement "tailf:cli-reset-container";
3048     tailf:substatement "tailf:cli-run-template";
3049     tailf:substatement "tailf:cli-run-template-enter";
3050     tailf:substatement "tailf:cli-run-template-footer";
3051     tailf:substatement "tailf:cli-run-template-legend";
3052     tailf:substatement "tailf:cli-sequence-commands";
3053     tailf:substatement "tailf:cli-show-config";
3054     tailf:substatement "tailf:cli-show-no";
3055     tailf:substatement "tailf:cli-show-order-tag";
3056     tailf:substatement "tailf:cli-show-order-taglist";
3057     tailf:substatement "tailf:cli-show-template";
3058     tailf:substatement "tailf:cli-show-template-enter";
3059     tailf:substatement "tailf:cli-show-template-footer";
3060     tailf:substatement "tailf:cli-show-template-legend";
3061     tailf:substatement "tailf:cli-show-with-default";
3062     tailf:substatement "tailf:cli-strict-leafref";
3063     tailf:substatement "tailf:cli-suppress-key-abbreviation";
3064     tailf:substatement "tailf:cli-suppress-key-sort";
3065     tailf:substatement "tailf:cli-suppress-list-no";
3066     tailf:substatement "tailf:cli-suppress-mode";
3067     tailf:substatement "tailf:cli-suppress-no";
3068     tailf:substatement "tailf:cli-suppress-range";
3069     tailf:substatement "tailf:cli-suppress-shortenabled";
3070     tailf:substatement "tailf:cli-suppress-show-conf-path";
3071     tailf:substatement "tailf:cli-suppress-show-match";
3072     tailf:substatement "tailf:cli-suppress-show-path";
3073     tailf:substatement "tailf:cli-suppress-silent-no";
3074     tailf:substatement "tailf:cli-suppress-validation-warning-prompt";
3075     tailf:substatement "tailf:cli-suppress-wildcard";
3076     tailf:substatement "tailf:cli-table-footer";
3077     tailf:substatement "tailf:cli-table-legend";
3078     tailf:substatement "tailf:cli-trim-default";
3079     tailf:substatement "tailf:cli-value-display-template";
3080     tailf:substatement "tailf:display-when";
3081     tailf:substatement "tailf:hidden" {
3082       tailf:occurence "*";
3083     }
3084     tailf:substatement "tailf:inherit-set-hook";
3085     tailf:substatement "tailf:info";
3086     tailf:substatement "tailf:info-html";
3087     tailf:substatement "tailf:path" {
3088       tailf:occurence "1";
3089     }
3090     tailf:substatement "tailf:snmp-exclude-object";
3091     tailf:substatement "tailf:snmp-name" {
3092       tailf:occurence "*";
3093     }
3094     tailf:substatement "tailf:snmp-oid";
3095     tailf:substatement "tailf:sort-priority";
3096     description
3097       "DEPRECATED: Use tailf:link instead.  There are no plans to remove
3098        tailf:symlink.
3099
3100       This statement defines a 'symbolic link' from a node to some other node.
3101       The argument is the name of the new node, and the mandatory substatement
3102       'tailf:path' points to the node which is linked to.";
3103   }
3104
3105   extension path {
3106     argument path {
3107       tailf:arg-type {
3108         type string;
3109       }
3110     }
3111     status deprecated;
3112     tailf:occurence "1";
3113     tailf:use-in "tailf:symlink";
3114     description
3115       "This statement specifies which node a symlink points to.
3116
3117       The textual format of a symlink is an XPath absolute location path. If
3118       the target lies within lists, all keys must be specified.
3119       A key either has a value, or is a reference to a key in the path of the
3120       source node, using the function current() as starting
3121       point for an XPath location path.  For example:
3122
3123       /a/b[k1='paul'][k2=current()/../k]/c
3124       ";
3125   }
3126
3127   /*
3128    * Tail-f internal statements
3129    */
3130
3131   extension internal {
3132     tailf:use-in "tailf:callpoint";
3133     tailf:use-in "tailf:validate";
3134     tailf:use-in "tailf:actionpoint";
3135     description
3136       "For internal ConfD / NCS use only.";
3137   }
3138
3139   extension junos-val-as-xml-tag {
3140     tailf:use-in "leaf";
3141     description
3142       "Internal extension to handle non-YANG JUNOS data models.
3143       Use only for key enumeration leafs.";
3144   }
3145
3146   extension junos-val-with-prev-xml-tag {
3147     tailf:use-in "leaf";
3148     description
3149       "Internal extension to handle non-YANG JUNOS data models.
3150       Use only for keys where previous key is marked with
3151       'tailf:junos-val-as-xml-tag'.";
3152   }
3153
3154   extension xpath-root {
3155     argument value {
3156       tailf:arg-type {
3157         type uint8;
3158       }
3159     }
3160     tailf:use-in "must";
3161     tailf:use-in "when";
3162     tailf:use-in "path";
3163     tailf:use-in "tailf:display-when";
3164     tailf:use-in "tailf:cli-diff-dependency";
3165     description
3166       "Internal extension to 'chroot' XPath expressions";
3167   }
3168
3169   extension ncs-device-type {
3170     argument type {
3171       tailf:arg-type {
3172         type string;
3173       }
3174     }
3175     tailf:use-in "container";
3176     tailf:use-in "list";
3177     tailf:use-in "leaf";
3178     tailf:use-in "leaf-list";
3179     tailf:use-in "refine";
3180     description
3181       "Internal extension to tell NCS what type of device the data model
3182       is used for.";
3183   }
3184
3185   extension structure {
3186     argument name {
3187       tailf:arg-type {
3188         type tailf:identifier;
3189       }
3190     }
3191     tailf:use-in "module";
3192     tailf:use-in "submodule";
3193     tailf:occurence "*";
3194
3195     tailf:substatement "description";
3196     tailf:substatement "leaf" {
3197       tailf:occurence "*";
3198     }
3199     tailf:substatement "leaf-list" {
3200       tailf:occurence "*";
3201     }
3202     tailf:substatement "list" {
3203       tailf:occurence "*";
3204     }
3205     tailf:substatement "container" {
3206       tailf:occurence "*";
3207     }
3208     tailf:substatement "choice" {
3209       tailf:occurence "*";
3210     }
3211     tailf:substatement "uses" {
3212       tailf:occurence "*";
3213     }
3214     description
3215       "Internal extension to define a data structure without any semantics
3216        attached.";
3217   }
3218
3219 }