0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-09 12:48:43 +00:00
Commit Graph

46 Commits

Author SHA1 Message Date
Ondrej Zajicek
9aa5a3d958 Client: Unknown command should return nonzero errorcode 2024-05-30 12:29:59 +02:00
Ondrej Zajicek (work)
9b0b2c0d41 Client: Use exit status to report errors
When birdc is called with a command as an argument, it should set exit
status to non-zero when BIRD replied with an error reply code.

Thanks to Vincent Bernat and others for suggestion.
2022-03-11 03:52:50 +01:00
Ondrej Zajicek (work)
e7ed9ecba7 Client: Fix include 2017-08-22 14:03:38 +02:00
Ondrej Zajicek (work)
3f2c7600fa We don't need bvsnprintf() in BIRD client 2016-05-12 21:44:27 +02:00
Ondrej Zajicek (work)
f2ae2badff Main: Add local option
Add option that changes default paths for config file and control socket
to the current working directory.
2016-04-07 12:39:49 +02:00
Ondrej Zajicek
8137fe6d45 Allows shorthands for birdc noninteractive commands. 2013-11-25 02:03:23 +01:00
Ondrej Zajicek
4d4979c67c Fixes some potential issues with invalid term size in clients. 2013-11-20 13:25:33 +01:00
Ondrej Zajicek
a5e9f3d26f Restructures birdc and birdcl to merge duplicated code.
The BIRD client code is restructured that most of the code (including
main function) is shared in client.c, while birdc.c and birdcl.c contain
just I/O-specific callbacks. This removes all duplicated code from
variant-specific files.
2013-04-23 02:42:35 +02:00
Tomas Hlavacek
5c2c4ea8b1 Rename client/client.c to client_full.c
Rename client/client.c to client-full.c and change the Makefile accordingly.
This is a preparation step for introducing a new lightweight client which
should reuse as much code as possible from the old one but it should not depend
on external libraries.

Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>
2013-03-19 18:03:49 +01:00
Ondrej Filip
4c2abee74e Allow submitting BIRD commands from UNIX shell even in restricted mode. 2013-02-12 13:15:01 +01:00
Ondrej Zajicek
064e7be5cd History deduplication in birdc. 2012-05-04 00:20:23 +02:00
Ondrej Zajicek
154e2aeded Fixes string handling in birdc. 2010-12-13 11:17:11 +01:00
Ondrej Zajicek
e81b440f68 Fix configure to enable warnings and fix most of them. 2010-02-21 14:34:53 +01:00
Ondrej Zajicek
e0a45fb421 Restricted read-only CLI.
Also adds support for executing commands using birdc <cmd>.
2010-02-21 09:57:26 +01:00
Ondrej Zajicek
9c46ad8e2f Count number of lines (and not messages) in 'more'. 2009-08-12 10:16:32 +02:00
Ondrej Zajicek
f0333f44a5 Implements 'more' feature to birdc.
Also does some code restructuring.
2009-07-15 01:47:29 +02:00
Ondrej Zajicek
cf18603491 New syntax for bgp_path 2009-03-14 12:43:10 +01:00
Ondrej Zajicek
80ac7dc181 Do not use ? for client-side help when in new BGP path syntax 2009-02-12 13:41:34 +01:00
Ondrej Zajicek
661ec5db7f I am not sure whether this is proper fix for a problem that birdc
shows only parts of larger outputs (for example 'show route all').
It seems that birdc reads (from bird) and writes (to stdout)
everything but during execution of some readline code some already
written output disappeared (although it is fflush()ed and
tcdrain()ed).

