X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FIPv4Setup.py;h=36dc6050a170b03343f4b0aeded091ed9126f4ad;hp=7129e6723149ca882ebdf4eafcc60a710a079f4f;hb=f4e3171ec87416266291170f7c9cd089a9d2d8e4;hpb=03f1fa8fbf089b48365fff2bead6a2afb56efd89 diff --git a/resources/libraries/python/IPv4Setup.py b/resources/libraries/python/IPv4Setup.py index 7129e67231..36dc6050a1 100644 --- a/resources/libraries/python/IPv4Setup.py +++ b/resources/libraries/python/IPv4Setup.py @@ -60,17 +60,19 @@ class IPv4Node(object): pass @abstractmethod - def set_route(self, network, prefix_length, gateway, interface): + def set_route(self, network, prefix_length, gateway, interface, count=1): """Configure IPv4 route. :param network: Network IPv4 address. :param prefix_length: IPv4 prefix length. :param gateway: IPv4 address of the gateway. :param interface: Interface name. + :param count: Number of consecutive routes to add. :type network: str :type prefix_length: int :type gateway: str :type interface: str + :type route: int :returns: nothing """ pass @@ -146,7 +148,7 @@ class Tg(IPv4Node): interface) self._sudo_execute(cmd) - def set_route(self, network, prefix_length, gateway, interface): + def set_route(self, network, prefix_length, gateway, interface, count=1): netmask = self._get_netmask(prefix_length) cmd = 'route add -net {} netmask {} gw {}'.\ format(network, netmask, gateway)