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 | } |
Bharat saraswal | 51c5d67 | 2016-11-13 09:03:48 +0530 | [diff] [blame] | 34 | |
| 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 saraswal | a5c2851 | 2016-11-10 21:09:23 +0530 | [diff] [blame] | 45 | 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 | } |