diff options
author | Robert Varga <nite@hq.sk> | 2016-01-30 01:40:23 +0100 |
---|---|---|
committer | Robert Varga <nite@hq.sk> | 2016-01-30 03:04:26 +0100 |
commit | cdbb30f5c188a781faafefef0690fcd2903abb5c (patch) | |
tree | afc1c0e5d15dea40fe90cb89b01fe7b190a2c5ea | |
parent | 3f71cc52db28d1548d3ddb5235e717883e42c2bb (diff) |
Split out interesting bits of v3po.yang
We need to lift some elements in the v3po bridge domain configuration
configuration for reuse in the virtual bridge topology.
Also drops couple of FIXMEs for future modeling work to sanitize the
model further.
Change-Id: Id2369ff5fa967a20c39fd6959a152221ea4924f5
Signed-off-by: Robert Varga <nite@hq.sk>
-rw-r--r-- | v3po/api/src/main/yang/v3po.yang | 102 | ||||
-rw-r--r-- | v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/VppIetfInterfaceListener.java | 2 |
2 files changed, 55 insertions, 49 deletions
diff --git a/v3po/api/src/main/yang/v3po.yang b/v3po/api/src/main/yang/v3po.yang index 785e48146..43d318643 100644 --- a/v3po/api/src/main/yang/v3po.yang +++ b/v3po/api/src/main/yang/v3po.yang @@ -46,6 +46,43 @@ module v3po { base if:interface-type; } + typedef vxlan-vni { + // FIXME: should be in a vxlan-specific model + description "VNI used in a VXLAN tunnel"; + type uint32 { + range "0..16777215"; + } + } + + grouping bridge-domain-attributes { + leaf flood { + type boolean; + default true; + description + "Enable/disable L2 flooding."; + } + leaf forward { + type boolean; + default true; + description + "Enable/disable L2 forwarding."; + } + leaf learn { + type boolean; + default true; + description + "Enable/disable L2 learning."; + } + leaf unknown-unicast-flood { + type boolean; + default true; + } + leaf arp-termination { + type boolean; + default false; + } + } + augment /if:interfaces/if:interface { ext:augment-identifier "vpp-interface-augmentation"; container ethernet { @@ -68,6 +105,7 @@ module v3po { } } container vxlan { + // FIXME: this should be in an vxlan-specific extension when "../if:type = 'v3po:vxlan-tunnel'"; leaf src { @@ -80,14 +118,14 @@ module v3po { } leaf vni { /* mandatory true; */ - type uint32; + type vxlan-vni; } leaf encap-vrf-id { type uint32; } } container l2 { - description + description "Parameters for configuring Layer2 features on interfaces."; must "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " + "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))"; @@ -141,40 +179,18 @@ module v3po { container bridge-domains { list bridge-domain { key "name"; + // TODO: where does this come from? max-elements 1024; leaf name { type string; } - leaf flood { - type boolean; - default true; - description - "Enable/disable L2 flooding."; - } - leaf forward { - type boolean; - default true; - description - "Enable/disable L2 forwarding."; - } - leaf learn { - type boolean; - default true; - description - "Enable/disable L2 learning."; - } - leaf unknown-unicast-flood { - type boolean; - default true; - } - leaf arp-termination { - type boolean; - default false; - } + + uses bridge-domain-attributes; + list l2-fib { key "phys-address"; - + leaf phys-address { type yang:phys-address; } @@ -272,27 +288,16 @@ module v3po { "VPP operational data"; container bridge-domains { + // FIXME: Should this live in bridge-domain.yang in a modular fashion ? list bridge-domain { - + key "name"; leaf name { type string; } - leaf flood { - type boolean; - } - leaf unknown-unicast-flood { - type boolean; - } - leaf arp-termination { - type boolean; - } - leaf forward { - type boolean; - } - leaf learn { - type boolean; - } + + uses bridge-domain-attributes; + list interface { key "name"; @@ -308,6 +313,7 @@ module v3po { type boolean; } } + list l2-fib { key "phys-address"; @@ -333,11 +339,11 @@ module v3po { type boolean; } } - description + description "bridge-domain operational data"; } } - + container version { leaf name { type string; @@ -355,7 +361,7 @@ module v3po { "vlib version info"; } } - + rpc vpp-poll-oper-data { output { leaf status { diff --git a/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/VppIetfInterfaceListener.java b/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/VppIetfInterfaceListener.java index 7e6aa50f1..c9ad348ee 100644 --- a/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/VppIetfInterfaceListener.java +++ b/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/VppIetfInterfaceListener.java @@ -242,7 +242,7 @@ public class VppIetfInterfaceListener implements DataTreeChangeListener<Interfac int srcAddr = parseIp(srcAddress.getValue()); int dstAddr = parseIp(dstAddress.getValue()); int encapVrfId = vxlan.getEncapVrfId().intValue(); - int vni = vxlan.getVni().intValue(); + int vni = vxlan.getVni().getValue().intValue(); int ctxId = api.vxlanAddDelTunnel((byte)1 /* is add */, srcAddr, dstAddr, encapVrfId, -1, vni); String apiName = "api.vxlanAddDelTunnel"; |