summaryrefslogtreecommitdiff
path: root/accel-pppd/cli
AgeCommit message (Collapse)Author
2019-01-19ipoe/cli: fix build warningsVladislav Grishenko
2018-10-26cli: fix include directive for list.hGuillaume Nault
list.h is an accel-ppp internal file. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-10-23cli: add network namespace column in "show sessions"Guillaume Nault
Define a new column, called "netns", that prints the network namespace in which sessions are set. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-10-23ipv6: fix IPv6 processing of sessions that only have only a link-local addressGuillaume Nault
Several modules assume that if ses->ipv6 is set, then ses->ipv6->addr_list contains at least one element. But this is not true if ipv6 was allocated by the pseudo ipdb backend of ipv6cp (ipv6cp_opt_intfid.c). That is, if the PPP session only has an automatic link-local address. This leads modules like pppd-compat and dhcpv6 to access invalid memory when trying to retrieve the IPv6 address of a PPP session. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-01-13updated default config fileDmitry Kozlov
2018-01-13cli: show sessions: added uptime-raw columnt to print uptime in secondsDmitry Kozlov
2017-12-26reworked context prioritiesDmitry Kozlov
Introduced 4 priorities: 0 - management (cli) 1 - starting sessions (default priority) 2 - active sessions 3 - finishing sessions
2017-10-16move build_ip6_addr function to ipdb.cDmitry Kozlov
2017-09-25cli: introduced ip6 and ip6-dp fields in "show sessions" commandDmitry Kozlov
2016-05-31accel-ppp Debian x32 fix minor -Wformat warningsMarek Michalkiewicz
Hello, small patch to avoid gcc -Wformat warnings on Debian x32 where time_t is "long long" (64-bit signed, to be 2038 safe), not "unsigned long" (32-bit unsigned) corresponding to "%lu" format strings. Regards, Marek
2016-04-28cli: flush pending data before disconnectingGuillaume Nault
The telnet and tcp servers disconnect as soon as they receive the 'exit' command or see a disconnection from the client. In this case, all data queued for transmission are lost. This can lead to truncated output when big amount of data is being sent. For example, on a moderately loaded server with a few thouthands connections, the output of the 'accel-cmd show sessions' command can be truncated. The problem is that accel-cmd sends the 'show sessions' command, followed by 'exit'. It does so because it has to stop running once all data has been received from the server. But it never knows whether more data are going to arrive. Disconnection must then come from the server, hence the use of 'exit' (although the same effect could be achieved with shutdown(SHUT_WR)). The telnet and tcp modules behave very similarly and are modified in the same way: * For a soft disconnection, cln_read() doesn't call disconnect() anymore if there are data queued for transmission. Instead it sets the 'disconnect' flag and stops listening to its peer (no need to process further messages). * cln_write() checks the 'disconnect' flag once it has sent all pending data and actually performs the disconnection if necessary. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2016-04-28cli: fix data output miss-orderingGuillaume Nault
In tcp and telnet backends, the first buffer been queued is directly pointed to by cln->xmit_buf. It's not added to cln->xmit_queue. Therefore testing if ->xmit_queue is empty doesn't reliably tells if data has already been queued. We should test if ->xmit_buf is non-NULL instead. This is reliable because ->xmit_buf is re-filled with the first buffer from ->xmit_queue after every successful write(). Failure to properly check if data has already been queued can lead to message miss-ordering because cli_client_send() or telnet_send() will try to directly write() their input buffer, effectively bypassing the one previously queued up in ->xmit_buf. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2016-04-28cli: fix partial line duplication and truncationGuillaume Nault
When queueing output data for later write(), the 'n' first bytes of the buffer have already been sent (we have n > 0 if EAGAIN was returned after some other write() calls succeeded). Therefore, we need to skip these bytes when initialising the buffer to be queued. The size passed to memcpy() did already take that space into account. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2016-03-18improved restart and termination procedureDmitry Kozlov
2016-03-18make termination caused by SIGTERM softDmitry Kozlov
2015-11-30cli: show sesisons: introduced rx-bytes-raw,tx-bytes-raw fieldsDmitry Kozlov
2015-11-30cli: show sesisons: introduced rx-bytes,rx-pkts,tx-bytes,tx-pkts fieldsDmitry Kozlov
2014-11-22remove trailing whitespacesDmitry Kozlov
2014-10-22cli: introduced verbose optionDmitry Kozlov
If verbose=0 then cli won't produce any logging if verbose=1 then log only connections if verbose=2 then log also executed commands
2014-10-03get rid of time(), use clock_gettime(CLOCK_MONOTONIC) insteadDmitry Kozlov
2014-05-12triton: improved epoll events handlingDmitry Kozlov
2013-06-11fixed 'restart' commnd (stops all sessions, then do restart)Kozlov Dmitry
2013-06-04use /var/lib/accel-ppp instead /var/run/accel-pppKozlov Dmitry
2013-05-23cli: fixed 'restart' command (do soft restart, i.e. terminate sessions by ↵Dmitry Kozlov
default)
2013-02-17cli: Add the sessions-columns configuration optionGuillaume Nault
Define the "sessions-columns" option (in the [cli] section) to let the user select the default set of columns that will be displayed by the "show sessions" command. Unrecognised column names are silently discarded. Configuration example: [cli] telnet=127.0.0.1:2000 password=secret sessions-columns=ifname,ip,username Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2013-02-17cli: Fix "show sessions" if no column to displayGuillaume Nault
Gracefully handle the case where no column has been selected for the "show sessions" command. Such situation will be possible once the set of default displayed columns will be made configurable from accel-ppp.conf. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2013-02-13cli: Notify user of failed commandsGuillaume Nault
Handle CLI_CMD_FAILED like other command errors (i.e. return 0 to the caller and send a generic error message). This makes the CLI handler to flush its input buffer, so that processing of the next command will be made correctly. This also makes the telnet handler to send its prompt message. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2013-02-12cli: Skip leading spaces before calling regexp cmdsGuillaume Nault
Call regexp command handler without command line's leading spaces. This makes leading spaces handling consistent between the exec and help command handlers (leading spaces are already skipped before calling help handlers). This also gives the possibility to register an anchored regexp command without having to manage the leading spaces in that regexp. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2013-02-12cli: Handle arguments to the "help" commandGuillaume Nault
When arguments are supplied to the "help" command, only display help messages corresponding to the command these arguments refer to (e.g. "help pppoe" will only show help messages for commands starting with "pppoe"). Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2013-02-12cli: Modify regexp command handler registrationGuillaume Nault
Pass a full string, instead of an array of words, to the "help" callback of regexp command handlers. Also register these command handlers using a regexp to apply on "help" commands, just like for exec commands. The "help" callback will then be called only if the command matches the "help" regexp. As a side effect, the "help" word and its following spaces are skipped before calling the "help" callback for both simple and regexp commands. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2013-02-12cli: Improve word splitting functionsGuillaume Nault
* skip_word(): ensure the for() loop won't pass over a '\0' character * split(): ensure the for() loop won't try to fill buf[MAX_CMD_ITEMS] * split(): skip leading spaces. * split(): fix exit value if no item is found (return 0 instead of 1) Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2013-02-12cli: Pass complete command line to regexp handlersGuillaume Nault
Split regexp and simple command handling from the generic command processing function and handle regexp commands before simple ones. This avoids splitting the original command line before processing regexp command handlers, so that these handlers get the full command line instead of only the first word. The regexp command handlers are now only called when the command matches the regexp (regexp handlers were called unconditionaly before this patch). The rest of the processing properties should remain unchanged. Command processing summary: -If the command starts with the "help" keyword, then all help commands are called, starting with regexp help commands. -Otherwise, regexp command handlers whose regexp matches the command line are called. Then, simple command handlers whose header matches the command line are called. Any command handler that returns a value different from CLI_CMD_OK stops the process, thus preventing the following handlers from being called. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2013-02-12cli: Use dedicated "help" command handlerGuillaume Nault
Process "help" commands in a separated function with no side effect when the command doesn't match. This avoids splitting the input command line if not necessary (regexp command handlers need to receive the entire command line for being useful). Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2013-02-12cli: Fix regexp command handlingGuillaume Nault
* Call pcre_compile2() with all mandatory arguments and improve error message. * Register regexp commands in regexp_cmd_list instead of simple_cmd_list. * Fix "help" function call. * Interpret regexp command return codes (CLI_CMD_*) in the same way as for simple commands. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2013-01-24backport 1.7Kozlov Dmitry
* l2tp: Fix allocation checking when adding octets AVP * cli, tcp: Fix non-NULL terminated string reception * Fix va_end() missing calls * chap-secrets: implemented encryption * auth_pap: make messages like other auth modules * cli: check xmit_buf is not null at enter to write function * pppoe: implemented regular expression support * chap-secrets: implemented encryption * ippool: fixed initialization order * optional shaper compiling * ppp: dns/wins code cleanup
2013-01-24cli: show properly comp fieldKozlov Dmitry
2013-01-24merge upstreamKozlov Dmitry
2013-01-24move 'comp' field from struct ppp_t to struct ap_sessionroot
Conflicts: accel-pppd/ctrl/openvpn/openvpn.c
2012-09-05Fix format string errorsGuillaume Nault
Fix several errors and compiler warnings in format string arguments. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2012-09-05Add compilation checks for printf-style format stringsGuillaume Nault
Append the format() __attribute__ to function prototypes which use a format string. This allows GCC to check for consistency between the format string and its arguments when these functions are called. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2012-08-29add 'ppp' filed to CTRL to identify ppp sessionsKozlov Dmitry
2012-07-19Merge commit '918036a3c42cb6dd5b796c52b6aaf278c466c928'Kozlov Dmitry
* commit '918036a3c42cb6dd5b796c52b6aaf278c466c928': cli: telnet: check for disconnect condition while processing input chars
2012-07-19cli: telnet: check for disconnect condition while processing input charsKozlov Dmitry
2012-07-11futher session backup implementationKozlov Dmitry
cli: introduced 'restart' command to restrat daemon
2012-06-19general preparation for IPoE integrationKozlov Dmitry
2012-05-14cli: add 'comp' field to 'show sessions' to indicate compression/encryption ↵Kozlov Dmitry
method
2012-01-20cli: fix 'show sessions match'Kozlov Dmitry
2012-01-13set FD_CLOEXEC on opened file descriptorsKozlov Dmitry
2011-12-27snmp: implemneted new node (ACCEL-PPP-MIB::cli.0) which can be used to send ↵Kozlov Dmitry
cli commands
2011-08-23ppp: ipv6: multiple prefixes, route option, rdnss option implementationKozlov Dmitry