blob: e8c18893798113bc9aaf9502610bc10d8469fc37 [file] [log] [blame]
Bharat saraswala5c28512016-11-10 21:09:23 +05301module IdentityTest{
Bharat saraswalc2fd3222016-10-19 16:10:27 +05302 yang-version 1;
3 namespace http://huawei.com;
Bharat saraswala5c28512016-11-10 21:09:23 +05304 prefix IdentityTest;
Bharat saraswalc2fd3222016-10-19 16:10:27 +05305
6 identity ref-address-family {
Bharat saraswala5c28512016-11-10 21:09:23 +05307 description "ref-address-family";
Bharat saraswalc2fd3222016-10-19 16:10:27 +05308 }
Bharat saraswala5c28512016-11-10 21:09:23 +05309
10 identity ipv4-address-family {
11 base ref-address-family;
12 }
13
14 identity ipv6-address-family {
15 base ipv4-address-family;
16 }
17
18 typedef tunnel-type {
Bharat saraswalc2fd3222016-10-19 16:10:27 +053019 type identityref {
20 base ref-address-family;
21 }
22 }
Bharat saraswala5c28512016-11-10 21:09:23 +053023 leaf tunnel1 {
24 type identityref {
25 base ipv4-address-family;
26 }
27 }
28
29 typedef type2 {
30 type identityref {
31 base ipv4-address-family;
32 }
33 }
34 typedef type3 {
35 type union {
36 type type2;
37 type identityref {
38 base ipv4-address-family;
39 }
40 }
41 }
42 leaf tunnel {
43 type union {
44 type type2;
45 type identityref {
46 base ipv6-address-family;
47 }
48 }
49 }
50 typedef ipv4-address {
51 type string {
52 pattern
53 '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\p{N}\p{L}]+)?';
54 }
55 description
56 "The ipv4-address type represents an IPv4 address in
57 dotted-quad notation. The IPv4 address may include a zone
58 index, separated by a % sign.
59
60 The zone index is used to disambiguate identical address
61 values. For link-local addresses, the zone index will
62 typically be the interface index number or the name of an
63 interface. If the zone index is not present, the default
64 zone of the device will be used.
65
66 The canonical format for the zone index is the numerical
67 format";
68 }
69
70}