summaryrefslogtreecommitdiffstats
path: root/vpp-api/python/vpp_papi
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2016-08-31 14:50:49 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2016-09-02 12:36:48 +0000
commitc27213a30f4d6b5395ba70f011615ae9c7be93ce (patch)
tree903ebd888b1ff9ee10792412d6d369b340e5390b /vpp-api/python/vpp_papi
parent52901246e02c3d648c25a089c3dce5b6b4fb3112 (diff)
Add in-message cli_request/cli_reply API
This new CLI API is meant to replace the cli_request/cli_reply that uses shared memory. PS: checkstyle -- *hate* Change-Id: I6318f8f6b9be2c2398b49dac9e2193c1998ea724 Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'vpp-api/python/vpp_papi')
-rw-r--r--vpp-api/python/vpp_papi/vpp_papi.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/vpp-api/python/vpp_papi/vpp_papi.py b/vpp-api/python/vpp_papi/vpp_papi.py
index 6a7a358f6cd..144151c4154 100644
--- a/vpp-api/python/vpp_papi/vpp_papi.py
+++ b/vpp-api/python/vpp_papi/vpp_papi.py
@@ -99,6 +99,12 @@ def disconnect():
logging.info("Disconnected")
return rv
+# CLI convenience wrapper
+def cli_exec(cmd):
+ cmd += '\n'
+ r = cli_inband(len(cmd), cmd)
+ return r.reply[0].decode().rstrip('\x00')
+
def register_event_callback(callback):
event_callback_set(callback)