Commits
- Commit:
f20a053a0039f502076e560981f330b1ad494585
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
prevent leading spaces in rdomain-specific daemon config files
Rules for rdomain-specific daemons have double-indentation in nshrc.
When generating configuration files for daemons strip double-indentation
instead of stripping only one level of indentation.
- Commit:
d6013008902a0a4ffedcd76ecac89d3613041cf3
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
convert all command handlers to variadic functions
Resolves dozens of: warning: passing arguments to a function without a
prototype is deprecated in all versions of C and is not supported in C2x
In traditional C the empty argument list () indicates that a function
accepts an arbitrary amount of arguments of arbitary types. A function
which takes no arguments must be declared with a (void) prototype instead.
nsh has been making elaborate use of this feature by defining command handlers
with () and passing arbitrary arguments to handlers depending on the use case.
This coding style is not future-proof. In C++, () means "no arguments", the
same as (void), and clang is now warning about this C feature going away in
C2x, aligning C with C++.
Make nsh future-proof by using variadic function prototypes (...) instead
of () prototypes. Every handler now uses (int argc, char **argv, ...) as
prototype: the argument count, an argument vector, followed by arbitrary
arguments which can be extracted using the va_arg(3) function from stdarg.h.
The variadic part of the argument list can be used to pass arguments of types
other than char * without needing to convert them to strings and back.
Using () as function prototype defeats type-checking done by the compiler,
and the same is true for variadic arguments. We still need to manually make
sure that the correct amount and types of arguments are passed in the variadic
part of the handler's argument list.
Many handlers already use the argument count + argument vector approach and
do not need internal changes, just a new prototype.
Some handlers now require use of va_start/va_arg/va_end to access additional
arguments. For example, the interfaces handlers were passing an interface
name and file descriptor before the argument count/vector. The order of
arguments is now swapped, such that interface name and file descriptor get
passed as part of the variable argument list.
- Commit:
b96221e6b0fba68943e0414aebee615838bf6e58
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
update K&R-C-style prototypes in kroute.c to modern C
Fixes warning: a function definition without a prototype is deprecated in
all versions of C and is not supported in C2x
- Commit:
d3156eb934103cf1c3498a8908ef62b7dfa1b4d5
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
implement 'clear' command in interface/bridge mode
resolves warning: unused function 'int_clear' [-Wunused-function]
- Commit:
172f4d223a6ded46ac9c24c22b7e6f6f98a96b19
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
the stats handler functions don't take any arguments; make this explicit
- Commit:
aeb312dc188898e755568a71af91941fe1bcd5c8
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
mark catchsigwinch() in main.c as static to silence a compiler warning
- Commit:
0b2616cd90a96a2513145dfa69fd3df1a953f855
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
remove struct ctl2 and struct daemons2; convert everything to new format
test + ok Tom
- Commit:
4a206fc9175ec29f3356e0b5c39fd970b9933e33
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix whitespace in systatcs definition in commands.c
- Commit:
809a0cb53708c2842f9fcd0fd1122094cd2f7575
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix initialization of systatcs sentinel in commands.c
Repairs the following compile-time warning:
nsh/commands.c:403:17: warning: suggest braces around initialization
of subobject [-Wmissing-braces]
{ 0, 0, 0, 0 }
^~~~ { }
- Commit:
15a2fabe4d49f7c280b90dcce141c15804dbc37f
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
don't let a potential error in set_ifflags() clobber the errno we need
- Commit:
731e161842282fb84808712dcea8d05a9a7918fb
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
trim a comment which went beyond 80 columns
- Commit:
fcd96d69b52c17e31c79584592eda14b6da359c3
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix whitespace issues
- Commit:
fd352ad5f1b1b5bebf381644b212a7ddfb5be007
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
if.c - vlan parent devices automatically disable
disable the child interface and change parent and enable interface after the change made...
issue reported by Tom... fix authored by stsp
tested by Tom and reviewed OK Tom and OK Chris
- Commit:
21775861a453dd25aacb50e76637bdec1d1a31cf
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
preserve only manually added ndp table entries in startup config
nsh was mistakenly adding all ndp table entries to startup-config
when the configuration was saved with write-config. This results
in spurious 'permanent' ndp entries when the written config is loaded.
If you find spurious permanent ndp entries on your system these entries
must be removed via 'no ndp <IPv6 address>', then use 'write-config' to
save the fixed the configuration. Alternatively, remove all lines which
set unwanted permanent NDP entries from /etc/nshrc and reboot.
Problem reported and fix tested by Tom.
ok Tom
- Commit:
a19921892669f5995d8ded4c0cf7238bf40e6213
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Merge pull request #164 from smytht/systat-feature
add show system-stats commands Ok Stsp@
- Commit:
bfc7e834d72b4967b108d761f1770df6f6d5f4da
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Update cmdargs.c
Use proper english :) initialised not initalized
and give an informative error
- Commit:
3701c35479e9e9ab29b8f1c4dd0747e7f4c1487b
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
update nsh.8 to improve examples in standard width console screen
- Commit:
40daa21cd89d52dc1319f8fc6aab510860a626c4
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
oops, fix typo in previous which broke the build
- Commit:
0e3e46b7cc59653dde1d3ff7405536e920834a91
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
add show system-stats commands
This is to allow nsh users to avail of systat functionality
useful for queue stats and pf stats added full suite of systat features except nfs as I dont think those features are as interesting for a network appliance
- Commit:
914244e784096cdeb410b873056c382be77616d7
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix rtable number shown in error message when switching rdomains fails
- Commit:
00c101b2467c4db671ea0d0c27c59c405909045c
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
version bump for release 1.2.3
- Commit:
289def2f026b167a004a6da3f0b78509adb461aa
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
fix misspelling of privileged (sorry)
- Commit:
1577795c6e2133cfe184043565cdf67e9c4bf827
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
update version for release add example of help for config mode
- Commit:
0b080a2247e7f3c9d6f94023807565c7b84df88b
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
don't skip empty lines in rules which store file contents
When file contents were stored in /etc/nshrc in a rules directive, such
as contents of /etc/motd or sshd_config, empty lines were being stripped.
ok Tom
- Commit:
9bdde78d5a25b7c7ea4b20c3329fd368c0751709
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
make the rtable command actually update the rtable of the nsh process
The assumption that nsh always runs in rdomain 0 is invalid. Stop
assuming that cli_rtable is set to zero by default, and switch the
nsh process rdomain accordingly as needed.
Tests + ok Tom