Commit graph

14 commits

Author SHA1 Message Date
Doug Torrance a75edac40d wmppp.app: Command line options take precedence over configuration files.
Since we now reread the configuration files on occasion, the options given
at the command line could be overwritten.  To avoid this, we save the
command line options and always use them if present.
2015-05-20 10:44:41 +01:00
Doug Torrance 3c16ef37ec wmppp.app: Reread configuration file.
Based in part on a patch by Chris Gray [1] to fix Debian bug #50181 [2].

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=12;filename=wmppp.diff;att=1;bug=50181
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=50181
2015-05-20 10:44:41 +01:00
Doug Torrance 2b0feb59f8 wmppp.app: Add new command line options.
We add command line options for the user to change the start, stop, speed,
ifdown, and stampfile settings at runtime.  This closes a Debian wishlist
bug [1].

Note that, in order to have the command line options overwrite the
defaults set in the configuration file, we split the command line parsing
code into a new function (parse_cmdline()).  We then merged main() and
wmppp_routine().

We document the new options in the help text and in the man page.  We also
take the opportunity to reformat the help text for the -i option and add
the -geometry option to the man page.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=293839
2015-05-20 10:44:41 +01:00
Doug Torrance 540b8ac560 wmppp.app: Fix segfault if stop_action or start_action strings are NULL. 2015-05-20 10:44:41 +01:00
Doug Torrance 37acf2a687 wmppp.app: Fix segfault when HOME undefined.
Instead, we exit with an error message.

This fixes Debian bug #716472 [1].

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=716472
2015-05-20 10:44:41 +01:00
Doug Torrance 9dab93996e wmppp.app: Use #includes from include-what-you-use.
We actually include <sys/socket.h> instead of <bits/socket_type.h>, as it
returns an error: "Never include <bits/socket_type.h> directly; use
<sys/socket.h> instead."
2015-05-20 10:44:41 +01:00
Doug Torrance b14003c1ee wmppp.app: Remove C++ style comments. 2015-05-20 10:44:41 +01:00
Doug Torrance c1b23f6a43 wmppp.app: Replace deprecated usleep with nanosleep. 2015-05-20 10:44:41 +01:00
Doug Torrance 7ec61f487b wmppp.app: Replace deprecated caddr_t cast with void*. 2015-05-20 10:44:41 +01:00
Doug Torrance 40aaf4c6af wmppp.app: Remove unused parameter from get_statistics().
Fixes "warning: unused parameter ‘devname’" compiler warning.
2015-05-20 10:44:41 +01:00
Doug Torrance 82aceda014 wmppp.app: Switch ifs to #ifs for macros.
Fixes "warning: null argument where non-null required" compiler warnings by
not passing NULL to strdup and "(warning) Conversion of string literal to
bool always evaluates to true" found by cppcheck.
2015-05-20 10:44:41 +01:00
Doug Torrance 8d3011886d wmppp.app: Reduce scope of several variables.
Fixes several "(style) The scope of the variable 'p' can be reduced" found
by cppcheck.
2015-05-20 10:44:41 +01:00
Doug Torrance 6b8351219c wmppp.app: Fix spelling mistakes.
Used codespell -w.
2015-05-20 10:44:41 +01:00
Doug Torrance 9d8970e27a wmppp.app: Move source files to top directory.
This way, users need only type "make" to build instead of needing to
"cd wmppp" first.
2015-05-20 10:44:41 +01:00
Renamed from wmppp.app/wmppp/wmppp.c (Browse further)