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