Powered by Apache

CVS log for nsh/ctl.c

[BACK] Up to [local] / nsh

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.25 / (download) - annotate - [select for diffs], Tue May 26 22:08:06 2009 UTC (2 years, 11 months ago) by chris
Branch: MAIN
CVS Tags: HEAD
Diff to previous 1.24 (colored)

DHCP relay agent suppot (per-interface)
I suppose the ctl infrastructure could be "extended" to handle interface stuff if the demand for this type of usage goes up

Revision 1.24 / (download) - annotate - [select for diffs], Wed Oct 29 17:00:31 2008 UTC (3 years, 6 months ago) by chris
Branch: MAIN
Diff to previous 1.23 (colored)

Use debug level 2 for ftp-proxy.  Otherwise clients that reset FTP control connections will fill up the logs.

Revision 1.23 / (download) - annotate - [select for diffs], Fri Apr 11 03:49:35 2008 UTC (4 years, 1 month ago) by chris
Branch: MAIN
Diff to previous 1.22 (colored)

'show bgp neighbor' has only optional flags, not required flags

Revision 1.22 / (download) - annotate - [select for diffs], Fri Mar 28 16:48:39 2008 UTC (4 years, 1 month ago) by chris
Branch: MAIN
Diff to previous 1.21 (colored)

-move call_editor handler to use just two arguments, not three
-

Revision 1.21 / (download) - annotate - [select for diffs], Thu Mar 20 07:45:51 2008 UTC (4 years, 1 month ago) by chris
Branch: MAIN
Diff to previous 1.20 (colored)

-finish committing inetd control
-per-config-file mode that gets set on writeline or edit

Revision 1.20 / (download) - annotate - [select for diffs], Mon Mar 10 04:46:03 2008 UTC (4 years, 2 months ago) by chris
Branch: MAIN
Diff to previous 1.19 (colored)

-support inetd through ctl interface
-put ! at bottom of interface conf output instead of the top, like
all other conf output already does

Revision 1.19 / (download) - annotate - [select for diffs], Sun Mar 9 05:17:57 2008 UTC (4 years, 2 months ago) by chris
Branch: MAIN
Diff to previous 1.18 (colored)

bgp (and others?) want the rule file to be 0600

Revision 1.18 / (download) - annotate - [select for diffs], Mon Feb 25 06:18:00 2008 UTC (4 years, 2 months ago) by chris
Branch: MAIN
Diff to previous 1.17 (colored)

not sure what i was thinking

Revision 1.17 / (download) - annotate - [select for diffs], Mon Feb 18 15:46:00 2008 UTC (4 years, 2 months ago) by chris
Branch: MAIN
Diff to previous 1.16 (colored)

add preliminary support for ftp-proxy enable (through ctl), but it can't
handle arguments yet (ftp-proxy XXXX) because nsh has no way of storing
arguments during runtime between sessions.  we could read the argument
list of the command, but it might stop running and then we lose that data
for the next nsh 'write'.  so a real infrastructure has to be developed to
keep state between nsh sessions, between writes.  now we just create temp
files in /var/run for the time between nsh -i and 'write' but that isn't
enough for things like this.  there may be a decent way to do this with
temp files, or this might be a good time to introduce a new infrastructure
which runs in the background.

this also adds dns manager support with three options - dns edit, dns local-
control, and dns dhcp-control.  this requires that /etc/resolv.conf becomes
a symlink to /var/run/resolv.conf.symlink.  in local-control, nsh
symlinks /var/run/resolv.conf.symlink to /var/run/resolv.conf which it also
gives you editor/rule control over.  in dhcp-control, nsh symlinks to
/var/run/resolv.conf.dhcp which is what dhclient-script needs to edit
when its in control (instead of trying to edit /etc/resolv.conf directly,
which would interfere with local-control mode if you were still using dhclient)

also while here, make conf_interfaces avoid specific interfaces during
generic run so they can be dumped later (pfsync for instance, so pfsync
interfaces can be setup after pf has already started)

