Age | Commit message (Collapse) | Author |
|
MacOS socket does not support SOCK_CLOEXEC. This patch uses fcntl
with FD_CLOEXEC instead of using SOCK_CLOEXEC in socket() call
Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
|
|
With GCC v8.x on Raspbian Buster the following warning is shown
at compile time:
...
[ 99%] Building C object accel-cmd/CMakeFiles/accel-cmd.dir/accel_cmd.c.o
/home/pi/accel-ppp/accel-cmd/accel_cmd.c: In function ‘main’:
/home/pi/accel-ppp/accel-cmd/accel_cmd.c:652:29: warning: comparison is always true due to limited range of data type [-Wtype-limits]
long_opts, &oindx)) != -1) {
^~
[100%] Linking C executable accel-cmd
[100%] Built target accel-cmd
This leads to the accel-cmd always just showing the usage
instructions rather than executing any commands.
This is because ochar is declared as a char rather than an int
so is considered to be unsigned by default. The man page says
the return value should be an int.
https://linux.die.net/man/3/getopt_long
|
|
|
|
New users typically use the -h or --help parameters to figure out how
to use accel-cmd. But this only displays accel-cmd options, so users
have no way to learn which accel-ppp commands are available.
This patch improves the help message to introduce the "help" command
which users can use to learn about other accel-ppp commands.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Create a CMakeLists.txt file for accel-cmd so that it gets
compiled and installed like accel-pppd.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
accel-cmd is a small program that reads commands from its command
line or standard input and sends them to accel-ppp (using the
tcp interface of the cli module). It displays accel-ppp's result
on standard output.
accel-cmd automatically appends the "exit" command to its command
list, so that accel-pppd will disconnect after sending its replies.
By default accel-cmd connects to localhost:2001.
Examples:
Send the "show sessions" command to accel-ppp and display the result:
$ accel-cmd show sessions
Execute commands from file "cmds" and display the results to stdout:
$ accel-cmd < cmds
Same as above, but use a different host and timeout after 1.5 seconds
of inactivity:
$ accel-cmd --timeout 1500ms --host accelppp.example.com < cmds
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|