From 68f67ac93942800eb09efa92f222cb8ac592bacc Mon Sep 17 00:00:00 2001 From: Tibor Král Date: Thu, 2 May 2019 10:05:19 +0200 Subject: Enable Interface Statistics in V3PO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iffde84f2cd85e343c3c3a5943910f7c195c8d11d Signed-off-by: Tibor Král --- .../hc2vpp/l3/write/factory/Ipv4WriterFactory.java | 2 +- .../hc2vpp/l3/write/factory/Ipv6WriterFactory.java | 2 +- v3po/api/src/main/yang/v3po@2019-01-28.yang | 931 -------------------- v3po/api/src/main/yang/v3po@2019-05-02.yang | 947 +++++++++++++++++++++ v3po/postman_rest_collection.json | 110 ++- v3po/v3po2vpp/pom.xml | 9 + .../main/java/io/fd/hc2vpp/v3po/V3poModule.java | 22 + .../v3po/factory/InterfacesStateReaderFactory.java | 45 +- .../v3po/factory/InterfacesWriterFactory.java | 56 +- .../v3po/factory/L2HoneycombWriterFactory.java | 12 +- .../factory/L2StateHoneycombReaderFactory.java | 12 +- .../SubinterfaceAugmentationWriterFactory.java | 4 +- ...SubinterfaceStateAugmentationReaderFactory.java | 2 +- .../hc2vpp/v3po/interfaces/AfPacketCustomizer.java | 4 +- .../hc2vpp/v3po/interfaces/EthernetCustomizer.java | 2 +- .../fd/hc2vpp/v3po/interfaces/GreCustomizer.java | 4 +- .../v3po/interfaces/InterconnectionWriteUtils.java | 6 +- .../interfaces/InterfaceRoutingCustomizer.java | 2 +- .../interfaces/InterfacesStatisticsCustomizer.java | 70 ++ .../io/fd/hc2vpp/v3po/interfaces/L2Customizer.java | 2 +- .../hc2vpp/v3po/interfaces/LoopbackCustomizer.java | 4 +- .../hc2vpp/v3po/interfaces/RoutingCustomizer.java | 2 +- .../fd/hc2vpp/v3po/interfaces/TapV2Customizer.java | 4 +- .../v3po/interfaces/VhostUserCustomizer.java | 6 +- .../fd/hc2vpp/v3po/interfaces/VxlanCustomizer.java | 8 +- .../hc2vpp/v3po/interfaces/VxlanGpeCustomizer.java | 4 +- .../span/MirroredInterfaceCustomizer.java | 8 +- .../v3po/interfacesstate/AfPacketCustomizer.java | 18 +- .../v3po/interfacesstate/EthernetCustomizer.java | 16 +- .../hc2vpp/v3po/interfacesstate/GreCustomizer.java | 18 +- .../interfacesstate/InterconnectionReadUtils.java | 4 +- .../interfacesstate/InterfaceDataTranslator.java | 14 +- .../InterfaceRoutingCustomizer.java | 16 +- .../InterfaceStatisticsCustomizer.java | 124 +++ .../hc2vpp/v3po/interfacesstate/L2Customizer.java | 28 +- .../v3po/interfacesstate/RoutingCustomizer.java | 2 +- .../interfacesstate/SubInterfaceL2Customizer.java | 8 +- .../v3po/interfacesstate/TapV2Customizer.java | 18 +- .../v3po/interfacesstate/VhostUserCustomizer.java | 20 +- .../v3po/interfacesstate/VxlanCustomizer.java | 24 +- .../v3po/interfacesstate/VxlanGpeCustomizer.java | 22 +- .../cache/InterfaceStatisticsManager.java | 26 + .../cache/InterfaceStatisticsManagerImpl.java | 37 + .../cache/InterfaceStatisticsManagerProvider.java | 27 + .../interfacesstate/cache/JVppStatsProvider.java | 49 ++ .../span/AbstractMirroredInterfacesCustomizer.java | 12 +- .../InterfaceMirroredInterfacesCustomizer.java | 20 +- .../SubInterfaceMirroredInterfacesCustomizer.java | 14 +- .../l2/ArpTerminationTableEntryCustomizer.java | 6 +- .../fd/hc2vpp/v3po/l2/BridgeDomainCustomizer.java | 10 +- .../io/fd/hc2vpp/v3po/l2/L2FibEntryCustomizer.java | 8 +- .../v3po/l2state/BridgeDomainCustomizer.java | 20 +- .../hc2vpp/v3po/l2state/L2FibEntryCustomizer.java | 18 +- .../InterfaceChangeNotificationProducer.java | 12 +- .../java/io/fd/hc2vpp/v3po/V3poModuleTest.java | 14 +- .../v3po/interfaces/AfPacketCustomizerTest.java | 8 +- .../v3po/interfaces/EthernetCustomizerTest.java | 6 +- .../hc2vpp/v3po/interfaces/GreCustomizerTest.java | 8 +- .../interfaces/InterfaceRoutingCustomizerTest.java | 6 +- .../InterfacesStatisticsCustomizerTest.java | 74 ++ .../hc2vpp/v3po/interfaces/L2CustomizerTest.java | 16 +- .../v3po/interfaces/LoopbackCustomizerTest.java | 8 +- .../interfaces/SubInterfaceL2CustomizerTest.java | 2 +- .../v3po/interfaces/TapV2CustomizerTest.java | 8 +- .../v3po/interfaces/VhostUserCustomizerTest.java | 10 +- .../v3po/interfaces/VxlanCustomizerTest.java | 12 +- .../v3po/interfaces/VxlanGpeCustomizerTest.java | 12 +- .../span/MirroredInterfacesCustomizerTest.java | 12 +- .../interfacesstate/AfPacketCustomizerTest.java | 12 +- .../interfacesstate/EthernetCustomizerTest.java | 10 +- .../v3po/interfacesstate/GreCustomizerTest.java | 8 +- .../InterfaceDataTranslatorTest.java | 10 +- .../InterfaceRoutingCustomizerTest.java | 8 +- .../InterfaceStatisticsCustomizerTest.java | 124 +++ .../v3po/interfacesstate/L2CustomizerTest.java | 12 +- .../v3po/interfacesstate/TapV2CustomizerTest.java | 8 +- .../interfacesstate/VhostUserCustomizerTest.java | 10 +- .../v3po/interfacesstate/VxlanCustomizerTest.java | 10 +- .../interfacesstate/VxlanGpeCustomizerTest.java | 8 +- .../span/MirroredInterfacesCustomizerTest.java | 18 +- .../l2/ArpTerminationTableEntryCustomizerTest.java | 14 +- .../hc2vpp/v3po/l2/BridgeDomainCustomizerTest.java | 16 +- .../hc2vpp/v3po/l2/L2FibEntryCustomizerTest.java | 18 +- .../v3po/l2state/BridgeDomainCustomizerTest.java | 8 +- .../v3po/l2state/L2FibEntryCustomizerTest.java | 18 +- .../io/fd/hc2vpp/v3po/l2state/L2StateTest.java | 10 +- .../InterfaceChangeNotificationProducerTest.java | 4 +- 87 files changed, 2042 insertions(+), 1351 deletions(-) delete mode 100644 v3po/api/src/main/yang/v3po@2019-01-28.yang create mode 100644 v3po/api/src/main/yang/v3po@2019-05-02.yang create mode 100644 v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/InterfacesStatisticsCustomizer.java create mode 100644 v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceStatisticsCustomizer.java create mode 100644 v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/cache/InterfaceStatisticsManager.java create mode 100644 v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/cache/InterfaceStatisticsManagerImpl.java create mode 100644 v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/cache/InterfaceStatisticsManagerProvider.java create mode 100644 v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/cache/JVppStatsProvider.java create mode 100644 v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/InterfacesStatisticsCustomizerTest.java create mode 100644 v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceStatisticsCustomizerTest.java diff --git a/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/factory/Ipv4WriterFactory.java b/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/factory/Ipv4WriterFactory.java index ed6ef5ece..9268a83bc 100644 --- a/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/factory/Ipv4WriterFactory.java +++ b/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/factory/Ipv4WriterFactory.java @@ -34,7 +34,7 @@ import io.fd.honeycomb.translate.write.WriterFactory; import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder; import io.fd.jvpp.core.future.FutureJVppCore; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Routing; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Routing; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.Interface1; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.Ipv4; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.ipv4.Address; diff --git a/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/factory/Ipv6WriterFactory.java b/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/factory/Ipv6WriterFactory.java index 2ed80a725..8a6b55a77 100644 --- a/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/factory/Ipv6WriterFactory.java +++ b/l3/impl/src/main/java/io/fd/hc2vpp/l3/write/factory/Ipv6WriterFactory.java @@ -39,7 +39,7 @@ import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.nd.proxy.rev170315.NdProxyIp6Augmentation; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.nd.proxy.rev170315.interfaces._interface.ipv6.NdProxies; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.nd.proxy.rev170315.interfaces._interface.ipv6.nd.proxies.NdProxy; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Routing; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Routing; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.Interface1; diff --git a/v3po/api/src/main/yang/v3po@2019-01-28.yang b/v3po/api/src/main/yang/v3po@2019-01-28.yang deleted file mode 100644 index 9fbb6c6d3..000000000 --- a/v3po/api/src/main/yang/v3po@2019-01-28.yang +++ /dev/null @@ -1,931 +0,0 @@ -module v3po { - yang-version 1; - namespace "http://fd.io/hc2vpp/yang/v3po"; - prefix "v3po"; - - import iana-if-type { - prefix "ianaift"; - } - import ietf-interfaces { - prefix "if"; - } - import ietf-yang-types { - prefix "yang"; - } - import ietf-inet-types { - prefix "inet"; - } - import yang-ext { - prefix "ext"; - } - import vpp-fib-table-management { - prefix fib-management; - revision-date 2018-05-21; - } - - organization - "FD.io - The Fast Data Project"; - - contact - "Hc2vpp Wiki - Mailing List "; - - description - "This module contains a collection of YANG definitions - that extend ietf-interfaces module with VPP specific interface types. - - Copyright (c) 2015-2017 Cisco and/or its affiliates. - - Licensed under the Apache License, Version 2.0 (the 'License'); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at: - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an 'AS IS' BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License."; - - revision "2019-01-28" { - description - "Revision changes: - - removed deprecated tap-cli interface"; - } - - revision "2018-10-08" { - description - "Revision changes: - - adds support for Tap v2 interface - - fixes tap-name pattern"; - } - - revision "2018-07-03" { - description - "Revision changes: - - adds support for af-packet interface - - uses references to fib-management module instead of uint32 identifiers - - changes type of IP addresses from inet:ip-address to inet:ip-address-no-zone - - fixes some minor issues"; - } - - revision "2017-06-07" { - description "Eliminated config leafrefs in operational tree"; - } - - revision "2017-03-15" { - description - "Revision changes: - - acl and ietf-acl moved to vpp-interface-acl - - vpp-state and rpc moved to vpp-management - - bridge domains moved to standalone container"; - } - - revision "2016-12-14" { - description - "This revision adds the following new features: - - ingress/egress ACLs support - - moved ACL definitions to vpp-acl module - - updated l2 container constraint (permit IP address on BVI interface) - - added PID of vpp process to vpp-state - - added support for Loopback interfaces - - added support for port mirroring"; - } - - revision "2015-01-05" { - description "Initial revision of v3po model"; - } - - typedef bridge-domain-ref { - type leafref { - path "/bridge-domains/bridge-domain/name"; - } - description - "This type is used by to reference a bridge domain table"; - } - - typedef bridged-virtual-interface-ref { - type leafref { - path "/if:interfaces/if:interface/l2/bridged-virtual-interface"; - } - description - "This type is used by to reference a bridged virtual interface"; - } - - identity vxlan-tunnel { - base if:interface-type; - } - - identity gre-tunnel { - base if:interface-type; - } - - identity vhost-user { - base if:interface-type; - } - - identity tap-v2 { - base if:interface-type; - } - - identity loopback { - base if:interface-type; - } - - identity l2-fib-action { - description "Base identity for l2-fib actions"; - } - - identity l2-fib-forward { - base l2-fib-action; - description - "Forwards packet with configured mac address"; - } - - identity l2-fib-filter { - base l2-fib-action; - description - "Drops packet with configured mac address"; - } - - typedef l2-fib-action { - type identityref { - base "l2-fib-action"; - } - description "Identifies a specific L2 FIB action"; - } - - typedef vxlan-vni { - // FIXME: should be in a vxlan-specific model - description "VXLAN Network Identifier"; - type uint32 { - range "0..16777215"; - } - } - - typedef vhost-user-role { - type enumeration { - enum "server"; - enum "client"; - } - } - - identity vxlan-gpe-tunnel { - base if:interface-type; - } - - identity af-packet { - base if:interface-type; - } - - typedef vxlan-gpe-vni { - description "VNI used in a VXLAN-GPE tunnel"; - type uint32 { - range "0..16777215"; - } - } - - typedef vxlan-gpe-next-protocol { - type enumeration { - enum "ipv4" { - value 1; - } - enum "ipv6" { - value 2; - } - enum "ethernet" { - value 3; - } - enum "nsh" { - value 4; - } - } - } - - - typedef span-state { - type enumeration { - enum "receive" { - value "1"; - description - "Receive (Rx) SPAN—The goal of receive (or ingress) SPAN - is to monitor as much as possible all the packets received by the source interface. - A copy of each packet received by the source is sent to the destination port for that SPAN session. - You can monitor a series or range of ingress ports in a SPAN session."; - } - - enum "transmit" { - value "2"; - description - "Transmit (Tx) SPAN—The goal of transmit (or egress) SPAN is to monitor as much as possible all the packets - sent by the source interface after all modification and processing is performed by the switch. - A copy of each packet sent by the source is sent to the destination port for that SPAN session. - The copy is provided after the packet is modified. Monitors a range of egress ports in a SPAN session."; - } - - enum "both" { - value "3"; - description - "In a SPAN session, you can monitor a series or range of ports for both received and sent packets."; - } - } - } - - 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; - } - - container arp-termination-table { - when "../v3po:arp-termination = 'true'"; - - // TODO(HONEYCOMB-133): add support for read (after VPP-230 is done) - list arp-termination-table-entry { - key "ip-address phys-address"; - leaf ip-address { - type inet:ip-address-no-zone; - } - leaf phys-address { - type yang:phys-address; - } - } - } - } - - // TODO express constraints for L2 FIB entries in YANG if possible - grouping l2-fib-attributes { - container l2-fib-table { - list l2-fib-entry { - key "phys-address"; - - leaf phys-address { - type yang:phys-address; - } - - leaf outgoing-interface { - // either filter must be specified or interface(can't be both) - when "../action != 'l2-fib-filter'"; - type if:interface-ref; - // mandatory true; - when is not actually resolved, so mandatory can't be in place - description - "One of interfaces assigned to the FIB table's bridge-domain."; - } - leaf static-config { - type boolean; - default false; - description - "Static entries cannot be overridden by mac learning."; - } - leaf action { - type l2-fib-action; - mandatory true; - description - "L2 FIB action. For filter action, entry must be configured as static."; - } - leaf bridged-virtual-interface { - when "../action = 'l2-fib-forward'"; - type boolean; - config false; // FIXME setting bvi is currently not supported by VPP's binary api - } - } - } - } - - grouping interface-tag { - leaf tag { - type string { - length 1..63; - } - description - "ASCII string placeholder for interface metadata. Value is stored in vpp, - and returned in read requests. No processing involved."; - } - } - - 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; - mandatory false; - description "Mac address of the loopback interface"; - } - } - - grouping ethernet-base-attributes { - leaf mtu { - type uint16 { - range "64..9216"; - } - units "octets"; - default 9216; - description - "The size, in octets, of the largest packet that the - hardware interface will send and receive. - - Mapped to hw_interface_set_mtu VPP API message which programs the NIC."; - } - } - - grouping routing-base-attributes { - leaf ipv4-vrf-id { - type fib-management:fib-table-list-ref; - } - leaf ipv6-vrf-id { - type fib-management:fib-table-list-ref; - } - description - "Defines VRF tables used for ipv4 and ipv6 traffic"; - } - - grouping ethernet-state-attributes { - leaf manufacturer-description { - type string; - config false; - } - leaf duplex { - type enumeration { - enum "half"; - enum "full"; - } - config false; - } - } - - grouping vhost-user-interface-base-attributes { - leaf socket { - type string { - length 1..255; - } - } - leaf role { - type vhost-user-role; - default "server"; - } - uses interface-tag; - description "vhost-user settings"; - } - - grouping vhost-user-interface-config-attributes { - leaf device-instance { - type uint32; - mandatory false; - description "Custom device instance. Autogenerated will be used if not configured"; - } - description "vhost-user settings"; - } - - grouping vhost-user-interface-state-attributes { - leaf features { - type uint64; - config false; - } - leaf virtio-net-hdr-size { - type uint32; - config false; - } - leaf num-memory-regions { - type uint32; - config false; - } - leaf connect-error { - type string; - config false; - } - } - - /* - * Defines the supported decap node for vxlan. - */ - identity decap-node { - description - "Define the supported decap node"; - } - identity l2-input { - base decap-node; - description - "The next decap node is l2-input"; - } - identity nsh-proxy { - base decap-node; - description - "The next decap node is nsh-proxy"; - } - typedef vxlan-decap-node { - type identityref { - base "decap-node"; - } - } - grouping vxlan-base-attributes { - // FIXME: this should be in an vxlan-specific extension - leaf src { - /*mandatory true;*/ - type inet:ip-address-no-zone; - } - leaf dst { - /*mandatory true;*/ - type inet:ip-address-no-zone; - } - leaf vni { - /*mandatory true;*/ - type vxlan-vni; - } - leaf encap-vrf-id { - /*mandatory true;*/ - type fib-management:fib-table-list-ref; - } - leaf decap-next { - type vxlan-decap-node; - default "l2-input"; - } - } - - grouping gre-base-attributes { - leaf src { - /*mandatory true;*/ - type inet:ip-address-no-zone; - } - leaf dst { - /*mandatory true;*/ - type inet:ip-address-no-zone; - } - leaf outer-fib-id { - type uint32; - } - } - - grouping vxlan-gpe-base-attributes { - leaf local { - /*mandatory true;*/ - type inet:ip-address-no-zone; - } - leaf remote { - /*mandatory true;*/ - type inet:ip-address-no-zone; - } - leaf vni { - /*mandatory true;*/ - type vxlan-gpe-vni; - } - leaf next-protocol { - type vxlan-gpe-next-protocol; - } - leaf encap-vrf-id { - type uint32; - } - leaf decap-vrf-id { - type uint32; - } - } - - grouping af-packet-base-attributes { - leaf host-interface-name { - type string { - length "1..63"; - } - /* mandatory true; */ - description "Name of the host interface (veth end point)."; - } - leaf mac { - type yang:phys-address; - mandatory false; - description "Mac address to be set for the af-packet interface. Random will be used if not configured."; - } - reference - "https://docs.fd.io/vpp/18.07/clicmd_src_vnet_devices_af_packet.html"; - } - - grouping l2-config-attributes { - description - "Parameters for configuring Layer2 features on interfaces."; - - choice interconnection { - case xconnect-based { - leaf xconnect-outgoing-interface { - /* Don't allow selection of this interface */ - must "../../if:name != current()"; - type if:interface-ref; - description - "L2 xconnect mode"; - } - } - case bridge-based { - uses bridge-based-attributes; - } - } - } - - grouping l2-state-attributes { - description - "Parameters for configuring Layer2 features on interfaces."; - - choice interconnection { - case xconnect-based { - leaf xconnect-outgoing-interface { - /* Don't allow selection of this interface */ - must "../../if:name != current()"; - type if:interface-state-ref; - description - "L2 xconnect mode"; - } - } - case bridge-based { - uses bridge-based-attributes; - } - } - } - - grouping bridge-based-attributes { - leaf bridge-domain { - type bridge-domain-ref; - mandatory true; - description - "Interfaces in a bridge-domain forward packets to other - interfaces in the same bridge-domain based on - destination mac address."; - } - leaf split-horizon-group { - when "../bridge-domain"; - type uint8 { - range "0..255"; - } - default 0; //no split horizon group - description - "Interface's split-horizon group. Interfaces in the same - bridge-domain and split-horizon group can not forward - packets between each other. "; - } - leaf bridged-virtual-interface { - when "../bridge-domain"; - type boolean; - default false; - description - "Interface forward packets in the bridge-domain - associated with the BVI."; - } - } - - grouping span-attributes { - description "Parameters of the SPAN feature"; - - container mirrored-interfaces { - list mirrored-interface { - key "iface-ref"; - leaf iface-ref { - type if:interface-ref; - } - - leaf state { - type span-state; - mandatory true; - } - } - } - } - - grouping span-state-attributes { - description "Parameters of the SPAN feature"; - - container mirrored-interfaces { - list mirrored-interface { - key "iface-ref"; - leaf iface-ref { - type if:interface-state-ref; - } - - leaf state { - type span-state; - mandatory true; - } - } - } - } - - augment /if:interfaces/if:interface { - ext:augment-identifier "vpp-interface-augmentation"; - - // FIXME using ietf-interfaces model for vpp interfaces makes it hard to implement because: - // 1. The link between interface type and this augmentation is unclear - // 2. Only this augmentation with combination of ifc type is trigger to do something for vpp, what if user only configures base interface stuff ? + We need to get leaves defined by ietf-interfaces when we are processing this augment - // 3. The ietf-interfaces model does not define groupings which makes types reuse difficult - - 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'"; - uses loopback-interface-base-attributes; - } - - container ethernet { - when "../if:type = 'ianaift:ethernetCsmacd'"; - uses ethernet-base-attributes; - } - - container routing { - uses routing-base-attributes; - } - - container vhost-user { - when "../if:type = 'v3po:vhost-user'"; - uses vhost-user-interface-base-attributes; - uses vhost-user-interface-config-attributes; - } - - container vxlan { - when "../if:type = 'v3po:vxlan-tunnel'"; - uses vxlan-base-attributes; - } - - container gre { - when "../if:type = 'v3po:gre-tunnel'"; - uses gre-base-attributes; - } - - container l2 { - must "bridged-virtual-interface = 'true' or " + - "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " + - "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))"; - - uses l2-config-attributes; - } - - container vxlan-gpe { - when "../if:type = 'v3po:vxlan-gpe-tunnel'"; - - uses vxlan-gpe-base-attributes; - } - - container af-packet { - when "../if:type = 'v3po:af-packet'"; - uses af-packet-base-attributes; - } - - container span { - uses span-attributes; - } - } - - container bridge-domains { - presence "Bridge domains configuration"; - list bridge-domain { - key "name"; - - leaf name { - type string; - } - - uses bridge-domain-attributes; - uses l2-fib-attributes; - - description - "bridge-domain configuration"; - } - } - - augment /if:interfaces-state/if:interface { - ext:augment-identifier "vpp-interface-state-augmentation"; - - leaf description { - type string; - } - - 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; - uses ethernet-state-attributes; - } - - container routing { - uses routing-base-attributes; - } - - container vhost-user { - when "../if:type = 'v3po:vhost-user'"; - uses vhost-user-interface-base-attributes; - uses vhost-user-interface-state-attributes; - } - - container vxlan { - when "../if:type = 'v3po:vxlan-tunnel'"; - uses vxlan-base-attributes; - } - container vxlan-gpe { - when "../if:type = 'v3po:vxlan-gpe-tunnel'"; - - uses vxlan-gpe-base-attributes; - } - - container gre { - when "../if:type = 'gre-tunnel'"; - uses gre-base-attributes; - } - - container l2 { - must "bridged-virtual-interface = 'true' or " + - "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " + - "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))"; - - uses l2-state-attributes; - } - - container af-packet { - when "../if:type = 'v3po:af-packet'"; - uses af-packet-base-attributes; - } - - container span { - uses span-state-attributes; - } - } - - augment /if:interfaces-state/if:interface/if:statistics { - ext:augment-identifier "vpp-interface-statistics-augmentation"; - leaf in-errors-no-buf { - type yang:counter64; - } - leaf in-errors-miss { - type yang:counter64; - } - leaf out-discards-fifo-full { - type yang:counter64; - } - } - - container bridge-domains-state { - // FIXME: Should this live in bridge-domain.yang in a modular fashion ? - config "false"; - list bridge-domain { - - key "name"; - leaf name { - type string; - } - - uses bridge-domain-attributes; - uses l2-fib-attributes; - - description - "bridge-domain operational data"; - } - } - - // VPP Notifications - - typedef interface-status { - type enumeration { - enum up { - value 1; - } - enum down { - value 0; - } - } - } - - typedef interface-name-or-index { - type union { - type string; - type uint32; - } - } - - notification interface-state-change { - leaf name { - type interface-name-or-index; - } - - leaf admin-status { - type interface-status; - } - - leaf oper-status { - type interface-status; - } - } - - notification interface-deleted { - leaf name { - type interface-name-or-index; - } - } -} diff --git a/v3po/api/src/main/yang/v3po@2019-05-02.yang b/v3po/api/src/main/yang/v3po@2019-05-02.yang new file mode 100644 index 000000000..50112385b --- /dev/null +++ b/v3po/api/src/main/yang/v3po@2019-05-02.yang @@ -0,0 +1,947 @@ +module v3po { + yang-version 1; + namespace "http://fd.io/hc2vpp/yang/v3po"; + prefix "v3po"; + + import iana-if-type { + prefix "ianaift"; + } + import ietf-interfaces { + prefix "if"; + } + import ietf-yang-types { + prefix "yang"; + } + import ietf-inet-types { + prefix "inet"; + } + import yang-ext { + prefix "ext"; + } + import vpp-fib-table-management { + prefix fib-management; + revision-date 2018-05-21; + } + + organization + "FD.io - The Fast Data Project"; + + contact + "Hc2vpp Wiki + Mailing List "; + + description + "This module contains a collection of YANG definitions + that extend ietf-interfaces module with VPP specific interface types. + + Copyright (c) 2015-2017 Cisco and/or its affiliates. + + Licensed under the Apache License, Version 2.0 (the 'License'); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an 'AS IS' BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License."; + + revision "2019-05-02" { + description + "Revision changes: + - added boolean flag for enabling/disabling statistics collection"; + } + + revision "2019-01-28" { + description + "Revision changes: + - removed deprecated tap-cli interface"; + } + + revision "2018-10-08" { + description + "Revision changes: + - adds support for Tap v2 interface + - fixes tap-name pattern"; + } + + revision "2018-07-03" { + description + "Revision changes: + - adds support for af-packet interface + - uses references to fib-management module instead of uint32 identifiers + - changes type of IP addresses from inet:ip-address to inet:ip-address-no-zone + - fixes some minor issues"; + } + + revision "2017-06-07" { + description "Eliminated config leafrefs in operational tree"; + } + + revision "2017-03-15" { + description + "Revision changes: + - acl and ietf-acl moved to vpp-interface-acl + - vpp-state and rpc moved to vpp-management + - bridge domains moved to standalone container"; + } + + revision "2016-12-14" { + description + "This revision adds the following new features: + - ingress/egress ACLs support + - moved ACL definitions to vpp-acl module + - updated l2 container constraint (permit IP address on BVI interface) + - added PID of vpp process to vpp-state + - added support for Loopback interfaces + - added support for port mirroring"; + } + + revision "2015-01-05" { + description "Initial revision of v3po model"; + } + + typedef bridge-domain-ref { + type leafref { + path "/bridge-domains/bridge-domain/name"; + } + description + "This type is used by to reference a bridge domain table"; + } + + typedef bridged-virtual-interface-ref { + type leafref { + path "/if:interfaces/if:interface/l2/bridged-virtual-interface"; + } + description + "This type is used by to reference a bridged virtual interface"; + } + + identity vxlan-tunnel { + base if:interface-type; + } + + identity gre-tunnel { + base if:interface-type; + } + + identity vhost-user { + base if:interface-type; + } + + identity tap-v2 { + base if:interface-type; + } + + identity loopback { + base if:interface-type; + } + + identity l2-fib-action { + description "Base identity for l2-fib actions"; + } + + identity l2-fib-forward { + base l2-fib-action; + description + "Forwards packet with configured mac address"; + } + + identity l2-fib-filter { + base l2-fib-action; + description + "Drops packet with configured mac address"; + } + + typedef l2-fib-action { + type identityref { + base "l2-fib-action"; + } + description "Identifies a specific L2 FIB action"; + } + + typedef vxlan-vni { + // FIXME: should be in a vxlan-specific model + description "VXLAN Network Identifier"; + type uint32 { + range "0..16777215"; + } + } + + typedef vhost-user-role { + type enumeration { + enum "server"; + enum "client"; + } + } + + identity vxlan-gpe-tunnel { + base if:interface-type; + } + + identity af-packet { + base if:interface-type; + } + + typedef vxlan-gpe-vni { + description "VNI used in a VXLAN-GPE tunnel"; + type uint32 { + range "0..16777215"; + } + } + + typedef vxlan-gpe-next-protocol { + type enumeration { + enum "ipv4" { + value 1; + } + enum "ipv6" { + value 2; + } + enum "ethernet" { + value 3; + } + enum "nsh" { + value 4; + } + } + } + + + typedef span-state { + type enumeration { + enum "receive" { + value "1"; + description + "Receive (Rx) SPAN—The goal of receive (or ingress) SPAN + is to monitor as much as possible all the packets received by the source interface. + A copy of each packet received by the source is sent to the destination port for that SPAN session. + You can monitor a series or range of ingress ports in a SPAN session."; + } + + enum "transmit" { + value "2"; + description + "Transmit (Tx) SPAN—The goal of transmit (or egress) SPAN is to monitor as much as possible all the packets + sent by the source interface after all modification and processing is performed by the switch. + A copy of each packet sent by the source is sent to the destination port for that SPAN session. + The copy is provided after the packet is modified. Monitors a range of egress ports in a SPAN session."; + } + + enum "both" { + value "3"; + description + "In a SPAN session, you can monitor a series or range of ports for both received and sent packets."; + } + } + } + + 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; + } + + container arp-termination-table { + when "../v3po:arp-termination = 'true'"; + + // TODO(HONEYCOMB-133): add support for read (after VPP-230 is done) + list arp-termination-table-entry { + key "ip-address phys-address"; + leaf ip-address { + type inet:ip-address-no-zone; + } + leaf phys-address { + type yang:phys-address; + } + } + } + } + + // TODO express constraints for L2 FIB entries in YANG if possible + grouping l2-fib-attributes { + container l2-fib-table { + list l2-fib-entry { + key "phys-address"; + + leaf phys-address { + type yang:phys-address; + } + + leaf outgoing-interface { + // either filter must be specified or interface(can't be both) + when "../action != 'l2-fib-filter'"; + type if:interface-ref; + // mandatory true; - when is not actually resolved, so mandatory can't be in place + description + "One of interfaces assigned to the FIB table's bridge-domain."; + } + leaf static-config { + type boolean; + default false; + description + "Static entries cannot be overridden by mac learning."; + } + leaf action { + type l2-fib-action; + mandatory true; + description + "L2 FIB action. For filter action, entry must be configured as static."; + } + leaf bridged-virtual-interface { + when "../action = 'l2-fib-forward'"; + type boolean; + config false; // FIXME setting bvi is currently not supported by VPP's binary api + } + } + } + } + + grouping interface-tag { + leaf tag { + type string { + length 1..63; + } + description + "ASCII string placeholder for interface metadata. Value is stored in vpp, + and returned in read requests. No processing involved."; + } + } + + 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; + mandatory false; + description "Mac address of the loopback interface"; + } + } + + grouping ethernet-base-attributes { + leaf mtu { + type uint16 { + range "64..9216"; + } + units "octets"; + default 9216; + description + "The size, in octets, of the largest packet that the + hardware interface will send and receive. + + Mapped to hw_interface_set_mtu VPP API message which programs the NIC."; + } + } + + grouping routing-base-attributes { + leaf ipv4-vrf-id { + type fib-management:fib-table-list-ref; + } + leaf ipv6-vrf-id { + type fib-management:fib-table-list-ref; + } + description + "Defines VRF tables used for ipv4 and ipv6 traffic"; + } + + grouping ethernet-state-attributes { + leaf manufacturer-description { + type string; + config false; + } + leaf duplex { + type enumeration { + enum "half"; + enum "full"; + } + config false; + } + } + + grouping vhost-user-interface-base-attributes { + leaf socket { + type string { + length 1..255; + } + } + leaf role { + type vhost-user-role; + default "server"; + } + uses interface-tag; + description "vhost-user settings"; + } + + grouping vhost-user-interface-config-attributes { + leaf device-instance { + type uint32; + mandatory false; + description "Custom device instance. Autogenerated will be used if not configured"; + } + description "vhost-user settings"; + } + + grouping vhost-user-interface-state-attributes { + leaf features { + type uint64; + config false; + } + leaf virtio-net-hdr-size { + type uint32; + config false; + } + leaf num-memory-regions { + type uint32; + config false; + } + leaf connect-error { + type string; + config false; + } + } + + /* + * Defines the supported decap node for vxlan. + */ + identity decap-node { + description + "Define the supported decap node"; + } + identity l2-input { + base decap-node; + description + "The next decap node is l2-input"; + } + identity nsh-proxy { + base decap-node; + description + "The next decap node is nsh-proxy"; + } + typedef vxlan-decap-node { + type identityref { + base "decap-node"; + } + } + grouping vxlan-base-attributes { + // FIXME: this should be in an vxlan-specific extension + leaf src { + /*mandatory true;*/ + type inet:ip-address-no-zone; + } + leaf dst { + /*mandatory true;*/ + type inet:ip-address-no-zone; + } + leaf vni { + /*mandatory true;*/ + type vxlan-vni; + } + leaf encap-vrf-id { + /*mandatory true;*/ + type fib-management:fib-table-list-ref; + } + leaf decap-next { + type vxlan-decap-node; + default "l2-input"; + } + } + + grouping gre-base-attributes { + leaf src { + /*mandatory true;*/ + type inet:ip-address-no-zone; + } + leaf dst { + /*mandatory true;*/ + type inet:ip-address-no-zone; + } + leaf outer-fib-id { + type uint32; + } + } + + grouping vxlan-gpe-base-attributes { + leaf local { + /*mandatory true;*/ + type inet:ip-address-no-zone; + } + leaf remote { + /*mandatory true;*/ + type inet:ip-address-no-zone; + } + leaf vni { + /*mandatory true;*/ + type vxlan-gpe-vni; + } + leaf next-protocol { + type vxlan-gpe-next-protocol; + } + leaf encap-vrf-id { + type uint32; + } + leaf decap-vrf-id { + type uint32; + } + } + + grouping af-packet-base-attributes { + leaf host-interface-name { + type string { + length "1..63"; + } + /* mandatory true; */ + description "Name of the host interface (veth end point)."; + } + leaf mac { + type yang:phys-address; + mandatory false; + description "Mac address to be set for the af-packet interface. Random will be used if not configured."; + } + reference + "https://docs.fd.io/vpp/18.07/clicmd_src_vnet_devices_af_packet.html"; + } + + grouping l2-config-attributes { + description + "Parameters for configuring Layer2 features on interfaces."; + + choice interconnection { + case xconnect-based { + leaf xconnect-outgoing-interface { + /* Don't allow selection of this interface */ + must "../../if:name != current()"; + type if:interface-ref; + description + "L2 xconnect mode"; + } + } + case bridge-based { + uses bridge-based-attributes; + } + } + } + + grouping l2-state-attributes { + description + "Parameters for configuring Layer2 features on interfaces."; + + choice interconnection { + case xconnect-based { + leaf xconnect-outgoing-interface { + /* Don't allow selection of this interface */ + must "../../if:name != current()"; + type if:interface-state-ref; + description + "L2 xconnect mode"; + } + } + case bridge-based { + uses bridge-based-attributes; + } + } + } + + grouping bridge-based-attributes { + leaf bridge-domain { + type bridge-domain-ref; + mandatory true; + description + "Interfaces in a bridge-domain forward packets to other + interfaces in the same bridge-domain based on + destination mac address."; + } + leaf split-horizon-group { + when "../bridge-domain"; + type uint8 { + range "0..255"; + } + default 0; //no split horizon group + description + "Interface's split-horizon group. Interfaces in the same + bridge-domain and split-horizon group can not forward + packets between each other. "; + } + leaf bridged-virtual-interface { + when "../bridge-domain"; + type boolean; + default false; + description + "Interface forward packets in the bridge-domain + associated with the BVI."; + } + } + + grouping span-attributes { + description "Parameters of the SPAN feature"; + + container mirrored-interfaces { + list mirrored-interface { + key "iface-ref"; + leaf iface-ref { + type if:interface-ref; + } + + leaf state { + type span-state; + mandatory true; + } + } + } + } + + grouping span-state-attributes { + description "Parameters of the SPAN feature"; + + container mirrored-interfaces { + list mirrored-interface { + key "iface-ref"; + leaf iface-ref { + type if:interface-state-ref; + } + + leaf state { + type span-state; + mandatory true; + } + } + } + } + + augment /if:interfaces/if:interface { + ext:augment-identifier "vpp-interface-augmentation"; + + // FIXME using ietf-interfaces model for vpp interfaces makes it hard to implement because: + // 1. The link between interface type and this augmentation is unclear + // 2. Only this augmentation with combination of ifc type is trigger to do something for vpp, what if user only configures base interface stuff ? + We need to get leaves defined by ietf-interfaces when we are processing this augment + // 3. The ietf-interfaces model does not define groupings which makes types reuse difficult + + 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'"; + uses loopback-interface-base-attributes; + } + + container ethernet { + when "../if:type = 'ianaift:ethernetCsmacd'"; + uses ethernet-base-attributes; + } + + container routing { + uses routing-base-attributes; + } + + container vhost-user { + when "../if:type = 'v3po:vhost-user'"; + uses vhost-user-interface-base-attributes; + uses vhost-user-interface-config-attributes; + } + + container vxlan { + when "../if:type = 'v3po:vxlan-tunnel'"; + uses vxlan-base-attributes; + } + + container gre { + when "../if:type = 'v3po:gre-tunnel'"; + uses gre-base-attributes; + } + + container l2 { + must "bridged-virtual-interface = 'true' or " + + "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " + + "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))"; + + uses l2-config-attributes; + } + + container vxlan-gpe { + when "../if:type = 'v3po:vxlan-gpe-tunnel'"; + + uses vxlan-gpe-base-attributes; + } + + container af-packet { + when "../if:type = 'v3po:af-packet'"; + uses af-packet-base-attributes; + } + + container span { + uses span-attributes; + } + } + + container bridge-domains { + presence "Bridge domains configuration"; + list bridge-domain { + key "name"; + + leaf name { + type string; + } + + uses bridge-domain-attributes; + uses l2-fib-attributes; + + description + "bridge-domain configuration"; + } + } + + augment /if:interfaces-state/if:interface { + ext:augment-identifier "vpp-interface-state-augmentation"; + + leaf description { + type string; + } + + 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; + uses ethernet-state-attributes; + } + + container routing { + uses routing-base-attributes; + } + + container vhost-user { + when "../if:type = 'v3po:vhost-user'"; + uses vhost-user-interface-base-attributes; + uses vhost-user-interface-state-attributes; + } + + container vxlan { + when "../if:type = 'v3po:vxlan-tunnel'"; + uses vxlan-base-attributes; + } + container vxlan-gpe { + when "../if:type = 'v3po:vxlan-gpe-tunnel'"; + + uses vxlan-gpe-base-attributes; + } + + container gre { + when "../if:type = 'gre-tunnel'"; + uses gre-base-attributes; + } + + container l2 { + must "bridged-virtual-interface = 'true' or " + + "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " + + "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))"; + + uses l2-state-attributes; + } + + container af-packet { + when "../if:type = 'v3po:af-packet'"; + uses af-packet-base-attributes; + } + + container span { + uses span-state-attributes; + } + } + + augment /if:interfaces { + ext:augment-identifier "vpp-interfaces-stats-augmentation"; + container statistics{ + leaf enabled { + type boolean; + default false; + } + } + } + + augment /if:interfaces-state/if:interface/if:statistics { + ext:augment-identifier "vpp-interface-statistics-augmentation"; + leaf in-errors-no-buf { + type yang:counter64; + } + leaf in-errors-miss { + type yang:counter64; + } + leaf out-discards-fifo-full { + type yang:counter64; + } + } + + container bridge-domains-state { + // FIXME: Should this live in bridge-domain.yang in a modular fashion ? + config "false"; + list bridge-domain { + + key "name"; + leaf name { + type string; + } + + uses bridge-domain-attributes; + uses l2-fib-attributes; + + description + "bridge-domain operational data"; + } + } + + // VPP Notifications + + typedef interface-status { + type enumeration { + enum up { + value 1; + } + enum down { + value 0; + } + } + } + + typedef interface-name-or-index { + type union { + type string; + type uint32; + } + } + + notification interface-state-change { + leaf name { + type interface-name-or-index; + } + + leaf admin-status { + type interface-status; + } + + leaf oper-status { + type interface-status; + } + } + + notification interface-deleted { + leaf name { + type interface-name-or-index; + } + } +} diff --git a/v3po/postman_rest_collection.json b/v3po/postman_rest_collection.json index 5fe995c11..c4eb4f9c9 100644 --- a/v3po/postman_rest_collection.json +++ b/v3po/postman_rest_collection.json @@ -1,6 +1,6 @@ { "info": { - "_postman_id": "b7fd7461-3b63-40ed-9aee-dd9668109865", + "_postman_id": "f5f60790-000e-4a74-ae07-725cfaeaa0f6", "name": "Honeycomb V3PO RESTCONF calls", "description": "Common mgmt operations on VPP core using Honeycomb REST interface", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" @@ -141,7 +141,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"bridge-domain\": [\r\n {\r\n \"name\": \"testBD\",\r\n \"flood\": \"true\",\r\n \"forward\": \"false\",\r\n \"learn\": \"false\",\r\n \"unknown-unicast-flood\": \"false\",\r\n \"arp-termination\": \"false\"\r\n }\r\n ]\r\n}" + "raw": "" }, "url": { "raw": "http://localhost:8183/restconf/config/v3po:bridge-domains/bridge-domain/testBD", @@ -178,7 +178,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"bridge-domain\": [\r\n {\r\n \"name\": \"testBD\",\r\n \"flood\": \"true\",\r\n \"forward\": \"false\",\r\n \"learn\": \"false\",\r\n \"unknown-unicast-flood\": \"false\",\r\n \"arp-termination\": \"false\"\r\n }\r\n ]\r\n}" + "raw": "" }, "url": { "raw": "http://localhost:8183/restconf/operational/v3po:bridge-domains-state/bridge-domain/testBD", @@ -614,7 +614,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"testInterface\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"link-up-down-trap-enable\": \"enabled\",\r\n \"ietf-ip:ipv4\": {\r\n \"enabled\": \"true\",\r\n \"mtu\": \"1500\",\r\n \"address\": [\r\n {\r\n \"ip\": \"1.2.3.0\",\r\n \"netmask\": \"255.255.255.0\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n \r\n}" + "raw": "" }, "url": { "raw": "http://localhost:8183/restconf/operational/naming-context:contexts", @@ -649,7 +649,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"testInterface\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"link-up-down-trap-enable\": \"enabled\",\r\n \"ietf-ip:ipv4\": {\r\n \"enabled\": \"true\",\r\n \"mtu\": \"1500\",\r\n \"address\": [\r\n {\r\n \"ip\": \"1.2.3.0\",\r\n \"netmask\": \"255.255.255.0\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n \r\n}" + "raw": "" }, "url": { "raw": "http://localhost:8183/restconf/operational/v3po-context:disabled-interfaces", @@ -684,7 +684,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"testInterface\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"link-up-down-trap-enable\": \"enabled\",\r\n \"ietf-ip:ipv4\": {\r\n \"enabled\": \"true\",\r\n \"mtu\": \"1500\",\r\n \"address\": [\r\n {\r\n \"ip\": \"1.2.3.0\",\r\n \"netmask\": \"255.255.255.0\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n \r\n}" + "raw": "" }, "url": { "raw": "http://localhost:8183/restconf/operational/vpp-classifier-context:vpp-classifier-context", @@ -760,7 +760,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"testInterface\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"link-up-down-trap-enable\": \"enabled\",\r\n \"ietf-ip:ipv4\": {\r\n \"enabled\": \"true\",\r\n \"mtu\": \"1500\",\r\n \"address\": [\r\n {\r\n \"ip\": \"1.2.3.0\",\r\n \"netmask\": \"255.255.255.0\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n \r\n}" + "raw": "" }, "url": { "raw": "http://localhost:8183/restconf/config/ietf-interfaces:interfaces/interface/GigabitEthernet0%2F8%2F0", @@ -797,7 +797,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"testInterface\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"link-up-down-trap-enable\": \"enabled\",\r\n \"ietf-ip:ipv4\": {\r\n \"enabled\": \"true\",\r\n \"mtu\": \"1500\",\r\n \"address\": [\r\n {\r\n \"ip\": \"1.2.3.0\",\r\n \"netmask\": \"255.255.255.0\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n \r\n}" + "raw": "" }, "url": { "raw": "http://localhost:8183/restconf/operational/ietf-interfaces:interfaces-state/interface/GigabitEthernet0%2F8%2F0", @@ -990,7 +990,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"interface\": [\r\n {\r\n \"name\": \"local0\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"pbb-rewrite\":{\r\n \t\"destination-address\":\"aa:aa:aa:aa:aa:aa\",\r\n \t\"source-address\":\"bb:bb:bb:bb:bb:bb\",\r\n \t\"b-vlan-tag-vlan-id\":\"26\",\r\n \t\"i-tag-isid\":\"27\",\r\n \t\"interface-operation\":\"translate-2-1\"\r\n }\r\n }\r\n ]\r\n}" + "raw": "" }, "url": { "raw": "http://localhost:8183/restconf/config/ietf-interfaces:interfaces/interface/local0", @@ -1067,7 +1067,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \n \"interface\":{\n \"name\":\"GigabitEthernet0/8/0\",\n \"type\": \"iana-if-type:ethernetCsmacd\",\n \"enabled\":\"true\",\n \"ipv4\":{\n \"neighbor\":{\n \"ip\":\"172.16.0.2\",\n \"link-layer-address\":\"00:01:11:00:02:02\"\n }\n }\n }\n}\n" + "raw": "" }, "url": { "raw": "http://localhost:8183/restconf/config/ietf-interfaces:interfaces/interface/GigabitEthernet0%2F8%2F0/ipv4/neighbor/172.16.0.2", @@ -1187,7 +1187,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"testInterface\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"link-up-down-trap-enable\": \"enabled\",\r\n \"ietf-ip:ipv4\": {\r\n \"enabled\": \"true\",\r\n \"mtu\": \"1500\",\r\n \"address\": [\r\n {\r\n \"ip\": \"1.2.3.0\",\r\n \"netmask\": \"255.255.255.0\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n \r\n}" + "raw": "" }, "url": { "raw": "http://localhost:8183/restconf/operational/ietf-interfaces:interfaces-state/interface/local0", @@ -1340,7 +1340,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"testInterface\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"link-up-down-trap-enable\": \"enabled\",\r\n \"ietf-ip:ipv4\": {\r\n \"enabled\": \"true\",\r\n \"mtu\": \"1500\",\r\n \"address\": [\r\n {\r\n \"ip\": \"1.2.3.0\",\r\n \"netmask\": \"255.255.255.0\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n \r\n}" + "raw": "" }, "url": { "raw": "http://localhost:8183/restconf/operational/ietf-interfaces:interfaces-state/interface/local0/ipv4", @@ -1377,7 +1377,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"testInterface\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"link-up-down-trap-enable\": \"enabled\",\r\n \"ietf-ip:ipv4\": {\r\n \"enabled\": \"true\",\r\n \"mtu\": \"1500\",\r\n \"address\": [\r\n {\r\n \"ip\": \"1.2.3.0\",\r\n \"netmask\": \"255.255.255.0\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n \r\n}" + "raw": "" }, "url": { "raw": "http://localhost:8183/restconf/config/ietf-interfaces:interfaces/interface/local0/ipv4", @@ -1599,6 +1599,86 @@ } ] }, + { + "name": "STATISTICS", + "item": [ + { + "name": "Enable statistics collection", + "request": { + "method": "PUT", + "header": [ + { + "key": "Authorization", + "value": "Basic YWRtaW46YWRtaW4=" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"statistics\": {\r\n \t\"enabled\": \"true\"\r\n }\r\n}" + }, + "url": { + "raw": "http://localhost:8183/restconf/config/ietf-interfaces:interfaces/statistics", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8183", + "path": [ + "restconf", + "config", + "ietf-interfaces:interfaces", + "statistics" + ] + }, + "description": "Enables/Disables statistics collection" + }, + "response": [] + }, + { + "name": "List TapV2 interface statistics", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Basic YWRtaW46YWRtaW4=" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://localhost:8183/restconf/operational/ietf-interfaces:interfaces-state/interface/tap-v2/statistics/", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8183", + "path": [ + "restconf", + "operational", + "ietf-interfaces:interfaces-state", + "interface", + "tap-v2", + "statistics", + "" + ] + }, + "description": "Lists statistics of selected interface. In this case it is TapV2 interface." + }, + "response": [] + } + ] + }, { "name": "TAPV2", "item": [ @@ -2482,7 +2562,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"testInterface\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"link-up-down-trap-enable\": \"enabled\",\r\n \"ietf-ip:ipv4\": {\r\n \"enabled\": \"true\",\r\n \"mtu\": \"1500\",\r\n \"address\": [\r\n {\r\n \"ip\": \"1.2.3.0\",\r\n \"netmask\": \"255.255.255.0\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n \r\n}" + "raw": "" }, "url": { "raw": "http://localhost:8183/restconf/config/ietf-interfaces:interfaces/", @@ -2518,7 +2598,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \r\n \"interface\": [\r\n {\r\n \"name\": \"testInterface\",\r\n \"description\": \"for testing purposes\",\r\n \"type\": \"iana-if-type:ethernetCsmacd\",\r\n \"enabled\": \"true\",\r\n \"link-up-down-trap-enable\": \"enabled\",\r\n \"ietf-ip:ipv4\": {\r\n \"enabled\": \"true\",\r\n \"mtu\": \"1500\",\r\n \"address\": [\r\n {\r\n \"ip\": \"1.2.3.0\",\r\n \"netmask\": \"255.255.255.0\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n \r\n}" + "raw": "" }, "url": { "raw": "http://localhost:8183/restconf/operational/ietf-interfaces:interfaces-state/", diff --git a/v3po/v3po2vpp/pom.xml b/v3po/v3po2vpp/pom.xml index 0b19eb509..9572ed16e 100644 --- a/v3po/v3po2vpp/pom.xml +++ b/v3po/v3po2vpp/pom.xml @@ -35,6 +35,10 @@ io.fd.honeycomb cfg-init + + io.fd.honeycomb + binding-init + io.fd.honeycomb translate-impl @@ -70,6 +74,11 @@ io.fd.jvpp jvpp-core + + io.fd.jvpp + jvpp-stats + ${jvpp.version} + diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/V3poModule.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/V3poModule.java index b12893955..4bd4cca4a 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/V3poModule.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/V3poModule.java @@ -16,7 +16,9 @@ package io.fd.hc2vpp.v3po; +import com.google.common.annotations.VisibleForTesting; import com.google.inject.AbstractModule; +import com.google.inject.Provider; import com.google.inject.Singleton; import com.google.inject.multibindings.Multibinder; import com.google.inject.name.Names; @@ -29,16 +31,31 @@ import io.fd.hc2vpp.v3po.factory.SubinterfaceAugmentationWriterFactory; import io.fd.hc2vpp.v3po.factory.SubinterfaceStateAugmentationReaderFactory; import io.fd.hc2vpp.v3po.interfacesstate.cache.InterfaceCacheDumpManager; import io.fd.hc2vpp.v3po.interfacesstate.cache.InterfaceCacheDumpManagerProvider; +import io.fd.hc2vpp.v3po.interfacesstate.cache.InterfaceStatisticsManager; +import io.fd.hc2vpp.v3po.interfacesstate.cache.InterfaceStatisticsManagerProvider; +import io.fd.hc2vpp.v3po.interfacesstate.cache.JVppStatsProvider; import io.fd.hc2vpp.v3po.notification.InterfaceChangeNotificationProducerProvider; import io.fd.honeycomb.notification.ManagedNotificationProducer; import io.fd.honeycomb.translate.read.ReaderFactory; import io.fd.honeycomb.translate.write.WriterFactory; +import io.fd.jvpp.stats.future.FutureJVppStatsFacade; +import javax.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class V3poModule extends AbstractModule { private static final Logger LOG = LoggerFactory.getLogger(V3poModule.class); + private final Class> jvppStatsProviderClass; + + public V3poModule() { + this(JVppStatsProvider.class); + } + + @VisibleForTesting + protected V3poModule(@Nonnull final Class> jvppStatsProviderClass) { + this.jvppStatsProviderClass = jvppStatsProviderClass; + } @Override protected void configure() { @@ -55,6 +72,11 @@ public class V3poModule extends AbstractModule { bind(InterfaceCacheDumpManager.class).toProvider(InterfaceCacheDumpManagerProvider.class).in(Singleton.class); + // Statistics + bind(InterfaceStatisticsManager.class).toProvider(InterfaceStatisticsManagerProvider.class) + .in(Singleton.class); + bind(FutureJVppStatsFacade.class).toProvider(jvppStatsProviderClass).in(Singleton.class); + // Context utility for deleted interfaces bind(DisabledInterfacesManager.class).toInstance(new DisabledInterfacesManager()); diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/InterfacesStateReaderFactory.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/InterfacesStateReaderFactory.java index 843edd4d6..5583377d8 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/InterfacesStateReaderFactory.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/InterfacesStateReaderFactory.java @@ -26,12 +26,14 @@ import io.fd.hc2vpp.v3po.interfacesstate.EthernetCustomizer; import io.fd.hc2vpp.v3po.interfacesstate.GreCustomizer; import io.fd.hc2vpp.v3po.interfacesstate.InterfaceCustomizer; import io.fd.hc2vpp.v3po.interfacesstate.InterfaceRoutingCustomizer; +import io.fd.hc2vpp.v3po.interfacesstate.InterfaceStatisticsCustomizer; import io.fd.hc2vpp.v3po.interfacesstate.L2Customizer; import io.fd.hc2vpp.v3po.interfacesstate.TapV2Customizer; import io.fd.hc2vpp.v3po.interfacesstate.VhostUserCustomizer; import io.fd.hc2vpp.v3po.interfacesstate.VxlanCustomizer; import io.fd.hc2vpp.v3po.interfacesstate.VxlanGpeCustomizer; import io.fd.hc2vpp.v3po.interfacesstate.cache.InterfaceCacheDumpManager; +import io.fd.hc2vpp.v3po.interfacesstate.cache.InterfaceStatisticsManager; import io.fd.hc2vpp.v3po.interfacesstate.pbb.PbbRewriteStateCustomizer; import io.fd.hc2vpp.v3po.interfacesstate.span.InterfaceMirroredInterfacesCustomizer; import io.fd.honeycomb.translate.impl.read.GenericInitListReader; @@ -40,36 +42,40 @@ import io.fd.honeycomb.translate.impl.read.GenericReader; import io.fd.honeycomb.translate.read.ReaderFactory; import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder; import io.fd.jvpp.core.future.FutureJVppCore; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentationBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.AfPacket; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.Ethernet; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.Gre; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.L2; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.Routing; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.Span; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.SpanBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.TapV2; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.VhostUser; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.Vxlan; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.VxlanGpe; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.state.attributes.MirroredInterfaces; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.state.attributes.mirrored.interfaces.MirroredInterface; +import io.fd.jvpp.stats.future.FutureJVppStatsFacade; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentationBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.AfPacket; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.Ethernet; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.Gre; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.L2; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.Routing; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.Span; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.SpanBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.TapV2; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.VhostUser; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.Vxlan; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.VxlanGpe; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.state.attributes.MirroredInterfaces; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.state.attributes.mirrored.interfaces.MirroredInterface; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.pbb.rev161214.PbbRewriteStateInterfaceAugmentation; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.pbb.rev161214.PbbRewriteStateInterfaceAugmentationBuilder; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.pbb.rev161214.interfaces.state._interface.PbbRewriteState; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesStateBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state._interface.Statistics; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public final class InterfacesStateReaderFactory implements ReaderFactory { + private final FutureJVppStatsFacade jvppStats; private final NamingContext ifcNamingCtx; private final NamingContext bdNamingCtx; private final DisabledInterfacesManager ifcDisableContext; private final InterfaceCacheDumpManager ifaceDumpManager; private final FutureJVppCore jvpp; + private final InterfaceStatisticsManager statisticsManager; static final InstanceIdentifier IFC_STATE_ID = InstanceIdentifier.create(InterfacesState.class); @@ -77,15 +83,19 @@ public final class InterfacesStateReaderFactory implements ReaderFactory { @Inject public InterfacesStateReaderFactory(final FutureJVppCore jvpp, + final FutureJVppStatsFacade jvppStats, @Named("interface-context") final NamingContext ifcNamingCtx, @Named("bridge-domain-context") final NamingContext bdNamingCtx, final DisabledInterfacesManager ifcDisableContext, - final InterfaceCacheDumpManager ifaceDumpManager) { + final InterfaceCacheDumpManager ifaceDumpManager, + final InterfaceStatisticsManager statisticsManager) { this.jvpp = jvpp; + this.jvppStats = jvppStats; this.ifcNamingCtx = ifcNamingCtx; this.bdNamingCtx = bdNamingCtx; this.ifcDisableContext = ifcDisableContext; this.ifaceDumpManager = ifaceDumpManager; + this.statisticsManager = statisticsManager; } @Override @@ -96,6 +106,9 @@ public final class InterfacesStateReaderFactory implements ReaderFactory { registry.add(new GenericInitListReader<>(IFC_ID, new InterfaceCustomizer(ifcNamingCtx, ifcDisableContext, ifaceDumpManager))); + // Interface Statistics + registry.add(new GenericReader<>(IFC_ID.child(Statistics.class), + new InterfaceStatisticsCustomizer(ifcNamingCtx, jvppStats, statisticsManager))); // v3po.yang initVppIfcAugmentationReaders(registry, IFC_ID); diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/InterfacesWriterFactory.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/InterfacesWriterFactory.java index 86f313129..d516ac104 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/InterfacesWriterFactory.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/InterfacesWriterFactory.java @@ -27,6 +27,7 @@ import io.fd.hc2vpp.v3po.interfaces.GreCustomizer; import io.fd.hc2vpp.v3po.interfaces.InterfaceCustomizer; import io.fd.hc2vpp.v3po.interfaces.InterfaceRoutingCustomizer; import io.fd.hc2vpp.v3po.interfaces.InterfaceUnnumberedCustomizer; +import io.fd.hc2vpp.v3po.interfaces.InterfacesStatisticsCustomizer; import io.fd.hc2vpp.v3po.interfaces.L2Customizer; import io.fd.hc2vpp.v3po.interfaces.LoopbackCustomizer; import io.fd.hc2vpp.v3po.interfaces.TapV2Customizer; @@ -35,6 +36,7 @@ import io.fd.hc2vpp.v3po.interfaces.VxlanCustomizer; import io.fd.hc2vpp.v3po.interfaces.VxlanGpeCustomizer; import io.fd.hc2vpp.v3po.interfaces.pbb.PbbRewriteCustomizer; import io.fd.hc2vpp.v3po.interfaces.span.MirroredInterfaceCustomizer; +import io.fd.hc2vpp.v3po.interfacesstate.cache.InterfaceStatisticsManager; import io.fd.honeycomb.translate.impl.write.GenericListWriter; import io.fd.honeycomb.translate.impl.write.GenericWriter; import io.fd.honeycomb.translate.write.WriterFactory; @@ -43,20 +45,22 @@ import io.fd.jvpp.core.future.FutureJVppCore; import java.util.Set; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.unnumbered.interfaces.rev180103.InterfaceUnnumberedAugmentation; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.unnumbered.interfaces.rev180103.unnumbered.config.attributes.Unnumbered; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.AfPacket; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Ethernet; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Gre; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.L2; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Loopback; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Routing; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Span; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.TapV2; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.VhostUser; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Vxlan; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.VxlanGpe; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.attributes.MirroredInterfaces; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.attributes.mirrored.interfaces.MirroredInterface; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfacesStatsAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.Statistics; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.AfPacket; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Ethernet; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Gre; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.L2; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Loopback; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Routing; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Span; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.TapV2; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.VhostUser; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Vxlan; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.VxlanGpe; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.attributes.MirroredInterfaces; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.attributes.mirrored.interfaces.MirroredInterface; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.pbb.rev161214.PbbRewriteInterfaceAugmentation; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.pbb.rev161214.interfaces._interface.PbbRewrite; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; @@ -65,8 +69,8 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public final class InterfacesWriterFactory implements WriterFactory { - public static final InstanceIdentifier IFC_ID = - InstanceIdentifier.create(Interfaces.class).child(Interface.class); + public static final InstanceIdentifier IFCS_ID = InstanceIdentifier.create(Interfaces.class); + public static final InstanceIdentifier IFC_ID = IFCS_ID.child(Interface.class); public static final InstanceIdentifier VPP_IFC_AUG_ID = IFC_ID.augmentation(VppInterfaceAugmentation.class); public static final InstanceIdentifier L2_ID = VPP_IFC_AUG_ID.child(L2.class); @@ -75,21 +79,26 @@ public final class InterfacesWriterFactory implements WriterFactory { private final NamingContext bdNamingContext; private final NamingContext ifcNamingContext; private final DisabledInterfacesManager ifcDisableContext; + private final InterfaceStatisticsManager statisticsManager; @Inject public InterfacesWriterFactory(final FutureJVppCore vppJvppIfcDependency, @Named("bridge-domain-context") final NamingContext bridgeDomainContextDependency, @Named("interface-context") final NamingContext interfaceContextDependency, - final DisabledInterfacesManager ifcDisableContext) { + final DisabledInterfacesManager ifcDisableContext, + final InterfaceStatisticsManager statisticsManager) { this.jvpp = vppJvppIfcDependency; this.bdNamingContext = bridgeDomainContextDependency; this.ifcNamingContext = interfaceContextDependency; this.ifcDisableContext = ifcDisableContext; + this.statisticsManager = statisticsManager; } @Override public void init(final ModifiableWriterRegistryBuilder registry) { // Interfaces + registry.add(new GenericWriter<>(IFCS_ID.augmentation(VppInterfacesStatsAugmentation.class) + .child(Statistics.class), new InterfacesStatisticsCustomizer(statisticsManager))); // Interface = registry.add(new GenericListWriter<>(IFC_ID, new InterfaceCustomizer(jvpp, ifcNamingContext))); // VppInterfaceAugmentation @@ -131,14 +140,15 @@ public final class InterfacesWriterFactory implements WriterFactory { ifcId); final Set> specificIfcTypes = - Sets.newHashSet(vhostId, afpacketId, vxlanId, vxlanGpeId, tapV2Id, loopbackId); + Sets.newHashSet(vhostId, afpacketId, vxlanId, vxlanGpeId, tapV2Id, loopbackId); // Ethernet = registry.add(new GenericWriter<>(VPP_IFC_AUG_ID.child(Ethernet.class), - new EthernetCustomizer(jvpp, ifcNamingContext))); + new EthernetCustomizer(jvpp, ifcNamingContext))); // Routing(Execute only after specific interface customizers) = registry.addAfter( - new GenericWriter<>(VPP_IFC_AUG_ID.child(Routing.class), new InterfaceRoutingCustomizer(jvpp, ifcNamingContext)), + new GenericWriter<>(VPP_IFC_AUG_ID.child(Routing.class), + new InterfaceRoutingCustomizer(jvpp, ifcNamingContext)), specificIfcTypes); // L2(Execute only after subinterface (and all other ifc types) = registry.addAfter(new GenericWriter<>(L2_ID, new L2Customizer(jvpp, ifcNamingContext, bdNamingContext)), @@ -151,13 +161,13 @@ public final class InterfacesWriterFactory implements WriterFactory { .child(MirroredInterfaces.class) .child(MirroredInterface.class); registry.addAfter(new GenericWriter<>(mirroredIfcId, new MirroredInterfaceCustomizer(jvpp, ifcNamingContext, - id -> id.firstKeyOf(Interface.class).getName())), ifcId); + id -> id.firstKeyOf(Interface.class).getName())), ifcId); // Unnumbered = final InstanceIdentifier unnumberedId = - IFC_ID.augmentation(InterfaceUnnumberedAugmentation.class).child(Unnumbered.class); + IFC_ID.augmentation(InterfaceUnnumberedAugmentation.class).child(Unnumbered.class); registry.addAfter(new GenericWriter<>(unnumberedId, new InterfaceUnnumberedCustomizer(jvpp, ifcNamingContext)), - ifcId); + ifcId); } private void addPbbAugmentationWriters(final InstanceIdentifier ifcId, diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/L2HoneycombWriterFactory.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/L2HoneycombWriterFactory.java index 0a484289d..693d3c7dd 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/L2HoneycombWriterFactory.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/L2HoneycombWriterFactory.java @@ -27,12 +27,12 @@ import io.fd.honeycomb.translate.impl.write.GenericListWriter; import io.fd.honeycomb.translate.write.WriterFactory; import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder; import io.fd.jvpp.core.future.FutureJVppCore; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.BridgeDomains; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domain.attributes.ArpTerminationTable; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domain.attributes.arp.termination.table.ArpTerminationTableEntry; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.BridgeDomain; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.fib.attributes.L2FibTable; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.fib.attributes.l2.fib.table.L2FibEntry; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.BridgeDomains; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domain.attributes.ArpTerminationTable; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domain.attributes.arp.termination.table.ArpTerminationTableEntry; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.BridgeDomain; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.fib.attributes.L2FibTable; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.fib.attributes.l2.fib.table.L2FibEntry; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public final class L2HoneycombWriterFactory implements WriterFactory { diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/L2StateHoneycombReaderFactory.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/L2StateHoneycombReaderFactory.java index 851bdb38f..b0d745c48 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/L2StateHoneycombReaderFactory.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/L2StateHoneycombReaderFactory.java @@ -25,12 +25,12 @@ import io.fd.honeycomb.translate.impl.read.GenericInitListReader; import io.fd.honeycomb.translate.read.ReaderFactory; import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder; import io.fd.jvpp.core.future.FutureJVppCore; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.BridgeDomainsState; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.BridgeDomainsStateBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.state.BridgeDomain; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.fib.attributes.L2FibTable; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.fib.attributes.L2FibTableBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.fib.attributes.l2.fib.table.L2FibEntry; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.BridgeDomainsState; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.BridgeDomainsStateBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.state.BridgeDomain; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.fib.attributes.L2FibTable; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.fib.attributes.L2FibTableBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.fib.attributes.l2.fib.table.L2FibEntry; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public final class L2StateHoneycombReaderFactory implements ReaderFactory { diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/SubinterfaceAugmentationWriterFactory.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/SubinterfaceAugmentationWriterFactory.java index 87dbc2733..cdcd07000 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/SubinterfaceAugmentationWriterFactory.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/SubinterfaceAugmentationWriterFactory.java @@ -36,8 +36,8 @@ import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.subinterface.span.rev import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.subinterface.span.rev170607.interfaces._interface.sub.interfaces.sub._interface.Span; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.unnumbered.interfaces.rev180103.SubinterfaceUnnumberedAugmentation; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.unnumbered.interfaces.rev180103.unnumbered.config.attributes.Unnumbered; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.attributes.MirroredInterfaces; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.attributes.mirrored.interfaces.MirroredInterface; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.attributes.MirroredInterfaces; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.attributes.mirrored.interfaces.MirroredInterface; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev180319.SubinterfaceAugmentation; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev180319.interfaces._interface.SubInterfaces; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev180319.interfaces._interface.sub.interfaces.SubInterface; diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/SubinterfaceStateAugmentationReaderFactory.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/SubinterfaceStateAugmentationReaderFactory.java index 5eb8bc4cd..d3fb57da7 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/SubinterfaceStateAugmentationReaderFactory.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/SubinterfaceStateAugmentationReaderFactory.java @@ -36,7 +36,7 @@ import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.subinterface.span.rev import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.subinterface.span.rev170607.VppSubinterfaceSpanStateAugmentationBuilder; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.subinterface.span.rev170607.interfaces.state._interface.sub.interfaces.sub._interface.SpanState; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.subinterface.span.rev170607.interfaces.state._interface.sub.interfaces.sub._interface.SpanStateBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.state.attributes.MirroredInterfaces; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.state.attributes.MirroredInterfaces; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev180319.SubinterfaceStateAugmentation; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev180319.SubinterfaceStateAugmentationBuilder; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev180319.interfaces.state._interface.SubInterfaces; diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/AfPacketCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/AfPacketCustomizer.java index e333ed75e..748c6ce35 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/AfPacketCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/AfPacketCustomizer.java @@ -33,7 +33,7 @@ import io.fd.jvpp.core.future.FutureJVppCore; import java.nio.charset.StandardCharsets; import java.util.concurrent.CompletionStage; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.AfPacket; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.AfPacket; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfaceType; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress; @@ -54,7 +54,7 @@ public class AfPacketCustomizer extends AbstractInterfaceTypeCustomizer getExpectedInterfaceType() { - return org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.AfPacket.class; + return org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.AfPacket.class; } @Override diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/EthernetCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/EthernetCustomizer.java index 93b1fd825..808cdad73 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/EthernetCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/EthernetCustomizer.java @@ -24,7 +24,7 @@ import io.fd.honeycomb.translate.write.WriteFailedException; import io.fd.jvpp.core.dto.HwInterfaceSetMtu; import io.fd.jvpp.core.future.FutureJVppCore; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Ethernet; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Ethernet; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.EthernetCsmacd; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfaceType; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizer.java index b1ecc3a9f..b69e57966 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizer.java @@ -29,8 +29,8 @@ import io.fd.jvpp.core.dto.GreTunnelAddDelReply; import io.fd.jvpp.core.future.FutureJVppCore; import java.util.concurrent.CompletionStage; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.GreTunnel; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Gre; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.GreTunnel; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Gre; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfaceType; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/InterconnectionWriteUtils.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/InterconnectionWriteUtils.java index a497d8b4a..37eafc785 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/InterconnectionWriteUtils.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/InterconnectionWriteUtils.java @@ -31,9 +31,9 @@ import io.fd.jvpp.core.future.FutureJVppCore; import io.fd.jvpp.core.types.L2PortType; import java.util.concurrent.CompletionStage; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.config.attributes.Interconnection; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.config.attributes.interconnection.BridgeBased; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.config.attributes.interconnection.XconnectBased; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.config.attributes.Interconnection; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.config.attributes.interconnection.BridgeBased; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.config.attributes.interconnection.XconnectBased; import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/InterfaceRoutingCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/InterfaceRoutingCustomizer.java index c5b3756d5..88af864ed 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/InterfaceRoutingCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/InterfaceRoutingCustomizer.java @@ -27,7 +27,7 @@ import io.fd.honeycomb.translate.write.WriteFailedException; import io.fd.jvpp.core.future.FutureJVppCore; import java.util.List; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Routing; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Routing; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.Interface1; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces._interface.Ipv4; diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/InterfacesStatisticsCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/InterfacesStatisticsCustomizer.java new file mode 100644 index 000000000..b67eccda3 --- /dev/null +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/InterfacesStatisticsCustomizer.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2019 PANTHEON.tech. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.fd.hc2vpp.v3po.interfaces; + +import static com.google.common.base.Preconditions.checkNotNull; + +import io.fd.hc2vpp.v3po.interfacesstate.cache.InterfaceStatisticsManager; +import io.fd.honeycomb.translate.spi.write.WriterCustomizer; +import io.fd.honeycomb.translate.write.WriteContext; +import io.fd.honeycomb.translate.write.WriteFailedException; +import javax.annotation.Nonnull; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.Statistics; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public class InterfacesStatisticsCustomizer implements + WriterCustomizer { + + private final InterfaceStatisticsManager statisticsManager; + + public InterfacesStatisticsCustomizer(final InterfaceStatisticsManager statisticsManager) { + this.statisticsManager = checkNotNull(statisticsManager, "Statistics Collection Manager should not be null"); + } + + @Override + public void writeCurrentAttributes(@Nonnull final InstanceIdentifier instanceIdentifier, + @Nonnull final Statistics statisticsCollection, + @Nonnull final WriteContext writeContext) throws WriteFailedException { + enableDisableStatistics(statisticsCollection); + } + + @Override + public void updateCurrentAttributes(@Nonnull final InstanceIdentifier id, + @Nonnull final Statistics dataBefore, + @Nonnull final Statistics dataAfter, + @Nonnull final WriteContext writeContext) + throws WriteFailedException { + enableDisableStatistics(dataAfter); + } + + @Override + public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier instanceIdentifier, + @Nonnull final Statistics statisticsCollection, + @Nonnull final WriteContext writeContext) throws WriteFailedException { + statisticsManager.disableStatistics(); + } + + private void enableDisableStatistics(final Statistics statsCollect) { + if (statsCollect != null) { + if (statsCollect.isEnabled()) { + statisticsManager.enableStatistics(); + return; + } + } + statisticsManager.disableStatistics(); + } +} diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/L2Customizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/L2Customizer.java index 7c4f542f9..294100d14 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/L2Customizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/L2Customizer.java @@ -23,7 +23,7 @@ import io.fd.honeycomb.translate.write.WriteContext; import io.fd.honeycomb.translate.write.WriteFailedException; import io.fd.jvpp.core.future.FutureJVppCore; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.L2; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.L2; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/LoopbackCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/LoopbackCustomizer.java index 3cf876cc7..8b97b380f 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/LoopbackCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/LoopbackCustomizer.java @@ -27,7 +27,7 @@ import io.fd.jvpp.core.dto.CreateLoopbackReply; import io.fd.jvpp.core.dto.DeleteLoopback; import io.fd.jvpp.core.future.FutureJVppCore; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Loopback; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Loopback; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfaceType; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; @@ -47,7 +47,7 @@ public final class LoopbackCustomizer extends AbstractInterfaceTypeCustomizer getExpectedInterfaceType() { - return org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.Loopback.class; + return org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.Loopback.class; } @Override diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/RoutingCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/RoutingCustomizer.java index 993f1a4af..4566e4925 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/RoutingCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/RoutingCustomizer.java @@ -29,7 +29,7 @@ import io.fd.jvpp.core.dto.SwInterfaceSetTableReply; import io.fd.jvpp.core.future.FutureJVppCore; import java.util.concurrent.CompletionStage; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.RoutingBaseAttributes; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.RoutingBaseAttributes; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.fib.table.management.rev180521.VniReference; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/TapV2Customizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/TapV2Customizer.java index 679e2d2ca..caf7796f8 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/TapV2Customizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/TapV2Customizer.java @@ -34,7 +34,7 @@ import io.fd.jvpp.core.future.FutureJVppCore; import java.nio.charset.StandardCharsets; import java.util.concurrent.CompletionStage; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.TapV2; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.TapV2; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix; @@ -60,7 +60,7 @@ public class TapV2Customizer extends AbstractInterfaceTypeCustomizer @Override protected Class getExpectedInterfaceType() { - return org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.TapV2.class; + return org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.TapV2.class; } @Override diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VhostUserCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VhostUserCustomizer.java index 021b4beed..febf21c0e 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VhostUserCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VhostUserCustomizer.java @@ -33,8 +33,8 @@ import io.fd.jvpp.core.future.FutureJVppCore; import java.nio.charset.StandardCharsets; import java.util.concurrent.CompletionStage; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VhostUserRole; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.VhostUser; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VhostUserRole; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.VhostUser; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfaceType; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; @@ -57,7 +57,7 @@ public class VhostUserCustomizer extends AbstractInterfaceTypeCustomizer getExpectedInterfaceType() { - return org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VhostUser.class; + return org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VhostUser.class; } @Override diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizer.java index d4ec08a75..ef23313fe 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizer.java @@ -30,10 +30,10 @@ import io.fd.jvpp.core.dto.VxlanAddDelTunnelReply; import io.fd.jvpp.core.future.FutureJVppCore; import java.util.concurrent.CompletionStage; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.L2Input; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.NshProxy; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VxlanTunnel; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Vxlan; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.L2Input; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.NshProxy; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VxlanTunnel; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Vxlan; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfaceType; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizer.java index 956f08239..aad45aaa7 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizer.java @@ -30,8 +30,8 @@ import io.fd.jvpp.core.dto.VxlanGpeAddDelTunnelReply; import io.fd.jvpp.core.future.FutureJVppCore; import java.util.concurrent.CompletionStage; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VxlanGpeTunnel; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.VxlanGpe; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VxlanGpeTunnel; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.VxlanGpe; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfaceType; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/span/MirroredInterfaceCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/span/MirroredInterfaceCustomizer.java index 7b6db504b..635afd38a 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/span/MirroredInterfaceCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/span/MirroredInterfaceCustomizer.java @@ -29,10 +29,10 @@ import io.fd.jvpp.core.future.FutureJVppCore; import java.util.function.Function; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.SpanState; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.attributes.MirroredInterfaces; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.attributes.mirrored.interfaces.MirroredInterface; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.attributes.mirrored.interfaces.MirroredInterfaceKey; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.SpanState; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.attributes.MirroredInterfaces; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.attributes.mirrored.interfaces.MirroredInterface; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.attributes.mirrored.interfaces.MirroredInterfaceKey; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/AfPacketCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/AfPacketCustomizer.java index ef15dbcdf..9fcf9481b 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/AfPacketCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/AfPacketCustomizer.java @@ -36,10 +36,10 @@ import io.fd.jvpp.core.dto.SwInterfaceDetails; import io.fd.jvpp.core.future.FutureJVppCore; import java.util.concurrent.CompletionStage; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentationBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.AfPacket; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.AfPacketBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentationBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.AfPacket; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.AfPacketBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress; @@ -92,7 +92,7 @@ public class AfPacketCustomizer implements InitializingReaderCustomizer init( + public Initialized init( @Nonnull final InstanceIdentifier id, @Nonnull final AfPacket readValue, @Nonnull final ReadContext ctx) { return Initialized.create(getCfgId(id), - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.AfPacketBuilder() + new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.AfPacketBuilder() .setHostInterfaceName(readValue.getHostInterfaceName()) .setMac(readValue.getMac()) .build()); } @VisibleForTesting - static InstanceIdentifier getCfgId( + static InstanceIdentifier getCfgId( final InstanceIdentifier id) { return InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class)) .augmentation(VppInterfaceAugmentation.class) .child( - org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.AfPacket.class); + org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.AfPacket.class); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/EthernetCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/EthernetCustomizer.java index 6f1de6cc4..2b810186c 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/EthernetCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/EthernetCustomizer.java @@ -24,10 +24,10 @@ import io.fd.honeycomb.translate.spi.read.InitializingReaderCustomizer; import io.fd.honeycomb.translate.util.RWUtils; import io.fd.jvpp.core.dto.SwInterfaceDetails; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentationBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.Ethernet; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.EthernetBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentationBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.Ethernet; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.EthernetBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey; import org.opendaylight.yangtools.concepts.Builder; @@ -86,20 +86,20 @@ public class EthernetCustomizer } @Override - public Initialized init( + public Initialized init( @Nonnull final InstanceIdentifier id, @Nonnull final Ethernet readValue, @Nonnull final ReadContext ctx) { return Initialized.create(getCfgId(id), - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.EthernetBuilder() + new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.EthernetBuilder() .setMtu(readValue.getMtu()) .build()); } - private InstanceIdentifier getCfgId( + private InstanceIdentifier getCfgId( final InstanceIdentifier id) { return InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class)) .augmentation(VppInterfaceAugmentation.class) - .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Ethernet.class); + .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Ethernet.class); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/GreCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/GreCustomizer.java index 19d0a12dd..38f35ebb4 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/GreCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/GreCustomizer.java @@ -34,11 +34,11 @@ import io.fd.jvpp.core.dto.GreTunnelDump; import io.fd.jvpp.core.future.FutureJVppCore; import java.util.concurrent.CompletionStage; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.GreTunnel; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentationBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.Gre; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.GreBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.GreTunnel; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentationBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.Gre; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.GreBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey; @@ -128,20 +128,20 @@ public class GreCustomizer extends FutureJVppCustomizer } @Override - public Initialized init( + public Initialized init( @Nonnull final InstanceIdentifier id, @Nonnull final Gre readValue, @Nonnull final ReadContext ctx) { return Initialized.create(getCfgId(id), - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.GreBuilder() + new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.GreBuilder() .setDst(readValue.getDst()) .setSrc(readValue.getSrc()) .setOuterFibId(readValue.getOuterFibId()) .build()); } - private InstanceIdentifier getCfgId( + private InstanceIdentifier getCfgId( final InstanceIdentifier id) { return InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class)) .augmentation(VppInterfaceAugmentation.class) - .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Gre.class); + .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Gre.class); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterconnectionReadUtils.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterconnectionReadUtils.java index 44a22d9b1..d4541b914 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterconnectionReadUtils.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterconnectionReadUtils.java @@ -35,8 +35,8 @@ import java.util.Optional; import java.util.concurrent.CompletableFuture; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.state.attributes.Interconnection; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.state.attributes.interconnection.BridgeBasedBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.state.attributes.Interconnection; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.state.attributes.interconnection.BridgeBasedBuilder; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceDataTranslator.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceDataTranslator.java index 659a7feb2..effc3a475 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceDataTranslator.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceDataTranslator.java @@ -30,13 +30,13 @@ import java.util.Objects; import java.util.stream.Collector; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.AfPacket; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.GreTunnel; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.Loopback; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.TapV2; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VhostUser; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VxlanGpeTunnel; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VxlanTunnel; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.AfPacket; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.GreTunnel; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.Loopback; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.TapV2; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VhostUser; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VxlanGpeTunnel; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VxlanTunnel; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.EthernetCsmacd; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfaceType; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceRoutingCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceRoutingCustomizer.java index 609f30eb9..1a4495227 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceRoutingCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceRoutingCustomizer.java @@ -24,10 +24,10 @@ import io.fd.honeycomb.translate.spi.read.InitializingReaderCustomizer; import io.fd.honeycomb.translate.util.RWUtils; import io.fd.jvpp.core.future.FutureJVppCore; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentationBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.Routing; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.RoutingBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentationBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.Routing; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.RoutingBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; import org.opendaylight.yangtools.concepts.Builder; import org.opendaylight.yangtools.yang.binding.DataObject; @@ -67,22 +67,22 @@ public class InterfaceRoutingCustomizer extends RoutingCustomizer implements @Nonnull @Override - public Initialized init( + public Initialized init( @Nonnull final InstanceIdentifier id, @Nonnull final Routing readValue, @Nonnull final ReadContext ctx) { return Initialized.create(getCfgId(id), - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.RoutingBuilder() + new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.RoutingBuilder() .setIpv4VrfId(readValue.getIpv4VrfId()) .setIpv6VrfId(readValue.getIpv6VrfId()) .build()); } - private InstanceIdentifier getCfgId( + private InstanceIdentifier getCfgId( final InstanceIdentifier id) { return InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class)) .augmentation(VppInterfaceAugmentation.class) .child( - org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Routing.class); + org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Routing.class); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceStatisticsCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceStatisticsCustomizer.java new file mode 100644 index 000000000..a83ed91de --- /dev/null +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceStatisticsCustomizer.java @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2019 PANTHEON.tech. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.fd.hc2vpp.v3po.interfacesstate; + +import static com.google.common.base.Preconditions.checkNotNull; + +import io.fd.hc2vpp.common.translate.util.NamingContext; +import io.fd.hc2vpp.v3po.interfacesstate.cache.InterfaceStatisticsManager; +import io.fd.honeycomb.translate.read.ReadContext; +import io.fd.honeycomb.translate.read.ReadFailedException; +import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; +import io.fd.jvpp.stats.dto.InterfaceStatistics; +import io.fd.jvpp.stats.dto.InterfaceStatisticsDetails; +import io.fd.jvpp.stats.dto.InterfaceStatisticsDetailsReplyDump; +import io.fd.jvpp.stats.dto.InterfaceStatisticsDump; +import io.fd.jvpp.stats.future.FutureJVppStatsFacade; +import java.math.BigInteger; +import java.util.Arrays; +import java.util.Optional; +import java.util.concurrent.Future; +import javax.annotation.Nonnull; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceBuilder; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state._interface.Statistics; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state._interface.StatisticsBuilder; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class InterfaceStatisticsCustomizer implements ReaderCustomizer { + + private static final Logger LOG = LoggerFactory.getLogger(InterfaceStatisticsCustomizer.class); + + private final NamingContext ifcNamingCtx; + private final FutureJVppStatsFacade jvppStats; + private final InterfaceStatisticsManager statisticsManager; + + public InterfaceStatisticsCustomizer(final NamingContext ifcNamingCtx, + final FutureJVppStatsFacade jvppStats, + final InterfaceStatisticsManager statisticsManager) { + this.ifcNamingCtx = checkNotNull(ifcNamingCtx, "Naming context should not be null"); + this.jvppStats = checkNotNull(jvppStats, "JVpp Stats facade should not be null"); + this.statisticsManager = checkNotNull(statisticsManager, "Statistics Manager should not be null"); + } + + @Nonnull + @Override + public StatisticsBuilder getBuilder(@Nonnull final InstanceIdentifier instanceIdentifier) { + return new StatisticsBuilder(); + } + + @Override + public void readCurrentAttributes(@Nonnull final InstanceIdentifier instanceIdentifier, + @Nonnull final StatisticsBuilder statisticsBuilder, + @Nonnull final ReadContext readContext) + throws ReadFailedException { + if (!statisticsManager.isStatisticsEnabled()) return; + + final InterfaceKey key = instanceIdentifier.firstKeyOf(Interface.class); + final int index = ifcNamingCtx.getIndex(key.getName(), readContext.getMappingContext()); + InterfaceStatisticsDetails stats = getStatisticsDump(instanceIdentifier); + if (stats != null) { + Optional statsDetail = + Arrays.asList(stats.interfaceStatistics).stream().filter(elt -> elt.swIfIndex == index).findFirst(); + if (statsDetail.isPresent()) { + InterfaceStatistics detail = statsDetail.get(); + statisticsBuilder.setOutOctets(new Counter64(BigInteger.valueOf(detail.outBytes))) + .setOutUnicastPkts(new Counter64(BigInteger.valueOf(detail.outUnicastPkts))) + .setOutMulticastPkts(new Counter64(BigInteger.valueOf(detail.outMulticastPkts))) + .setOutBroadcastPkts(new Counter64(BigInteger.valueOf(detail.outBroadcastPkts))) + .setOutErrors(new Counter32(new Long(detail.outErrors))) + .setInOctets(new Counter64(BigInteger.valueOf(detail.inBytes))) + .setInUnicastPkts(new Counter64(BigInteger.valueOf(detail.inUnicastPkts))) + .setInMulticastPkts(new Counter64(BigInteger.valueOf(detail.inMulticastPkts))) + .setInBroadcastPkts(new Counter64(BigInteger.valueOf(detail.inBroadcastPkts))) + .setInErrors(new Counter32(new Long(detail.inErrors))); + } + } + } + + @Override + public void merge(@Nonnull final Builder builder, @Nonnull final Statistics statistics) { + ((InterfaceBuilder) builder).setStatistics(statistics); + } + + private InterfaceStatisticsDetails getStatisticsDump(InstanceIdentifier id) throws ReadFailedException { + LOG.debug("Sending InterfaceStatisticsDump request..."); + final InterfaceStatisticsDump request = new InterfaceStatisticsDump(); + + final Future replyFuture = + jvppStats.interfaceStatisticsDump(request).toCompletableFuture(); + final InterfaceStatisticsDetailsReplyDump reply; + try { + reply = replyFuture.get(); + } catch (Exception e) { + throw new ReadFailedException(id, e); + } + + if (reply == null || reply.interfaceStatisticsDetails == null) { + throw new ReadFailedException(id, + new IllegalStateException("Received null response for empty dump: " + reply)); + } + return reply.interfaceStatisticsDetails; + } +} diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/L2Customizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/L2Customizer.java index e46590de7..31f2a3517 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/L2Customizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/L2Customizer.java @@ -26,15 +26,15 @@ import io.fd.honeycomb.translate.spi.read.InitializingReaderCustomizer; import io.fd.honeycomb.translate.util.RWUtils; import io.fd.jvpp.core.future.FutureJVppCore; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentationBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.L2; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.L2Builder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.config.attributes.interconnection.BridgeBasedBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.config.attributes.interconnection.XconnectBasedBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.state.attributes.Interconnection; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.state.attributes.interconnection.BridgeBased; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.state.attributes.interconnection.XconnectBased; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentationBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.L2; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.L2Builder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.config.attributes.interconnection.BridgeBasedBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.config.attributes.interconnection.XconnectBasedBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.state.attributes.Interconnection; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.state.attributes.interconnection.BridgeBased; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.state.attributes.interconnection.XconnectBased; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey; import org.opendaylight.yangtools.concepts.Builder; @@ -82,13 +82,13 @@ public class L2Customizer extends FutureJVppCustomizer implements InitializingRe } @Override - public Initialized init( + public Initialized init( @Nonnull final InstanceIdentifier id, @Nonnull final L2 readValue, @Nonnull final ReadContext ctx) { - final org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.L2Builder + final org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.L2Builder l2Builder = - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.L2Builder(); + new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.L2Builder(); final Interconnection interconnection = readValue.getInterconnection(); if (interconnection != null) { @@ -110,10 +110,10 @@ public class L2Customizer extends FutureJVppCustomizer implements InitializingRe return Initialized.create(getCfgId(id), l2Builder.build()); } - private InstanceIdentifier getCfgId( + private InstanceIdentifier getCfgId( final InstanceIdentifier id) { return InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class)) .augmentation(VppInterfaceAugmentation.class) - .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.L2.class); + .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.L2.class); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/RoutingCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/RoutingCustomizer.java index 72dcbda50..f44680260 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/RoutingCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/RoutingCustomizer.java @@ -27,7 +27,7 @@ import io.fd.jvpp.core.dto.SwInterfaceGetTableReply; import io.fd.jvpp.core.future.FutureJVppCore; import java.util.function.Consumer; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.RoutingBaseAttributes; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.RoutingBaseAttributes; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.fib.table.management.rev180521.VniReference; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/SubInterfaceL2Customizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/SubInterfaceL2Customizer.java index dd5f2758d..ff1f2fee8 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/SubInterfaceL2Customizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/SubInterfaceL2Customizer.java @@ -27,8 +27,8 @@ import io.fd.honeycomb.translate.spi.read.InitializingReaderCustomizer; import io.fd.honeycomb.translate.util.RWUtils; import io.fd.jvpp.core.future.FutureJVppCore; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.state.attributes.interconnection.BridgeBased; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.state.attributes.interconnection.XconnectBased; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.state.attributes.interconnection.BridgeBased; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.state.attributes.interconnection.XconnectBased; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev180319.interfaces.state._interface.sub.interfaces.SubInterface; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev180319.interfaces.state._interface.sub.interfaces.SubInterfaceBuilder; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev180319.interfaces.state._interface.sub.interfaces.SubInterfaceKey; @@ -95,13 +95,13 @@ public class SubInterfaceL2Customizer if (readValue.getInterconnection() instanceof XconnectBased) { XconnectBased state = (XconnectBased) readValue.getInterconnection(); builder.setInterconnection( - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.config.attributes.interconnection.XconnectBasedBuilder() + new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.config.attributes.interconnection.XconnectBasedBuilder() .setXconnectOutgoingInterface(state.getXconnectOutgoingInterface()) .build()); } else { BridgeBased state = (BridgeBased) readValue.getInterconnection(); builder.setInterconnection( - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.config.attributes.interconnection.BridgeBasedBuilder() + new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.config.attributes.interconnection.BridgeBasedBuilder() .setBridgeDomain(state.getBridgeDomain()) .setBridgedVirtualInterface(state.isBridgedVirtualInterface()) .setSplitHorizonGroup(state.getSplitHorizonGroup()) diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/TapV2Customizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/TapV2Customizer.java index 1af4af64c..528acea67 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/TapV2Customizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/TapV2Customizer.java @@ -41,10 +41,10 @@ import io.fd.jvpp.core.dto.SwInterfaceTapV2Dump; import io.fd.jvpp.core.future.FutureJVppCore; import java.util.Optional; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentationBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.TapV2; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.TapV2Builder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentationBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.TapV2; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.TapV2Builder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress; @@ -99,7 +99,7 @@ public class TapV2Customizer extends FutureJVppCustomizer final InterfaceKey key = id.firstKeyOf(Interface.class); final int index = interfaceContext.getIndex(key.getName(), ctx.getMappingContext()); if (!isInterfaceOfType(dumpManager, id, ctx, - org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.TapV2.class)) { + org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.TapV2.class)) { return; } @@ -173,7 +173,7 @@ public class TapV2Customizer extends FutureJVppCustomizer } @Override - public Initialized init( + public Initialized init( @Nonnull final InstanceIdentifier id, @Nonnull final TapV2 readValue, @Nonnull final ReadContext ctx) { // The MAC address & tag is set from interface details, those details are retrieved from cache @@ -187,7 +187,7 @@ public class TapV2Customizer extends FutureJVppCustomizer } return Initialized.create(getCfgId(id), - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.TapV2Builder() + new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.TapV2Builder() .setMac(new PhysAddress(vppPhysAddrToYang(ifcDetails.l2Address))) .setHostInterfaceName(readValue.getHostInterfaceName()) .setTag(ifcDetails.tag[0] == 0 @@ -203,10 +203,10 @@ public class TapV2Customizer extends FutureJVppCustomizer .build()); } - private InstanceIdentifier getCfgId( + private InstanceIdentifier getCfgId( final InstanceIdentifier id) { return InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class)) .augmentation(VppInterfaceAugmentation.class) - .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.TapV2.class); + .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.TapV2.class); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VhostUserCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VhostUserCustomizer.java index 561b06738..0afb0ef46 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VhostUserCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VhostUserCustomizer.java @@ -36,11 +36,11 @@ import io.fd.jvpp.core.future.FutureJVppCore; import java.math.BigInteger; import java.util.concurrent.CompletionStage; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VhostUserRole; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentationBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.VhostUser; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.VhostUserBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VhostUserRole; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentationBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.VhostUser; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.VhostUserBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey; import org.opendaylight.yangtools.concepts.Builder; @@ -98,7 +98,7 @@ public class VhostUserCustomizer implements InitializingReaderCustomizer init( + public Initialized init( @Nonnull final InstanceIdentifier id, @Nonnull final VhostUser readValue, @Nonnull final ReadContext ctx) { @@ -149,7 +149,7 @@ public class VhostUserCustomizer implements InitializingReaderCustomizer getCfgId( + private InstanceIdentifier getCfgId( final InstanceIdentifier id) { return InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class)) .augmentation(VppInterfaceAugmentation.class) - .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.VhostUser.class); + .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.VhostUser.class); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizer.java index a820b4ff2..72ac3b0a9 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizer.java @@ -36,14 +36,14 @@ import io.fd.jvpp.core.dto.VxlanTunnelDump; import io.fd.jvpp.core.future.FutureJVppCore; import java.util.concurrent.CompletionStage; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.L2Input; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.NshProxy; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentationBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VxlanTunnel; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VxlanVni; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.Vxlan; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.VxlanBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.L2Input; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.NshProxy; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentationBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VxlanTunnel; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VxlanVni; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.Vxlan; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.VxlanBuilder; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.fib.table.management.rev180521.VniReference; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; @@ -142,11 +142,11 @@ public class VxlanCustomizer extends FutureJVppCustomizer } @Override - public Initialized init( + public Initialized init( @Nonnull final InstanceIdentifier id, @Nonnull final Vxlan readValue, @Nonnull final ReadContext ctx) { return Initialized.create(getCfgId(id), - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.VxlanBuilder() + new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.VxlanBuilder() .setDst(readValue.getDst()) .setSrc(readValue.getSrc()) .setEncapVrfId(readValue.getEncapVrfId()) @@ -155,10 +155,10 @@ public class VxlanCustomizer extends FutureJVppCustomizer .build()); } - private InstanceIdentifier getCfgId( + private InstanceIdentifier getCfgId( final InstanceIdentifier id) { return InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class)) .augmentation(VppInterfaceAugmentation.class) - .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Vxlan.class); + .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Vxlan.class); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanGpeCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanGpeCustomizer.java index 874c4b425..2bb2e824d 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanGpeCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanGpeCustomizer.java @@ -35,13 +35,13 @@ import io.fd.jvpp.core.dto.VxlanGpeTunnelDump; import io.fd.jvpp.core.future.FutureJVppCore; import java.util.concurrent.CompletionStage; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentationBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VxlanGpeNextProtocol; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VxlanGpeTunnel; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VxlanGpeVni; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.VxlanGpe; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.VxlanGpeBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentationBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VxlanGpeNextProtocol; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VxlanGpeTunnel; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VxlanGpeVni; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.VxlanGpe; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.VxlanGpeBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey; @@ -132,11 +132,11 @@ public class VxlanGpeCustomizer extends FutureJVppCustomizer } @Override - public Initialized init( + public Initialized init( @Nonnull final InstanceIdentifier id, @Nonnull final VxlanGpe readValue, @Nonnull final ReadContext ctx) { return Initialized.create(getCfgId(id), - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.VxlanGpeBuilder() + new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.VxlanGpeBuilder() .setLocal(readValue.getLocal()) .setRemote(readValue.getRemote()) .setVni(new VxlanGpeVni(readValue.getVni())) @@ -146,10 +146,10 @@ public class VxlanGpeCustomizer extends FutureJVppCustomizer .build()); } - private InstanceIdentifier getCfgId( + private InstanceIdentifier getCfgId( final InstanceIdentifier id) { return InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class)) .augmentation(VppInterfaceAugmentation.class) - .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.VxlanGpe.class); + .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.VxlanGpe.class); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/cache/InterfaceStatisticsManager.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/cache/InterfaceStatisticsManager.java new file mode 100644 index 000000000..0c5e36248 --- /dev/null +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/cache/InterfaceStatisticsManager.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2019 PANTHEON.tech. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.fd.hc2vpp.v3po.interfacesstate.cache; + +public interface InterfaceStatisticsManager { + + boolean isStatisticsEnabled(); + + void enableStatistics(); + + void disableStatistics(); +} diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/cache/InterfaceStatisticsManagerImpl.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/cache/InterfaceStatisticsManagerImpl.java new file mode 100644 index 000000000..0543fe745 --- /dev/null +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/cache/InterfaceStatisticsManagerImpl.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2019 PANTHEON.tech. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.fd.hc2vpp.v3po.interfacesstate.cache; + +public class InterfaceStatisticsManagerImpl implements InterfaceStatisticsManager { + + private boolean isEnabled; + + @Override + public boolean isStatisticsEnabled() { + return isEnabled; + } + + @Override + public void enableStatistics() { + isEnabled = true; + } + + @Override + public void disableStatistics() { + isEnabled = false; + } +} diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/cache/InterfaceStatisticsManagerProvider.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/cache/InterfaceStatisticsManagerProvider.java new file mode 100644 index 000000000..7306efcfd --- /dev/null +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/cache/InterfaceStatisticsManagerProvider.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2019 PANTHEON.tech. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.fd.hc2vpp.v3po.interfacesstate.cache; + +import com.google.inject.Provider; + +public class InterfaceStatisticsManagerProvider implements Provider { + + @Override + public InterfaceStatisticsManager get() { + return new InterfaceStatisticsManagerImpl(); + } +} diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/cache/JVppStatsProvider.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/cache/JVppStatsProvider.java new file mode 100644 index 000000000..2ffc10419 --- /dev/null +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/cache/JVppStatsProvider.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2019 PANTHEON.tech. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.fd.hc2vpp.v3po.interfacesstate.cache; + +import com.google.inject.Inject; +import io.fd.honeycomb.binding.init.ProviderTrait; +import io.fd.honeycomb.data.init.ShutdownHandler; +import io.fd.jvpp.JVppRegistry; +import io.fd.jvpp.stats.JVppStatsImpl; +import io.fd.jvpp.stats.future.FutureJVppStatsFacade; +import java.io.IOException; + +public class JVppStatsProvider extends ProviderTrait { + + @Inject + private JVppRegistry registry; + + @Inject + private ShutdownHandler shutdownHandler; + + private static JVppStatsImpl initStatsApi(final ShutdownHandler shutdownHandler) { + final JVppStatsImpl jvppStats = new JVppStatsImpl(); + shutdownHandler.register("jvpp-stats", jvppStats); + return jvppStats; + } + + @Override + protected FutureJVppStatsFacade create() { + try { + return new FutureJVppStatsFacade(registry, initStatsApi(shutdownHandler)); + } catch (IOException e) { + throw new IllegalStateException("Unable to open VPP management connection", e); + } + } +} diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/span/AbstractMirroredInterfacesCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/span/AbstractMirroredInterfacesCustomizer.java index c409ae298..1c063bad2 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/span/AbstractMirroredInterfacesCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/span/AbstractMirroredInterfacesCustomizer.java @@ -30,12 +30,12 @@ import java.util.List; import java.util.function.Function; import java.util.stream.Collectors; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.SpanState; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.state.attributes.MirroredInterfaces; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.state.attributes.MirroredInterfacesBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.state.attributes.mirrored.interfaces.MirroredInterface; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.state.attributes.mirrored.interfaces.MirroredInterfaceBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.state.attributes.mirrored.interfaces.MirroredInterfaceKey; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.SpanState; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.state.attributes.MirroredInterfaces; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.state.attributes.MirroredInterfacesBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.state.attributes.mirrored.interfaces.MirroredInterface; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.state.attributes.mirrored.interfaces.MirroredInterfaceBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.state.attributes.mirrored.interfaces.MirroredInterfaceKey; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/span/InterfaceMirroredInterfacesCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/span/InterfaceMirroredInterfacesCustomizer.java index a73de1ba3..17691b6ea 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/span/InterfaceMirroredInterfacesCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/span/InterfaceMirroredInterfacesCustomizer.java @@ -26,12 +26,12 @@ import java.util.Collections; import java.util.Optional; import java.util.stream.Collectors; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.SpanBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.attributes.MirroredInterfacesBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.attributes.mirrored.interfaces.MirroredInterfaceBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.attributes.mirrored.interfaces.MirroredInterfaceKey; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.state.attributes.MirroredInterfaces; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.SpanBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.attributes.MirroredInterfacesBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.attributes.mirrored.interfaces.MirroredInterfaceBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.attributes.mirrored.interfaces.MirroredInterfaceKey; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.state.attributes.MirroredInterfaces; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; import org.opendaylight.yangtools.concepts.Builder; import org.opendaylight.yangtools.yang.binding.DataObject; @@ -52,12 +52,12 @@ public class InterfaceMirroredInterfacesCustomizer extends AbstractMirroredInter public Initialized init(@Nonnull final InstanceIdentifier id, @Nonnull final MirroredInterfaces readValue, @Nonnull final ReadContext ctx) { - final InstanceIdentifier cfgId = + final InstanceIdentifier cfgId = InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class)) .augmentation(VppInterfaceAugmentation.class) - .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Span.class) - .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.attributes.MirroredInterfaces.class); - final org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.attributes.MirroredInterfaces + .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Span.class) + .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.attributes.MirroredInterfaces.class); + final org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.attributes.MirroredInterfaces cfgValue = new MirroredInterfacesBuilder() .setMirroredInterface(Optional.ofNullable(readValue.getMirroredInterface()).orElse(Collections.emptyList()) .stream() diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/span/SubInterfaceMirroredInterfacesCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/span/SubInterfaceMirroredInterfacesCustomizer.java index 5e490de6f..33dec5bed 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/span/SubInterfaceMirroredInterfacesCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfacesstate/span/SubInterfaceMirroredInterfacesCustomizer.java @@ -31,7 +31,7 @@ import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.subinterface.span.rev170607.VppSubinterfaceSpanAugmentation; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.subinterface.span.rev170607.interfaces._interface.sub.interfaces.sub._interface.Span; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.subinterface.span.rev170607.interfaces.state._interface.sub.interfaces.sub._interface.SpanStateBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.state.attributes.MirroredInterfaces; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.state.attributes.MirroredInterfaces; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev180319.interfaces.state._interface.sub.interfaces.SubInterface; import org.opendaylight.yangtools.concepts.Builder; import org.opendaylight.yangtools.yang.binding.DataObject; @@ -51,19 +51,19 @@ public class SubInterfaceMirroredInterfacesCustomizer extends AbstractMirroredIn public Initialized init(@Nonnull InstanceIdentifier id, @Nonnull MirroredInterfaces readValue, @Nonnull ReadContext readContext) { - final InstanceIdentifier cfgId = + final InstanceIdentifier cfgId = SubInterfaceCustomizer.getCfgId(RWUtils.cutId(id, SubInterface.class)) .augmentation(VppSubinterfaceSpanAugmentation.class) .child(Span.class) - .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.attributes.MirroredInterfaces.class); + .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.attributes.MirroredInterfaces.class); - final org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.attributes.MirroredInterfaces - cfgValue = new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.attributes.MirroredInterfacesBuilder() + final org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.attributes.MirroredInterfaces + cfgValue = new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.attributes.MirroredInterfacesBuilder() .setMirroredInterface( Optional.ofNullable(readValue.getMirroredInterface()).orElse(Collections.emptyList()) .stream() - .map(mirroredInterface -> new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.attributes.mirrored.interfaces.MirroredInterfaceBuilder() - .withKey(new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.attributes.mirrored.interfaces.MirroredInterfaceKey(mirroredInterface.key().getIfaceRef())) + .map(mirroredInterface -> new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.attributes.mirrored.interfaces.MirroredInterfaceBuilder() + .withKey(new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.attributes.mirrored.interfaces.MirroredInterfaceKey(mirroredInterface.key().getIfaceRef())) .setIfaceRef(mirroredInterface.getIfaceRef()) .setState(mirroredInterface.getState()) .build()) diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizer.java index 7f1ac1bee..6308c102d 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizer.java @@ -35,9 +35,9 @@ import io.fd.jvpp.core.types.Ip4Address; import io.fd.jvpp.core.types.MacAddress; import java.util.concurrent.CompletionStage; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domain.attributes.arp.termination.table.ArpTerminationTableEntry; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domain.attributes.arp.termination.table.ArpTerminationTableEntryKey; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.BridgeDomain; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domain.attributes.arp.termination.table.ArpTerminationTableEntry; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domain.attributes.arp.termination.table.ArpTerminationTableEntryKey; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.BridgeDomain; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/BridgeDomainCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/BridgeDomainCustomizer.java index f74d630be..a025d17bc 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/BridgeDomainCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/BridgeDomainCustomizer.java @@ -36,11 +36,11 @@ import java.util.Collections; import java.util.Optional; import javax.annotation.Nonnull; import javax.annotation.concurrent.GuardedBy; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.L2ConfigAttributes; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.BridgeDomain; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.BridgeDomainKey; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.config.attributes.interconnection.BridgeBased; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.L2ConfigAttributes; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.BridgeDomain; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.BridgeDomainKey; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.config.attributes.interconnection.BridgeBased; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/L2FibEntryCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/L2FibEntryCustomizer.java index 511564b61..1b66f4bc5 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/L2FibEntryCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/L2FibEntryCustomizer.java @@ -33,10 +33,10 @@ import io.fd.jvpp.core.dto.L2FibAddDelReply; import io.fd.jvpp.core.future.FutureJVppCore; import java.util.concurrent.CompletionStage; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.L2FibFilter; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.BridgeDomain; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.fib.attributes.l2.fib.table.L2FibEntry; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.fib.attributes.l2.fib.table.L2FibEntryKey; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.L2FibFilter; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.BridgeDomain; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.fib.attributes.l2.fib.table.L2FibEntry; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.fib.attributes.l2.fib.table.L2FibEntryKey; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2state/BridgeDomainCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2state/BridgeDomainCustomizer.java index f30464543..f3d90f21c 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2state/BridgeDomainCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2state/BridgeDomainCustomizer.java @@ -33,11 +33,11 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.BridgeDomains; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.BridgeDomainsStateBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.state.BridgeDomain; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.state.BridgeDomainBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.state.BridgeDomainKey; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.BridgeDomains; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.BridgeDomainsStateBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.state.BridgeDomain; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.state.BridgeDomainBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.state.BridgeDomainKey; import org.opendaylight.yangtools.concepts.Builder; import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; @@ -153,12 +153,12 @@ public final class BridgeDomainCustomizer extends FutureJVppCustomizer } @Override - public Initialized init( + public Initialized init( @Nonnull final InstanceIdentifier id, @Nonnull final BridgeDomain readValue, @Nonnull final ReadContext ctx) { return Initialized.create(getCfgId(id), - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.BridgeDomainBuilder() + new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.BridgeDomainBuilder() .setName(readValue.getName()) .setLearn(readValue.isLearn()) .setUnknownUnicastFlood(readValue.isUnknownUnicastFlood()) @@ -168,11 +168,11 @@ public final class BridgeDomainCustomizer extends FutureJVppCustomizer .build()); } - static InstanceIdentifier getCfgId( + static InstanceIdentifier getCfgId( final InstanceIdentifier id) { return InstanceIdentifier.create(BridgeDomains.class).child( - org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.BridgeDomain.class, - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.BridgeDomainKey( + org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.BridgeDomain.class, + new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.BridgeDomainKey( id.firstKeyOf(BridgeDomain.class).getName())); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2state/L2FibEntryCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2state/L2FibEntryCustomizer.java index 2a0ab3ce1..9e4bda429 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2state/L2FibEntryCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2state/L2FibEntryCustomizer.java @@ -36,15 +36,15 @@ import java.util.concurrent.CompletableFuture; import java.util.stream.Collector; import java.util.stream.Collectors; import javax.annotation.Nonnull; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.L2FibFilter; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.L2FibForward; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.state.BridgeDomain; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.state.BridgeDomainKey; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.fib.attributes.L2FibTable; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.fib.attributes.L2FibTableBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.fib.attributes.l2.fib.table.L2FibEntry; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.fib.attributes.l2.fib.table.L2FibEntryBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.fib.attributes.l2.fib.table.L2FibEntryKey; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.L2FibFilter; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.L2FibForward; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.state.BridgeDomain; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.state.BridgeDomainKey; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.fib.attributes.L2FibTable; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.fib.attributes.L2FibTableBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.fib.attributes.l2.fib.table.L2FibEntry; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.fib.attributes.l2.fib.table.L2FibEntryBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.fib.attributes.l2.fib.table.L2FibEntryKey; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress; import org.opendaylight.yangtools.concepts.Builder; import org.opendaylight.yangtools.yang.binding.DataObject; diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/notification/InterfaceChangeNotificationProducer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/notification/InterfaceChangeNotificationProducer.java index 8d4b93a8e..b6dab53dc 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/notification/InterfaceChangeNotificationProducer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/notification/InterfaceChangeNotificationProducer.java @@ -38,12 +38,12 @@ import java.util.concurrent.TimeoutException; import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.annotation.concurrent.NotThreadSafe; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.InterfaceDeleted; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.InterfaceDeletedBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.InterfaceNameOrIndex; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.InterfaceStateChange; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.InterfaceStateChangeBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.InterfaceStatus; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.InterfaceDeleted; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.InterfaceDeletedBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.InterfaceNameOrIndex; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.InterfaceStateChange; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.InterfaceStateChangeBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.InterfaceStatus; import org.opendaylight.yangtools.yang.binding.Notification; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/V3poModuleTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/V3poModuleTest.java index 818d3e7ce..41a4354b9 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/V3poModuleTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/V3poModuleTest.java @@ -21,10 +21,12 @@ import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.Matchers.empty; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertThat; +import static org.mockito.Mockito.mock; import static org.mockito.MockitoAnnotations.initMocks; import com.google.inject.Guice; import com.google.inject.Inject; +import com.google.inject.Provider; import com.google.inject.name.Named; import com.google.inject.testing.fieldbinder.Bind; import com.google.inject.testing.fieldbinder.BoundFieldModule; @@ -36,6 +38,7 @@ import io.fd.honeycomb.translate.read.ReaderFactory; import io.fd.honeycomb.translate.util.YangDAG; import io.fd.honeycomb.translate.write.WriterFactory; import io.fd.jvpp.core.future.FutureJVppCore; +import io.fd.jvpp.stats.future.FutureJVppStatsFacade; import java.util.HashSet; import java.util.Set; import org.junit.Before; @@ -77,7 +80,8 @@ public class V3poModuleTest { @Before public void setUp() { initMocks(this); - Guice.createInjector(new V3poModule(), BoundFieldModule.of(this)).injectMembers(this); + Guice.createInjector(new V3poModule(MockJVppStatsProvider.class), BoundFieldModule.of(this)) + .injectMembers(this); } @Test @@ -100,5 +104,11 @@ public class V3poModuleTest { assertNotNull(registryBuilder.build()); } + private static final class MockJVppStatsProvider implements Provider { -} \ No newline at end of file + @Override + public FutureJVppStatsFacade get() { + return mock(FutureJVppStatsFacade.class); + } + } +} diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/AfPacketCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/AfPacketCustomizerTest.java index 71e70d3b4..b7df30e96 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/AfPacketCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/AfPacketCustomizerTest.java @@ -31,9 +31,9 @@ import io.fd.jvpp.core.dto.AfPacketDelete; import io.fd.jvpp.core.dto.AfPacketDeleteReply; import java.nio.charset.StandardCharsets; import org.junit.Test; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.AfPacket; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.AfPacketBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.AfPacket; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.AfPacketBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceKey; @@ -53,7 +53,7 @@ public class AfPacketCustomizerTest extends WriterCustomizerTest implements Ipv4 @Override public void setUpTest() throws Exception { InterfaceTypeTestUtils.setupWriteContext(writeContext, - org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.AfPacket.class); + org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.AfPacket.class); customizer = new AfPacketCustomizer(api, new NamingContext("generatedInterfaceName", IFC_TEST_INSTANCE)); final AfPacketCreateReply createReply = new AfPacketCreateReply(); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/EthernetCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/EthernetCustomizerTest.java index 335d4b62c..55e2c170c 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/EthernetCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/EthernetCustomizerTest.java @@ -27,9 +27,9 @@ import io.fd.honeycomb.translate.write.WriteFailedException; import io.fd.jvpp.core.dto.HwInterfaceSetMtu; import io.fd.jvpp.core.dto.HwInterfaceSetMtuReply; import org.junit.Test; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Ethernet; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.EthernetBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Ethernet; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.EthernetBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.EthernetCsmacd; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizerTest.java index 0e0875baf..9ba44346a 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizerTest.java @@ -36,9 +36,9 @@ import io.fd.jvpp.core.dto.GreTunnelAddDel; import io.fd.jvpp.core.dto.GreTunnelAddDelReply; import org.junit.Test; import org.mockito.ArgumentCaptor; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Gre; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.GreBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Gre; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.GreBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; @@ -68,7 +68,7 @@ public class GreCustomizerTest extends WriterCustomizerTest implements AddressTr @Override public void setUpTest() throws Exception { InterfaceTypeTestUtils.setupWriteContext(writeContext, - org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.GreTunnel.class); + org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.GreTunnel.class); customizer = new GreCustomizer(api, new NamingContext("generateInterfaceNAme", IFC_TEST_INSTANCE)); } diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/InterfaceRoutingCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/InterfaceRoutingCustomizerTest.java index 1d9be3511..94da97916 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/InterfaceRoutingCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/InterfaceRoutingCustomizerTest.java @@ -29,9 +29,9 @@ import io.fd.jvpp.core.dto.SwInterfaceSetTable; import io.fd.jvpp.core.dto.SwInterfaceSetTableReply; import java.util.Collections; import org.junit.Test; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Routing; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.RoutingBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Routing; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.RoutingBuilder; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.fib.table.management.rev180521.VniReference; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/InterfacesStatisticsCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/InterfacesStatisticsCustomizerTest.java new file mode 100644 index 000000000..dd29ca114 --- /dev/null +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/InterfacesStatisticsCustomizerTest.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2019 PANTHEON.tech. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.fd.hc2vpp.v3po.interfaces; + +import io.fd.hc2vpp.common.test.write.WriterCustomizerTest; +import io.fd.hc2vpp.v3po.interfacesstate.cache.InterfaceStatisticsManager; +import io.fd.hc2vpp.v3po.interfacesstate.cache.InterfaceStatisticsManagerImpl; +import io.fd.honeycomb.translate.write.WriteFailedException; +import org.junit.Assert; +import org.junit.Test; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfacesStatsAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.Statistics; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.StatisticsBuilder; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public class InterfacesStatisticsCustomizerTest extends WriterCustomizerTest { + + public static final InstanceIdentifier IID = + InstanceIdentifier.create(Interfaces.class).augmentation(VppInterfacesStatsAugmentation.class) + .child(Statistics.class); + + private InterfacesStatisticsCustomizer customizer; + private InterfaceStatisticsManager statsManager; + + @Override + protected void setUpTest() throws Exception { + statsManager = new InterfaceStatisticsManagerImpl(); + customizer = new InterfacesStatisticsCustomizer(statsManager); + } + + @Test + public void testWrite() throws WriteFailedException { + customizer.writeCurrentAttributes(IID, enableStats(true), writeContext); + Assert.assertTrue(statsManager.isStatisticsEnabled()); + } + + @Test + public void testUpdatetoEnabled() throws WriteFailedException { + customizer.updateCurrentAttributes(IID, enableStats(true), enableStats(false), writeContext); + Assert.assertFalse(statsManager.isStatisticsEnabled()); + } + + @Test + public void testUpdateToDisabled() throws WriteFailedException { + customizer.updateCurrentAttributes(IID, enableStats(false), enableStats(true), writeContext); + Assert.assertTrue(statsManager.isStatisticsEnabled()); + } + + @Test + public void testDelete() throws WriteFailedException { + customizer.deleteCurrentAttributes(IID, enableStats(true), writeContext); + Assert.assertFalse(statsManager.isStatisticsEnabled()); + } + + private Statistics enableStats(final boolean enabled) { + StatisticsBuilder builder = new StatisticsBuilder(); + return builder.setEnabled(enabled).build(); + } +} diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/L2CustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/L2CustomizerTest.java index be6955d3e..72d69e7f9 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/L2CustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/L2CustomizerTest.java @@ -33,14 +33,14 @@ import io.fd.jvpp.core.dto.SwInterfaceSetL2Xconnect; import io.fd.jvpp.core.dto.SwInterfaceSetL2XconnectReply; import io.fd.jvpp.core.types.L2PortType; import org.junit.Test; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.L2; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.L2Builder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.config.attributes.Interconnection; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.config.attributes.interconnection.BridgeBased; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.config.attributes.interconnection.BridgeBasedBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.config.attributes.interconnection.XconnectBased; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.config.attributes.interconnection.XconnectBasedBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.L2; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.L2Builder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.config.attributes.Interconnection; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.config.attributes.interconnection.BridgeBased; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.config.attributes.interconnection.BridgeBasedBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.config.attributes.interconnection.XconnectBased; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.config.attributes.interconnection.XconnectBasedBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceKey; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/LoopbackCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/LoopbackCustomizerTest.java index 3941f1c88..617bb06ea 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/LoopbackCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/LoopbackCustomizerTest.java @@ -32,9 +32,9 @@ import io.fd.jvpp.core.dto.DeleteLoopbackReply; import org.junit.Test; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Loopback; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.LoopbackBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Loopback; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.LoopbackBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceKey; @@ -49,7 +49,7 @@ public class LoopbackCustomizerTest extends WriterCustomizerTest { @Override public void setUpTest() throws Exception { InterfaceTypeTestUtils.setupWriteContext(writeContext, - org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.Loopback.class); + org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.Loopback.class); loopCustomizer = new LoopbackCustomizer(api, new NamingContext("ifcintest", IFC_TEST_INSTANCE)); } diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/SubInterfaceL2CustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/SubInterfaceL2CustomizerTest.java index b8aab9d1d..86607e02a 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/SubInterfaceL2CustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/SubInterfaceL2CustomizerTest.java @@ -28,7 +28,7 @@ import io.fd.jvpp.core.dto.SwInterfaceSetL2Bridge; import io.fd.jvpp.core.dto.SwInterfaceSetL2BridgeReply; import io.fd.jvpp.core.types.L2PortType; import org.junit.Test; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.config.attributes.interconnection.BridgeBasedBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.config.attributes.interconnection.BridgeBasedBuilder; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev180319.SubinterfaceAugmentation; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev180319.interfaces._interface.SubInterfaces; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev180319.interfaces._interface.sub.interfaces.SubInterface; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/TapV2CustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/TapV2CustomizerTest.java index 06b2d445f..a59d0b3e9 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/TapV2CustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/TapV2CustomizerTest.java @@ -35,9 +35,9 @@ import io.fd.jvpp.core.dto.TapDeleteV2Reply; import java.util.concurrent.atomic.AtomicInteger; import org.junit.Assert; import org.junit.Test; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.TapV2; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.TapV2Builder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.TapV2; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.TapV2Builder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address; @@ -69,7 +69,7 @@ public class TapV2CustomizerTest extends WriterCustomizerTest @Override public void setUpTest() throws Exception { InterfaceTypeTestUtils.setupWriteContext(writeContext, - org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.TapV2.class); + org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.TapV2.class); tapCustomizer = new TapV2Customizer(api, new NamingContext("ifcintest", IFC_TEST_INSTANCE)); } diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VhostUserCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VhostUserCustomizerTest.java index 0b26433f3..d7ee95863 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VhostUserCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VhostUserCustomizerTest.java @@ -43,10 +43,10 @@ import io.fd.jvpp.core.dto.ModifyVhostUserIf; import io.fd.jvpp.core.dto.ModifyVhostUserIfReply; import org.junit.Test; import org.mockito.ArgumentCaptor; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VhostUserRole; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.VhostUser; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.VhostUserBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VhostUserRole; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.VhostUser; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.VhostUserBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceKey; @@ -71,7 +71,7 @@ public class VhostUserCustomizerTest extends WriterCustomizerTest implements Ipv @Override public void setUpTest() throws Exception { InterfaceTypeTestUtils.setupWriteContext(writeContext, - org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VhostUser.class); + org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VhostUser.class); customizer = new VhostUserCustomizer(api, new NamingContext("generatedInterfaceName", "test-instance")); } diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizerTest.java index 3618a2335..3e11242a5 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizerTest.java @@ -39,11 +39,11 @@ import io.fd.jvpp.core.dto.VxlanAddDelTunnelReply; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mock; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.L2Input; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VxlanVni; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Vxlan; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.VxlanBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.L2Input; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VxlanVni; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Vxlan; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.VxlanBuilder; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.fib.table.management.rev180521.VniReference; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone; @@ -81,7 +81,7 @@ public class VxlanCustomizerTest extends WriterCustomizerTest implements Address @Override public void setUpTest() throws Exception { InterfaceTypeTestUtils.setupWriteContext(writeContext, - org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VxlanTunnel.class); + org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VxlanTunnel.class); customizer = new VxlanCustomizer(api, new NamingContext("generateInterfaceNAme", "test-instance"), disableContext); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizerTest.java index 6b0dc85b5..24d6dc912 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizerTest.java @@ -38,11 +38,11 @@ import io.fd.jvpp.core.dto.VxlanGpeAddDelTunnelReply; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mock; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VxlanGpeNextProtocol; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VxlanGpeVni; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.VxlanGpe; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.VxlanGpeBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VxlanGpeNextProtocol; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VxlanGpeVni; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.VxlanGpe; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.VxlanGpeBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; @@ -80,7 +80,7 @@ public class VxlanGpeCustomizerTest extends WriterCustomizerTest implements Addr @Override public void setUpTest() throws Exception { InterfaceTypeTestUtils.setupWriteContext(writeContext, - org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VxlanGpeTunnel.class); + org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VxlanGpeTunnel.class); NamingContext namingContext = new NamingContext("generateInterfaceName", "test-instance"); customizer = new VxlanGpeCustomizer(api, namingContext, interfaceDisableContext); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/span/MirroredInterfacesCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/span/MirroredInterfacesCustomizerTest.java index c75083760..6d8beea92 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/span/MirroredInterfacesCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/span/MirroredInterfacesCustomizerTest.java @@ -30,12 +30,12 @@ import io.fd.jvpp.core.dto.SwInterfaceSpanEnableDisableReply; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.Captor; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.SpanState; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.Span; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.attributes.MirroredInterfaces; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.attributes.mirrored.interfaces.MirroredInterface; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.attributes.mirrored.interfaces.MirroredInterfaceBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.SpanState; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.Span; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.attributes.MirroredInterfaces; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.attributes.mirrored.interfaces.MirroredInterface; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.attributes.mirrored.interfaces.MirroredInterfaceBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceKey; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/AfPacketCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/AfPacketCustomizerTest.java index 5a4ef63b4..8094a5866 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/AfPacketCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/AfPacketCustomizerTest.java @@ -35,10 +35,10 @@ import io.fd.jvpp.core.dto.SwInterfaceDetails; import java.util.Collections; import org.junit.Test; import org.mockito.Mock; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentationBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.AfPacket; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.AfPacketBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentationBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.AfPacket; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.AfPacketBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey; @@ -100,9 +100,9 @@ public class AfPacketCustomizerTest extends InitializingReaderCustomizerTest { + + private static final String IFC_CTX_NAME = "ifc-test-stats-instance"; + private static final String IF_NAME = "testIfc"; + private static final int SW_IF_INDEX = 1; + private static final int OUT_ERRORS = 2; + private static final int OUT_MULTI = 3; + private static final int OUT_UNI = 4; + private static final int OUT_BROAD = 5; + private static final int OUT_BYTES = 6; + private static final int IN_ERRORS = 22; + private static final int IN_MULTI = 33; + private static final int IN_UNI = 44; + private static final int IN_BROAD = 55; + private static final int IN_BYTES = 66; + private NamingContext interfaceContext; + private static final InstanceIdentifier IID = + InstanceIdentifier.create(InterfacesState.class).child(Interface.class, new InterfaceKey(IF_NAME)) + .child(Statistics.class); + @Mock + private FutureJVppStatsFacade jvppStats; + + private InterfaceStatisticsManager statisticsManager; + + public InterfaceStatisticsCustomizerTest() { + super(Statistics.class, InterfaceBuilder.class); + } + + @Override + public void setUp() { + interfaceContext = new NamingContext("generatedIfaceName", IFC_CTX_NAME); + interfaceContext.addName(1, IF_NAME, ctx.getMappingContext()); + } + + @Override + protected ReaderCustomizer initCustomizer() { + statisticsManager = new InterfaceStatisticsManagerImpl(); + return new InterfaceStatisticsCustomizer(interfaceContext, jvppStats, statisticsManager); + } + + @Test + public void testReadStatistics() throws Exception { + statisticsManager.enableStatistics(); + when(ctx.getMappingContext().read(any())) + .thenReturn(Optional.of(new MappingBuilder().setName(IF_NAME).setIndex(SW_IF_INDEX).build())); + when(jvppStats.interfaceStatisticsDump(any())).thenReturn(future(getStatistics())); + StatisticsBuilder statBuilder = new StatisticsBuilder(); + getCustomizer().readCurrentAttributes(IID, statBuilder, ctx); + Statistics stat = statBuilder.build(); + int[] expected = new int[]{SW_IF_INDEX, OUT_ERRORS, OUT_MULTI, OUT_UNI, OUT_BROAD, + OUT_BYTES, IN_ERRORS, IN_MULTI, IN_UNI, IN_BROAD, IN_BYTES}; + int[] actual = new int[]{interfaceContext.getIndex(IF_NAME, ctx.getMappingContext()), + stat.getOutErrors().getValue().intValue(), stat.getOutMulticastPkts().getValue().intValue(), + stat.getOutUnicastPkts().getValue().intValue(), stat.getOutBroadcastPkts().getValue().intValue(), + stat.getOutOctets().getValue().intValue(), stat.getInErrors().getValue().intValue(), + stat.getInMulticastPkts().getValue().intValue(), stat.getInUnicastPkts().getValue().intValue(), + stat.getInBroadcastPkts().getValue().intValue(), stat.getInOctets().getValue().intValue()}; + + Assert.assertArrayEquals(expected, actual); + } + + @Test(expected = ReadFailedException.class) + public void testReadStatisticsFailed() throws Exception { + statisticsManager.enableStatistics(); + when(ctx.getMappingContext().read(any())) + .thenReturn(Optional.of(new MappingBuilder().setName(IF_NAME).setIndex(SW_IF_INDEX).build())); + when(jvppStats.interfaceStatisticsDump(any())).thenReturn(future(null)); + StatisticsBuilder statBuilder = new StatisticsBuilder(); + getCustomizer().readCurrentAttributes(IID, statBuilder, ctx); + } + + private InterfaceStatisticsDetailsReplyDump getStatistics() { + InterfaceStatisticsDetailsReplyDump dumpReply = new InterfaceStatisticsDetailsReplyDump(); + dumpReply.interfaceStatisticsDetails = new InterfaceStatisticsDetails(1, 1); + dumpReply.interfaceStatisticsDetails.interfaceStatistics[0] = + new InterfaceStatistics(SW_IF_INDEX, OUT_ERRORS, OUT_MULTI, OUT_UNI, OUT_BROAD, + OUT_BYTES, IN_ERRORS, IN_MULTI, IN_UNI, IN_BROAD, IN_BYTES); + return dumpReply; + } +} diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/L2CustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/L2CustomizerTest.java index cc73e5a32..0cdaacd92 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/L2CustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/L2CustomizerTest.java @@ -36,12 +36,12 @@ import java.util.List; import java.util.Map; import org.junit.Test; import org.mockito.Mock; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentationBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.L2; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.L2Builder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.state.attributes.Interconnection; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.state.attributes.interconnection.BridgeBasedBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentationBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.L2; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.L2Builder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.state.attributes.Interconnection; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.state.attributes.interconnection.BridgeBasedBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/TapV2CustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/TapV2CustomizerTest.java index d64b837ba..69d1ee519 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/TapV2CustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/TapV2CustomizerTest.java @@ -36,10 +36,10 @@ import io.fd.jvpp.core.dto.SwInterfaceTapV2Details; import io.fd.jvpp.core.dto.SwInterfaceTapV2DetailsReplyDump; import org.junit.Test; import org.mockito.Mock; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentationBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.TapV2; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.TapV2Builder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentationBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.TapV2; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.TapV2Builder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VhostUserCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VhostUserCustomizerTest.java index 064b6cbfe..ac0c643c0 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VhostUserCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VhostUserCustomizerTest.java @@ -33,11 +33,11 @@ import io.fd.jvpp.core.dto.SwInterfaceVhostUserDetailsReplyDump; import java.math.BigInteger; import org.junit.Test; import org.mockito.Mock; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VhostUserRole; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentationBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.VhostUser; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.VhostUserBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VhostUserRole; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentationBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.VhostUser; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.VhostUserBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizerTest.java index 86e26ed82..bd7d47e86 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizerTest.java @@ -39,11 +39,11 @@ import io.fd.jvpp.core.dto.VxlanTunnelDetailsReplyDump; import io.fd.jvpp.core.dto.VxlanTunnelDump; import org.junit.Test; import org.mockito.Mock; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.L2Input; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentationBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.Vxlan; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.VxlanBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.L2Input; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentationBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.Vxlan; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.VxlanBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanGpeCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanGpeCustomizerTest.java index 99b1834f0..6629943b9 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanGpeCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanGpeCustomizerTest.java @@ -40,10 +40,10 @@ import io.fd.jvpp.core.dto.VxlanGpeTunnelDetailsReplyDump; import io.fd.jvpp.core.dto.VxlanGpeTunnelDump; import org.junit.Test; import org.mockito.Mock; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentationBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.VxlanGpe; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.VxlanGpeBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentationBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.VxlanGpe; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.VxlanGpeBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/span/MirroredInterfacesCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/span/MirroredInterfacesCustomizerTest.java index d04a71bf4..ebd22ea54 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/span/MirroredInterfacesCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/span/MirroredInterfacesCustomizerTest.java @@ -29,15 +29,15 @@ import io.fd.jvpp.core.dto.SwInterfaceSpanDetails; import io.fd.jvpp.core.dto.SwInterfaceSpanDetailsReplyDump; import java.util.Arrays; import org.junit.Test; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.SpanState; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.Span; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.SpanBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.state.attributes.MirroredInterfaces; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.state.attributes.MirroredInterfacesBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.state.attributes.mirrored.interfaces.MirroredInterface; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.state.attributes.mirrored.interfaces.MirroredInterfaceBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.span.state.attributes.mirrored.interfaces.MirroredInterfaceKey; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.SpanState; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceStateAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.Span; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces.state._interface.SpanBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.state.attributes.MirroredInterfaces; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.state.attributes.MirroredInterfacesBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.state.attributes.mirrored.interfaces.MirroredInterface; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.state.attributes.mirrored.interfaces.MirroredInterfaceBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.span.state.attributes.mirrored.interfaces.MirroredInterfaceKey; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizerTest.java index 6b839ae56..6aa8ebaca 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizerTest.java @@ -39,13 +39,13 @@ import io.fd.jvpp.core.types.Ip4Address; import io.fd.jvpp.core.types.MacAddress; import org.junit.Test; import org.mockito.ArgumentCaptor; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.BridgeDomains; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domain.attributes.ArpTerminationTable; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domain.attributes.arp.termination.table.ArpTerminationTableEntry; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domain.attributes.arp.termination.table.ArpTerminationTableEntryBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domain.attributes.arp.termination.table.ArpTerminationTableEntryKey; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.BridgeDomain; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.BridgeDomainKey; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.BridgeDomains; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domain.attributes.ArpTerminationTable; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domain.attributes.arp.termination.table.ArpTerminationTableEntry; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domain.attributes.arp.termination.table.ArpTerminationTableEntryBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domain.attributes.arp.termination.table.ArpTerminationTableEntryKey; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.BridgeDomain; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.BridgeDomainKey; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2/BridgeDomainCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2/BridgeDomainCustomizerTest.java index bf9de30a2..7c612b324 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2/BridgeDomainCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2/BridgeDomainCustomizerTest.java @@ -34,14 +34,14 @@ import io.fd.jvpp.core.dto.BridgeDomainAddDelReply; import java.util.Arrays; import javax.annotation.Nullable; import org.junit.Test; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.BridgeDomains; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentationBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.BridgeDomain; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.BridgeDomainBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.BridgeDomainKey; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces._interface.L2Builder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.config.attributes.interconnection.BridgeBasedBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.BridgeDomains; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.VppInterfaceAugmentationBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.BridgeDomain; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.BridgeDomainBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.BridgeDomainKey; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.interfaces._interface.L2Builder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.config.attributes.interconnection.BridgeBasedBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2/L2FibEntryCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2/L2FibEntryCustomizerTest.java index a379866cf..c01c203c9 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2/L2FibEntryCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2/L2FibEntryCustomizerTest.java @@ -34,15 +34,15 @@ import io.fd.jvpp.core.dto.L2FibAddDel; import io.fd.jvpp.core.dto.L2FibAddDelReply; import org.junit.Test; import org.mockito.ArgumentCaptor; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.BridgeDomains; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.L2FibFilter; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.L2FibForward; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.BridgeDomain; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.BridgeDomainKey; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.fib.attributes.L2FibTable; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.fib.attributes.l2.fib.table.L2FibEntry; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.fib.attributes.l2.fib.table.L2FibEntryBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.fib.attributes.l2.fib.table.L2FibEntryKey; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.BridgeDomains; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.L2FibFilter; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.L2FibForward; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.BridgeDomain; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.BridgeDomainKey; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.fib.attributes.L2FibTable; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.fib.attributes.l2.fib.table.L2FibEntry; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.fib.attributes.l2.fib.table.L2FibEntryBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.fib.attributes.l2.fib.table.L2FibEntryKey; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2state/BridgeDomainCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2state/BridgeDomainCustomizerTest.java index efeb710f8..5db7ace68 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2state/BridgeDomainCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2state/BridgeDomainCustomizerTest.java @@ -19,10 +19,10 @@ package io.fd.hc2vpp.v3po.l2state; import io.fd.hc2vpp.common.test.read.ListReaderCustomizerTest; import io.fd.hc2vpp.common.translate.util.NamingContext; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.BridgeDomainsStateBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.state.BridgeDomain; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.state.BridgeDomainBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.state.BridgeDomainKey; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.BridgeDomainsStateBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.state.BridgeDomain; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.state.BridgeDomainBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.state.BridgeDomainKey; public class BridgeDomainCustomizerTest diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2state/L2FibEntryCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2state/L2FibEntryCustomizerTest.java index 1d6a7c8c3..cd8d09231 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2state/L2FibEntryCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2state/L2FibEntryCustomizerTest.java @@ -33,15 +33,15 @@ import java.util.Collections; import java.util.List; import java.util.concurrent.ExecutionException; import org.junit.Test; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.BridgeDomainsState; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.L2FibForward; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.state.BridgeDomain; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.state.BridgeDomainKey; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.fib.attributes.L2FibTable; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.fib.attributes.L2FibTableBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.fib.attributes.l2.fib.table.L2FibEntry; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.fib.attributes.l2.fib.table.L2FibEntryBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.l2.fib.attributes.l2.fib.table.L2FibEntryKey; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.BridgeDomainsState; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.L2FibForward; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.state.BridgeDomain; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.state.BridgeDomainKey; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.fib.attributes.L2FibTable; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.fib.attributes.L2FibTableBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.fib.attributes.l2.fib.table.L2FibEntry; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.fib.attributes.l2.fib.table.L2FibEntryBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.l2.fib.attributes.l2.fib.table.L2FibEntryKey; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2state/L2StateTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2state/L2StateTest.java index 651993637..21f3fb6c2 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2state/L2StateTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2state/L2StateTest.java @@ -52,11 +52,11 @@ import javax.annotation.Nonnull; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.BridgeDomainsState; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.BridgeDomainsStateBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.state.BridgeDomain; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.state.BridgeDomainBuilder; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.bridge.domains.state.BridgeDomainKey; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.BridgeDomainsState; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.BridgeDomainsStateBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.state.BridgeDomain; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.state.BridgeDomainBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.bridge.domains.state.BridgeDomainKey; import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/notification/InterfaceChangeNotificationProducerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/notification/InterfaceChangeNotificationProducerTest.java index fc2c2f946..f52bc45fe 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/notification/InterfaceChangeNotificationProducerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/notification/InterfaceChangeNotificationProducerTest.java @@ -38,8 +38,8 @@ import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.InterfaceStateChange; -import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.InterfaceStatus; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.InterfaceStateChange; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190502.InterfaceStatus; public class InterfaceChangeNotificationProducerTest implements FutureProducer, NamingContextHelper { -- cgit 1.2.3-korg