As birdc reads from stdin when select said there are some data,
O_NONBLOCK for stdin is unnecessary and when it is removed,
i didn't notified this problem.
2008-11-21 13:05:12 +01:00
Ondrej Zajicek
e00115904f birdc died during terminal resize because of unhandled EINTR
in select loop.
2008-11-21 12:59:03 +01:00
Ondrej Zajicek
68fa95cfec Check of socket name length 2008-10-26 23:55:38 +01:00
Ondrej Filip
97c6fa02e0 Previous patch reverted. :-( 2008-08-25 12:06:20 +00:00
Ondrej Filip
030e3a79cb Buffer overflow fix. 2008-08-25 11:57:46 +00:00
Martin Mares
d7390312d4 Unused parameters in the client. 2004-06-05 09:26:48 +00:00
Martin Mares
7deffd845a Need <termios.h> for tcdrain(). 2004-05-31 20:51:45 +00:00
Martin Mares
5f2a6a9ff3 Fix handling on full pipe to client in bird. Prevent packet overflows
for even only medium sized route table output. Fix a strange garbled
output problem in the client. The latter seems to be caused by some
library doing tcflush while there is still command output pending. So
the best fix here is to do fflush and then tcdrain. Note that this
problem occurs only under certain load situations and is not too easy to
reproduce.

(by Andreas)
2004-05-31 17:55:30 +00:00
Ondrej Filip
bd62eeca27 Small change to compile client on FreeBSD. 2004-05-31 13:32:58 +00:00
Martin Mares
59b96d7b4d Don't use obsolete functions which are no longer declared in the header. 2002-11-13 08:45:24 +00:00
Martin Mares
01b776e117 Fixed <time.h> vs. <sys/time.h> problems. 2001-03-06 13:40:39 +00:00
Martin Mares
4daf03e513 Use our own SUN_LEN if libc doesn't provide it. 2000-06-16 23:12:47 +00:00
Martin Mares
0b3bf4b1d8 Use SUN_LEN() for length of UNIX domain addresses. This should fix problems
with connection to clients on libc5 machines.
2000-06-09 07:30:22 +00:00
Martin Mares
2983460bc0 Both help' command and the unknown command' error message now tell
the user to press `?' if he wants help.
2000-05-31 22:39:06 +00:00
Martin Mares
9e85a5e6f2 Delay user input whereever appropriate. 2000-05-29 22:16:04 +00:00
Martin Mares
d69e5ff2ad Use PATH_CONTROL_SOCKET instead of tacking on "bird.ctl" manually. 2000-05-08 14:29:30 +00:00
Martin Mares
221135d6bf Include "lib/string.h" instead of <string.h>. It should give us bzero()
and other non-portable functions on all systems.
2000-03-31 23:30:21 +00:00
Martin Mares
971b2310ae Commands which failed expansions are to be stored to history, too. 2000-03-12 22:55:09 +00:00
Martin Mares
3eb0b586ca No longer echoes commands before sending them. 2000-03-07 21:04:36 +00:00
Martin Mares
54fb7701a2 Fixed display of short continued messages in verbose mode. 2000-03-04 21:26:35 +00:00
Martin Mares
e69e4ed934 Support expansion of command abbreviations.
Client considered finished (modulo bugs).
2000-02-27 22:00:19 +00:00
Martin Mares
fae0396ea4 Completion works. Unfortunately, we have to access a couple of internal
symbols of libreadline :-(
2000-02-17 23:37:16 +00:00
Martin Mares
0223d4fff1 Client: Online help works (Cisco style: just press `?' at the end of a line). 2000-02-17 22:00:13 +00:00
Martin Mares
c51f132d58 First usable version of the client. No command completion and similar nifty
features yet, but it works.
2000-02-15 12:18:37 +00:00
Martin Mares
7211be1cff Configure, link and use the readline library. 2000-01-20 13:13:30 +00:00
Martin Mares
9fac310d1a Put client on a stony ground. The whole client is going to be system-specific
(the current version UNIX-specific) anyway, so it's useless to try splitting it
to sysdep and generic part. Instead of this, configure script decides (based on
system type and user's wish) what (if any) client should be built and what
autoconfiguration it requires. Also, the client provides its own die/bug/...
functions.
2000-01-19 15:07:00 +00:00
Martin Mares
f50b9e48b9 Generate a list of all commands and their help texts for the client to use. 2000-01-19 14:37:56 +00:00
Martin Mares
ed6081502a Added skeleton of the client. Does nothing, but at least compiles. 1999-10-29 09:44:44 +00:00