Revision 1.16 / (download) - annotate - [select for diffs], Thu Feb 14 01:00:59 2008 UTC (4 years, 3 months ago) by chris
Branch: MAIN
Diff to previous 1.15 (colored)

-SIGINT longjmp back to command() loop
-Command completion framework based on ftp client's completion feature
-Import StringList library
-Import new StringList based makeargv() function with cursor argument
 locating trick

Now we need more command completions, only handles menu and interface name
completions at the moment.  We also need context sensitive help/usage
to pop up for uncompleted command arguments.

Revision 1.15 / (download) - annotate - [select for diffs], Fri Feb 8 03:31:35 2008 UTC (4 years, 3 months ago) by chris
Branch: MAIN
Diff to previous 1.14 (colored)

Preserve original formatting for rule files (dhcp, pf, etc..) instead
of parsing it into argv and re-writing argv with single spaces in between.
This way configs don't look like shit when they are folded into nshrc

Also rename show stats to show kernel, show stats was awkward
('show kernel mbuf' makes more sense than 'show stats mbuf')

Revision 1.14 / (download) - annotate - [select for diffs], Thu Feb 7 22:48:47 2008 UTC (4 years, 3 months ago) by chris
Branch: MAIN
Diff to previous 1.13 (colored)

Stop requiring action arguments (pf 'enable', etc..) in mode handlers
to be specified on a separate, indented line under a handler 'action' header.
It has always bugged me that the config file looked different than the
actual way the command was used in the shell itself.

THIS CHANGES CONFIGURATION SYNTAX!! (might as well do it now before the next
release, since vlan syntax changed slightly too)

Any config sections that looked like:

pf action
 enable
 reload

must now look like:

pf enable
pf reload

Revision 1.13 / (download) - annotate - [select for diffs], Thu Feb 7 19:20:41 2008 UTC (4 years, 3 months ago) by chris
Branch: MAIN
Diff to previous 1.12 (colored)

fix mode handler use (broken earlier this week)

Revision 1.12 / (download) - annotate - [select for diffs], Wed Feb 6 22:48:53 2008 UTC (4 years, 3 months ago) by chris
Branch: MAIN
Diff to previous 1.11 (colored)

convert my copyrights to simpler ISC-style copyright statement

Revision 1.11 / (download) - annotate - [select for diffs], Wed Feb 6 16:51:44 2008 UTC (4 years, 3 months ago) by chris
Branch: MAIN
Diff to previous 1.10 (colored)

terminate all argument lists parsed through step_optreq() with NULL
and not '\0'.  step_optreq() still terminates them with '\0' for execv()
(as per the exec(3) man page) once it sees the NULL, or when it runs out of
arguments to fill in.

in step_optreq, change the meaning of the last argument to 'skip' - that
is, how many arguments in the beginning of argv do we need to skip to get
to the optional arguments that we will fill in OPT or REQ arguments with.
now the number of non-OPT/REQ arguments in the compiled in argument
can be different than the number of arguments typed in (since they have
nothing to do with each other anyways, this flexibility makes sense)

this resolves the distaste with this function that I expressed in the last
commit message.  (step_optreq could be further improved to allow static
arguments to be mixed into optional argument lists, but given the limited
data available from the table, it's unclear to me how this would work in all
cases)

Revision 1.10 / (download) - annotate - [select for diffs], Tue Feb 5 04:39:53 2008 UTC (4 years, 3 months ago) by chris
Branch: MAIN
Diff to previous 1.9 (colored)

make ctl.c routines more generic, and replace separate routines for
each action with tables that contain the command names and argument lists.

uses genget in cmdhandler to sort with prefix/ambiguous support.  reuses code
from commands.c to parse the argument list from the table and fill space
allocated from the generic handler (pr_prot1, cmdhandler). this creates
step_optreq() which is currently dependant on the interpreted (typed or cmdrc)
command having the first two arguments never get copied over to the executed
argument list.  if you read the structures, then the drawbacks become
pretty obvious.

