| module mod8 { |
| prefix abc; |
| namespace "urn:cesnet:mod8"; |
| |
| typedef ip-address { |
| type string { |
| pattern '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+'; |
| length "7..15"; |
| } |
| } |
| |
| list interface { |
| key "name"; |
| leaf name { |
| type string; |
| } |
| leaf admin-status { |
| type admin-status; |
| default up; |
| } |
| list address { |
| key "ip"; |
| leaf ip { |
| type ip-address; |
| } |
| } |
| } |
| |
| leaf mgmt-interface { |
| type leafref { |
| path "../interface/name"; |
| } |
| } |
| |
| container default-address { |
| leaf ifname { |
| type leafref { |
| path "../../interface/name"; |
| } |
| } |
| leaf address { |
| type leafref { |
| path "../../interface[name = current()/../ifname]" |
| + "/address/ip"; |
| } |
| } |
| } |
| |
| list packet-filter { |
| key "if-name filter-id"; |
| |
| leaf if-name { |
| type leafref { |
| path "/interface/name"; |
| } |
| } |
| |
| leaf filter-id { |
| type uint32; |
| } |
| |
| leaf error { |
| type int8; |
| } |
| } |
| |
| container link-failure { |
| leaf if-name { |
| type leafref { |
| path "/interface/name"; |
| } |
| } |
| leaf admin-status { |
| type leafref { |
| path |
| "/interface[name = current()/../if-name]" |
| + "/admin-status"; |
| } |
| } |
| } |
| |
| typedef admin-status { |
| type enumeration { |
| enum up { |
| value 1; |
| description "Ready to pass packets."; |
| } |
| enum down { |
| value 2; |
| description "Not ready to pass packets and not in some test mode."; |
| } |
| enum testing { |
| value 3; |
| description "In some test mode."; |
| } |
| } |
| } |
| |
| typedef my { |
| type leafref { |
| path "../../../presence/test"; |
| } |
| } |
| |
| feature f1; |
| |
| container cont { |
| list list { |
| key keys; |
| |
| leaf keys { type string;} |
| |
| leaf ref { |
| type my; |
| if-feature f2; |
| if-feature f1; |
| } |
| |
| leaf ref1 { |
| type leafref { |
| path "../../../presence/test1"; |
| } |
| if-feature f1; |
| if-feature f2; |
| } |
| |
| leaf ref2 { |
| type leafref { |
| path "../../../presence/test2"; |
| } |
| if-feature f1; |
| if-feature f2; |
| } |
| } |
| } |
| |
| container presence { |
| leaf test { |
| if-feature f1; |
| if-feature f2; |
| type int16; |
| } |
| |
| leaf test1 { |
| if-feature f1; |
| type boolean; |
| } |
| |
| leaf test2 { |
| type string; |
| } |
| } |
| |
| feature f2; |
| } |