5d329a0b5c68043736c5d766053c3ad678ec22ed
[vpnservice.git] / vpnmanager-api / src / main / yang / odl-l3vpn.yang
1 module odl-l3vpn {
2     namespace "urn:opendaylight:l3vpn";
3     prefix odl-l3vpn;
4
5     import l3vpn { prefix l3vpn; revision-date "2014-08-15"; }
6     import ietf-interfaces { prefix if; }
7     import iana-if-type { prefix ianaift; }
8     import ietf-inet-types { prefix inet; }
9     import opendaylight-inventory { prefix inv; revision-date "2013-08-19"; }
10
11     revision "2013-09-11" {
12         description "L3 VPN Service module";
13     }
14
15     grouping next-hop-list{
16         list l3-next-hops{
17             key "ip_address";
18             leaf nextHopId { type uint32;}
19             leaf ip_address {type string;}
20             leaf label {type uint32;} /* optional */
21             leaf mac_address {type string;} /* optional */
22         }
23     }
24
25     grouping fib-list{
26         list fib-entry{
27             key "dst_prefix";
28             leaf nextHopId { type uint32;}
29             leaf dst_prefix {type inet:ipv4-prefix;}
30             leaf label {type uint32;} /* optional */
31         }
32     }
33
34     augment "/l3vpn:vpn-interfaces/l3vpn:vpn-interface" {
35         uses next-hop-list;
36     }
37
38     augment "/l3vpn:vpn-instances/l3vpn:vpn-instance" {
39         uses fib-list;
40     }
41
42     augment "/if:interfaces/if:interface" {
43         leaf portId { type inv:node-connector-id; }
44     }
45
46     identity tunnel-type-base {
47         description "Base identity for all tunnel-types";
48     }
49
50     identity tunnel-type-vxlan {
51         description "Tunnel type for vxlan tunnels";
52         base tunnel-type-base;
53     }
54
55     identity tunnel-type-gre {
56         description "Tunnel type for gre tunnels";
57         base tunnel-type-base;
58     }
59
60     grouping tunnel-type-attributes {
61         description "Common leaf for expressing tunnel-type";
62         leaf tunnel-type {
63             type identityref {
64                 base tunnel-type-base;
65             }
66         }
67     }
68
69     grouping tunnel-endpoint {
70       description
71         "Tunnel Endpoint: IP address and L4 port";
72       leaf local-ip {
73         type inet:ip-address;
74         description "Local Endpoint IP address";
75       }
76       leaf remote-ip {
77         type inet:ip-address;
78         description "Remote Endpoint IP address";
79       }
80       leaf port {
81         type inet:port-number;
82         description "Data-plane port number";
83       }
84     }
85
86     augment "/if:interfaces/if:interface" {
87         when "if:type = ianaift:tunnel";
88         uses tunnel-type-attributes;
89         uses tunnel-endpoint;
90     }
91
92     augment "/if:interfaces/if:interface" {
93         when "if:type = ianaift:l2vlan";
94         leaf vlan-id {
95           type uint16 {
96             range "1..4094";
97           }
98           description "VLAN Id to be used in VLAN Tag";
99         }
100     }
101
102 }