X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FRouting.py;h=7bb41cbfad0bef813eab535ba026bc735c60838b;hb=b7b9a6f73347fba29060f3c2a2abfc4ea411de68;hp=1cbbf6b822a329da91e0ea8921134d53cad10102;hpb=8c12ff59f1a5e750151f5eb0e806dcc80e91c3c2;p=csit.git diff --git a/resources/libraries/python/Routing.py b/resources/libraries/python/Routing.py index 1cbbf6b822..7bb41cbfad 100644 --- a/resources/libraries/python/Routing.py +++ b/resources/libraries/python/Routing.py @@ -42,3 +42,25 @@ class Routing(object): prefix_length=prefix_len, gateway=gateway, sw_if_index=sw_if_index) + + @staticmethod + def add_fib_table(node, network, prefix_len, fib_id, place): + """Create new FIB table according to ID. + + :param node: Node to add FIB on. + :param network: IP address to add to the FIB table. + :param prefix_len: IP address prefix length. + :param fib_id: FIB table ID. + :param place: Possible variants are local, drop. + :type node: dict + :type network: str + :type prefix_len: int + :type fib_id: int + :type place: str + """ + with VatTerminal(node) as vat: + vat.vat_terminal_exec_cmd_from_template('add_fib_table.vat', + network=network, + prefix_length=prefix_len, + fib_number=fib_id, + where=place)