blob: f4f61bd2284944f432edead1d7da4bfdb662301d [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 }
Bharat saraswal51c5d672016-11-13 09:03:48 +053034
35 container ip {
36 container ipv4-address-family {
37 leaf tunnel1 {
38 type identityref {
39 base ipv4-address-family;
40 }
41 }
42 }
43 }
44
Bharat saraswala5c28512016-11-10 21:09:23 +053045 typedef type3 {
46 type union {
47 type type2;
48 type identityref {
49 base ipv4-address-family;
50 }
51 }
52 }
53 leaf tunnel {
54 type union {
55 type type2;
56 type identityref {
57 base ipv6-address-family;
58 }
59 }
60 }
61 typedef ipv4-address {
62 type string {
63 pattern
64 '(([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}]+)?';
65 }
66 description
67 "The ipv4-address type represents an IPv4 address in
68 dotted-quad notation. The IPv4 address may include a zone
69 index, separated by a % sign.
70
71 The zone index is used to disambiguate identical address
72 values. For link-local addresses, the zone index will
73 typically be the interface index number or the name of an
74 interface. If the zone index is not present, the default
75 zone of the device will be used.
76
77 The canonical format for the zone index is the numerical
78 format";
79 }
80
81}