1 # Copyright (c) 2016 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
14 """Proxy ARP library"""
16 from resources.libraries.python.VatExecutor import VatTerminal
19 class ProxyArp(object):
20 """Proxy ARP utilities."""
23 def vpp_add_proxy_arp(node, lo_ip4_addr, hi_ip4_addr):
24 """Enable proxy ARP for a range of IP addresses.
26 :param node: VPP node to enable proxy ARP.
27 :param lo_ip4_addr: The lower limit of the IP addresses.
28 :param hi_ip4_addr: The upper limit of the IP addresses.
30 :type lo_ip4_addr: str
31 :type hi_ip4_addr: str
33 with VatTerminal(node) as vat:
34 vat.vat_terminal_exec_cmd_from_template("add_proxy_arp.vat",
35 lo_ip4_addr=lo_ip4_addr,
36 hi_ip4_addr=hi_ip4_addr)