diff options
author | Michal Cmarada <mcmarada@cisco.com> | 2018-10-09 16:08:58 +0200 |
---|---|---|
committer | Michal Cmarada <mcmarada@cisco.com> | 2018-10-10 13:38:38 +0000 |
commit | b3c731b754efc83230ea49cc579f8101b8750190 (patch) | |
tree | e9a4e82afcc7f333f6e4c53b49bdd331d8385ffe /v3po/api/src/main | |
parent | f6c5ea411cbc015f534ef0aab2c343711d3392c7 (diff) |
HC2VPP-390: Tap v2 interface API
- added support for Tap v2 in v3po yang model
- fixed pattern for tap-name
Change-Id: Id4c02d56879ca87f370396c920fb599dd7741594
Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
Diffstat (limited to 'v3po/api/src/main')
-rw-r--r-- | v3po/api/src/main/yang/v3po@2018-10-08.yang (renamed from v3po/api/src/main/yang/v3po@2018-07-03.yang) | 112 |
1 files changed, 111 insertions, 1 deletions
diff --git a/v3po/api/src/main/yang/v3po@2018-07-03.yang b/v3po/api/src/main/yang/v3po@2018-10-08.yang index bee9384cd..844390de7 100644 --- a/v3po/api/src/main/yang/v3po@2018-07-03.yang +++ b/v3po/api/src/main/yang/v3po@2018-10-08.yang @@ -48,6 +48,13 @@ module v3po { See the License for the specific language governing permissions and limitations under the License."; + revision "2018-10-08" { + description + "Revision changes: + - adds support for Tap v2 interface + - fixes tap-name pattern"; + } + revision "2018-07-03" { description "Revision changes: @@ -116,6 +123,10 @@ module v3po { base if:interface-type; } + identity tap-v2 { + base if:interface-type; + } + identity loopback { base if:interface-type; } @@ -316,7 +327,7 @@ module v3po { grouping tap-interface-base-attributes { leaf tap-name { type string{ - pattern "[a-zA-Z0-9\-;.+@$#^&*!_()=\[\]]*"; + pattern '[a-zA-Z0-9\-;.+@$#^&*!_()=\[\]]*'; } } uses interface-tag; @@ -336,6 +347,93 @@ module v3po { } } + grouping tap-v2-interface-base-attributes { + leaf id { + type uint32; + description "Interface ID."; + } + + leaf tx-ring-size { + type uint16; + description "Optional transmit ring size, default is 256 entries, must be power of 2."; + default 256; + } + + leaf rx-ring-size { + type uint16; + description "Optional receive ring size, default is 256 entries, must be power of 2."; + default 256; + } + + leaf host-mac { + type yang:phys-address; + description "Mac address to be set for the tap host interface."; + } + + leaf host-interface-name { + type string { + pattern '[a-zA-Z0-9\-;.+@$#^&*!_()=\[\]]*'; + length 1..63; + } + description "Name of the tap host interface."; + } + + leaf host-namespace { + type string { + pattern '[a-zA-Z0-9\-;.+@$#^&*!_()=\[\]]*'; + length 1..63; + } + description "Host namespace to assign this tap interface to."; + } + + leaf host-bridge { + type string { + pattern '[a-zA-Z0-9\-;.+@$#^&*!_()=\[\]]*'; + length 1..63; + } + description "Host bridge to assign this tap interface to."; + } + + leaf host-ipv4-address { + type inet:ipv4-prefix; + description "Host IPv4 address in form of IPv4Prefix."; + } + + leaf host-ipv6-address { + type inet:ipv6-prefix; + description "Host IPv6 address in form of IPv6Prefix."; + } + + uses interface-tag; + } + + grouping tap-v2-interface-config-attributes { + leaf mac { + type yang:phys-address; + description "Mac address to be set for the tap v2 interface. Random will be used if not configured."; + } + leaf host-ipv4-gateway { + type inet:ipv4-address; + description "Host IPv4 gateway address."; + } + + leaf host-ipv6-gateway { + type inet:ipv6-address; + description "Host IPv6 gateway address."; + } + } + + grouping tap-v2-interface-state-attributes { + leaf device-name { + config false; + type string{ + pattern '[a-zA-Z0-9\-;.+@$#^&*!_()=\[\]]*'; + length 1..63; + } + description "Device name of the Tap v2 interface in VPP."; + } + } + grouping loopback-interface-base-attributes { leaf mac { type yang:phys-address; @@ -647,6 +745,12 @@ module v3po { uses tap-interface-config-attributes; } + container tap-v2 { + when "../if:type = 'v3po:tap-v2'"; + uses tap-v2-interface-base-attributes; + uses tap-v2-interface-config-attributes; + } + container loopback { presence "Presence of this container indicates loopback nature of the interface"; when "../if:type = 'v3po:loopback'"; @@ -731,6 +835,12 @@ module v3po { uses tap-interface-base-attributes; } + container tap-v2 { + when "../if:type = 'v3po:tap-v2'"; + uses tap-v2-interface-base-attributes; + uses tap-v2-interface-state-attributes; + } + container ethernet { when "../if:type = 'ianaift:ethernetCsmacd'"; uses ethernet-base-attributes; |