From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- src/spdk/scripts/rpc/net.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/spdk/scripts/rpc/net.py (limited to 'src/spdk/scripts/rpc/net.py') diff --git a/src/spdk/scripts/rpc/net.py b/src/spdk/scripts/rpc/net.py new file mode 100644 index 00000000..e1ba7aa8 --- /dev/null +++ b/src/spdk/scripts/rpc/net.py @@ -0,0 +1,29 @@ +def add_ip_address(client, ifc_index, ip_addr): + """Add IP address. + + Args: + ifc_index: ifc index of the nic device (int) + ip_addr: ip address will be added + """ + params = {'ifc_index': ifc_index, 'ip_address': ip_addr} + return client.call('add_ip_address', params) + + +def delete_ip_address(client, ifc_index, ip_addr): + """Delete IP address. + + Args: + ifc_index: ifc index of the nic device (int) + ip_addr: ip address will be deleted + """ + params = {'ifc_index': ifc_index, 'ip_address': ip_addr} + return client.call('delete_ip_address', params) + + +def get_interfaces(client): + """Display current interface list + + Returns: + List of current interface + """ + return client.call('get_interfaces') -- cgit v1.2.3