Mapping tap port to vpp
[groupbasedpolicy.git] / renderers / vpp / src / main / yang / vpp-renderer.yang
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 module vpp-renderer {
10     yang-version 1;
11
12     namespace "urn:opendaylight:groupbasedpolicy:vpp_renderer";
13     prefix "vpp-renderer";
14
15     import base-endpoint { prefix base-ep; revision-date 2016-04-27; }
16     import network-topology { prefix nt; revision-date 2013-10-21; }
17     import opendaylight-l2-types { prefix l2-types; revision-date "2013-08-27"; }
18     import ietf-yang-types { prefix yang-types; revision-date "2013-07-15"; }
19
20     description
21         "This module is a baseline for the group-based policy vpp renderer model.";
22
23     revision "2016-04-25" {
24         description
25             "Initial revision.";
26     }
27
28     identity network-type-base {
29         description "Base for Network Types.";
30     }
31
32     identity flat-network {
33         description "Flat Provider Network Type";
34         base network-type-base;
35     }
36
37     identity vlan-network {
38         description "VLAN Provider Network Type";
39         base network-type-base;
40     }
41
42     typedef network-type {
43         description "Type of Network.";
44         type identityref {
45             base network-type-base;
46         }
47     }
48
49     container config {
50         list vpp-endpoint {
51             description "Renderer creates/removes interface on VPP node based on given parameters.";
52
53             key "context-type context-id address-type address";
54             uses base-ep:address-endpoint-key;
55
56             leaf vpp-node-path {
57                 description "Path to a node representing mount-point to VPP instance.";
58                 mandatory true;
59                 type instance-identifier;
60             }
61             leaf vpp-interface-name {
62                 description "Name of interface for the endpoint on VPP";
63                 mandatory true;
64                 type string;
65             }
66             leaf description {
67                 description "Additional description of the vpp-endpoint";
68                 type string;
69             }
70             choice interface-type-choice {
71                 case vhost-user-case {
72                     leaf socket {
73                         description "Identifier of a vhost user";
74                         type string {
75                             length 1..255;
76                         }
77                     }
78                 }
79                 case tap-case {
80                     leaf name {
81                         description "Identifier of a tap port";
82                         mandatory true;
83                         type string {
84                             length 1..255;
85                         }
86                     }
87                     leaf physical-address {
88                         description "MAC address of a tap port";
89                         type yang-types:phys-address;
90                     }
91                 }
92             }
93         }
94
95         list bridge-domain {
96             key "id";
97             leaf id {
98                 description "Same as in VBD.";
99                 type string;
100             }
101             leaf description {
102                type string;
103             }
104             leaf type {
105                 mandatory true;
106                 type network-type;
107             }
108             leaf vlan {
109                 when "type = 'vlan-network'";
110                 type l2-types:vlan-id;
111             }
112             list physical-location-ref {
113                 description
114                     "Refers to physical interfaces on vpp nodes through which external
115                      nodes belonging to the same bridge-domain can be reached.";
116                 key "node-id";
117                 leaf node-id {
118                     description "Refers to a VPP node.";
119                     type nt:node-id;
120                 }
121                 leaf-list interface {
122                     description "Physical interface on the VPP node.";
123                     type string;
124                 }
125             }
126         }
127     }
128 }