this is sort of a bug, or a cheap design trick but it fits the current usage
perfectly, so this note is just to remind me to think about it more in the
future as the usage of step_optreq() may become more sophisticated.

Revision 1.9 / (download) - annotate - [select for diffs], Mon Feb 4 02:49:46 2008 UTC (4 years, 3 months ago) by chris
Branch: MAIN
Diff to previous 1.8 (colored)

Destroy inappropriate use of CMP_ARG and rename it to MIN_ARG since is
is really only for comparing that an argument matches a minimum of the
characters supplied to the second position in the macro.

Next move from using half-assed minimum-matching/ambiguous proof to
being truly table driven by using genget everywhere.  This is done by
eliminating chains of if (CMP_ARG){...; return;} and using structs
which genget loops around to determine the shortest non-ambiguous
prefix.  This doesn't buy command completion yet!  But, by using
table driven command sets, it moves in the right direction.

Also replace use of CMP_ARG in places that are not table-driven to
isprefix() (it was already in genget.c) which does matching in the
opposite order, so nsh can know that an argument is "interface"
and match i, in, int, inte, ... but not match iff or other mis-spelled
arguments.  (CMP_ARG was just matching against the minimum non-
ambiguous part of the argument as compiled into nsh at any given
time, poor form)

Revision 1.8 / (download) - annotate - [select for diffs], Tue Jan 29 06:17:35 2008 UTC (4 years, 3 months ago) by chris
Branch: MAIN
Diff to previous 1.7 (colored)

use (int argc, char **argv) for all show commands, and start introducing
show bgp commands

Revision 1.7 / (download) - annotate - [select for diffs], Thu Jan 24 07:40:54 2008 UTC (4 years, 3 months ago) by chris
Branch: MAIN
Diff to previous 1.6 (colored)

-add relayctl options (except show options)
-create 'enabled' file to signal that services are enabled or disabled
so that conf_xrules can only enable services if it is actually desired
(this way a config can exist in nshrc for a daemon but stay turned off
across reboots) - this is a crude and simple way to keep state between
nsh sessions

Revision 1.6 / (download) - annotate - [select for diffs], Sun Jan 20 07:21:21 2008 UTC (4 years, 3 months ago) by chris
Branch: MAIN
Diff to previous 1.5 (colored)

why not control ntpd here too?

Revision 1.5 / (download) - annotate - [select for diffs], Sun Jan 20 06:08:49 2008 UTC (4 years, 3 months ago) by chris
Branch: MAIN
Diff to previous 1.4 (colored)

add snmpd control (before snmp gets built by default in openbsd, so you
have to install from /usr/src/usr.sbin/snmpd and /usr/src/usr.sbin/snmpctl
manually in order to use it)

Revision 1.4 / (download) - annotate - [select for diffs], Tue Jan 15 07:34:34 2008 UTC (4 years, 4 months ago) by chris
Branch: MAIN
Diff to previous 1.3 (colored)

-collaspe dhclient-kill.sh into if.c 'no ip dhcp' routine
-remote all ctl.c temp files in main.c on nsh -i routine

Revision 1.3 / (download) - annotate - [select for diffs], Tue Jan 15 06:10:12 2008 UTC (4 years, 4 months ago) by chris
Branch: MAIN
Diff to previous 1.2 (colored)

add DHCP daemon control and sasync daemon control to ctl.c and conf.c
(they are a natural fit)

Revision 1.2 / (download) - annotate - [select for diffs], Mon Jan 14 09:57:31 2008 UTC (4 years, 4 months ago) by chris
Branch: MAIN
Diff to previous 1.1 (colored)

Remove unnecessary clutter

Revision 1.1 / (download) - annotate - [select for diffs], Mon Jan 14 09:48:11 2008 UTC (4 years, 4 months ago) by chris
Branch: MAIN

This was the key piece of the last commit....

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>