Fix for vppctl and interactive commands (VPP-1038)
authorChris Luke <[email protected]>
Thu, 26 Oct 2017 14:44:43 +0000 (10:44 -0400)
committerDamjan Marion <[email protected]>
Tue, 31 Oct 2017 08:04:14 +0000 (08:04 +0000)
commite3c13e8b5b1e799e687fd93783407548e2b96594
tree1c81fbbec197994f1d62a53cdf82f771a2a69a4d
parent088f042400fe104c86c86fb0de04aeb4b8013e74
Fix for vppctl and interactive commands (VPP-1038)

- Interactive commands like "ping" read extra input from the
  input stream.
- In the case of "ping" it is simply a signal to cease the current
  operation.
- "vppctl", in non-interactive mode, will issue a "quit" immediately
  after the requested command to queue up closing of the session.
- This resulted in "ping" thinking a keypress was seen and returning
  control to the CLI; the "quit" command however is consumed by the
  keypress event handler and thus the session does not close.

- This patch reworks vppctl slightly to only issue "quit" after the
  command has completed. In particular it uses the fact that VPP issues
  NUL bytes as a surrogate prompt between output of commands to signal
  acknowledgement that the command has completed; vppctl now flags
  that the quit should be issued after the next such acknowledgement.
- Since input it still accepted, the user can still terminate the
  "ping" early, if desired.

Change-Id: I7e3dbe767f32f8e364ccb5f81799759b311585df
Signed-off-by: Chris Luke <[email protected]>
src/vpp/app/vppctl.c