Bharat saraswal | a5c2851 | 2016-11-10 21:09:23 +0530 | [diff] [blame] | 1 | module IdentityTest{ |
Bharat saraswal | c2fd322 | 2016-10-19 16:10:27 +0530 | [diff] [blame] | 2 | yang-version 1; |
| 3 | namespace http://huawei.com; |
Bharat saraswal | a5c2851 | 2016-11-10 21:09:23 +0530 | [diff] [blame] | 4 | prefix IdentityTest; |
Bharat saraswal | c2fd322 | 2016-10-19 16:10:27 +0530 | [diff] [blame] | 5 | |
| 6 | identity ref-address-family { |
Bharat saraswal | a5c2851 | 2016-11-10 21:09:23 +0530 | [diff] [blame] | 7 | description "ref-address-family"; |
Bharat saraswal | c2fd322 | 2016-10-19 16:10:27 +0530 | [diff] [blame] | 8 | } |
Bharat saraswal | a5c2851 | 2016-11-10 21:09:23 +0530 | [diff] [blame] | 9 | |
| 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 saraswal | c2fd322 | 2016-10-19 16:10:27 +0530 | [diff] [blame] | 19 | type identityref { |
| 20 | base ref-address-family; |
| 21 | } |
| 22 | } |
Bharat saraswal | a5c2851 | 2016-11-10 21:09:23 +0530 | [diff] [blame] | 23 | 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 | } |