YANGTOOLS-706: Split out yang-parser-rfc7950
[yangtools.git] / yang / yang-parser-rfc7950 / src / test / resources / types / custom-types-test@2012-04-04.yang
1 module custom-types-test {
2
3     yang-version 1;
4     namespace "urn:custom.types.demo";
5     prefix "iit";
6
7     // imports added only for testing purposes
8     import iana-timezones {
9         prefix "tz";
10     }
11     import ietf-inet-types {
12         prefix "inet";
13     }
14     import ietf-yang-types {
15         prefix "yang";
16     }
17
18     organization "opendaylight";
19     contact "WILL-BE-DEFINED-LATER";
20         revision 2012-04-16 {
21     }
22
23     extension mountpoint {
24         description "enter point";
25         argument "name" {
26             yin-element "true";
27         }
28     }
29
30     typedef access-operations-type {
31         type bits {
32             bit create {
33                 description "Any protocol operation that creates a new data node.";
34             }
35             bit read {
36                 description "Any protocol operation or notification that returns the value of a data node.";
37                 position 500;
38             }
39             bit update {
40                 description "Any protocol operation that alters an existing data node.";
41             }
42             bit delete {
43                 description "Any protocol operation that removes a data node.";
44                 position 365;
45             }
46             bit exec {
47                 description "Execution access to the specified protocol operation.";
48             }
49         }
50         description "NETCONF Access Operation.";
51     }
52
53     leaf inst-id-leaf1 {
54         type instance-identifier {
55             require-instance false;
56         }
57         iit:mountpoint "mnt-extension";
58     }
59
60     leaf inst-id-leaf2 {
61         type instance-identifier;
62     }
63
64     leaf type {
65         type service-type-ref;
66     }
67
68     identity crypto-id {
69         base "crypto-base";
70         description "crypto-id description";
71         iit:mountpoint "mnt-extension";
72     }
73
74     identity crypto-base {
75         description "crypto-base description";
76     }
77      
78     identity crypto-alg {
79         base "crypto-base";
80         description "crypto-alg description";
81     }
82
83     identity crypto-def {
84         base "crypto-base";
85         description "crypto-def description";
86     }
87
88     leaf mybits {
89         type bits {
90             bit disable-nagle {
91                 position 0;
92             }
93             bit auto-sense-speed {
94                 position 1;
95             }
96             bit 10-Mb-only {
97                 position 2;
98             }
99         }
100         default "auto-sense-speed";
101     }
102
103     typedef ip-version {
104         type enumeration {
105             enum unknown {
106                 description "An unknown or unspecified version of the Internet protocol.";
107             }
108             enum ipv4 {
109                 value "19";
110                 description "The IPv4 protocol as defined in RFC 791.";
111             }
112             enum ipv6 {
113                 value "7";
114                 description "The IPv6 protocol as defined in RFC 2460.";
115             }
116             enum default {
117                 description "default ip";
118             }
119         }
120     }
121
122     identity service-type {
123         description
124             "Service identity base type. All service identities must be
125              derived from this type. A service type uniquely defines a single
126              atomic API contract, such as a Java interface, a set of C
127              function declarations, or similar.
128
129              If the service type has a corresponding Java interface, the name
130              of that interface should be attached to the derived identity MUST
131              include a java-class keyword, whose name argument points to that
132              interface.";
133     }
134
135     typedef service-type-ref {
136         description
137             "Internal type of references to service type identity.";
138         type identityref {
139             base service-type;
140         }
141     }
142
143 }