aboutsummaryrefslogtreecommitdiffstats
path: root/build-data/packages/sample-plugin.mk
AgeCommit message (Expand)AuthorFilesLines
2020-04-30build: rework x86 CPU variantsDamjan Marion1-2/+2
2018-09-12cmake: create cmake VPP module, update sample-plugin so it uses itDamjan Marion1-0/+26
2018-03-15use system provided ccache linksDamjan Marion1-0/+1
2018-03-12License text cleanupDave Barach1-0/+13
2017-04-20Extend ebuild to specify "configure" subdir, enable verify for sample-pluginDamjan Marion1-0/+5
2016-06-05VPP-94: Add build-data directory for plugins and Makefile targetPierre Pfister1-47/+0
2016-04-01Add options to link with external DPDK treeDamjan Marion1-0/+5
2016-03-25vpp-api-test and sample-plugin should depend on dpdk conditionallyDamjan Marion1-6/+7
2016-01-22aarch64 CPU arch / ThunderX platform initial supportDave Barach1-1/+1
2015-12-08Initial commit of vpp code.v1.0.0Ed Warnicke1-0/+41
ef='#n20'>20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
# Copyright (c) 2021 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.

"""DHCP utilities for VPP."""


from resources.libraries.python.PapiExecutor import PapiSocketExecutor


class DhcpProxy:
    """DHCP Proxy utilities."""

    @staticmethod
    def vpp_get_dhcp_proxy(node, ip_version):
        """Retrieve DHCP relay configuration.

        :param node: VPP node.
        :param ip_version: IP protocol version: ipv4 or ipv6.
        :type node: dict
        :type ip_version: str
        :returns: DHCP relay data.
        :rtype: list
        """
        cmd = u"dhcp_proxy_dump"
        args = dict(is_ip6=1 if ip_version == u"ipv6" else 0)
        err_msg = f"Failed to get DHCP proxy dump on host {node[u'host']}"

        with PapiSocketExecutor(node) as papi_exec:
            details = papi_exec.add(cmd, **args).get_details(err_msg)

        return details