]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
dhcpcd -V now shows all variables we set, even without an option.
authorRoy Marples <roy@marples.name>
Fri, 24 Apr 2009 16:48:35 +0000 (16:48 +0000)
committerRoy Marples <roy@marples.name>
Fri, 24 Apr 2009 16:48:35 +0000 (16:48 +0000)
dhcp.c
dhcpcd.8.in

diff --git a/dhcp.c b/dhcp.c
index c5feccad7df5ef958563bca64f25e945303e7cc5..8f59cb381364e269431e2283f28fbd91bcedad07 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -161,10 +161,39 @@ static const struct dhcp_opt const dhcp_opts[] = {
        { 0, 0, NULL }
 };
 
+static const char *if_params[] = {
+       "interface",
+       "reason",
+       "pid",
+       "ifmetric",
+       "ifwireless",
+       "ifflags",
+y      "profile",
+       "interface_order",
+       NULL
+};
+
+static const char *dhcp_params[] = {
+       "ip_address",
+       "subnet_cidr",
+       "network_number",
+       "ssid",
+       "filename",
+       "server_name",
+       NULL
+};
+
 void
 print_options(void)
 {
        const struct dhcp_opt *opt;
+       const char **p;
+
+       for (p = if_params; *p; p++)
+               printf(" -  %s\n", *p);
+
+       for (p = dhcp_params; *p; p++)
+               printf("    %s\n", *p);
 
        for (opt = dhcp_opts; opt->option; opt++)
                if (opt->var)
index 21c5313cfce4b84e5da6c818026e4d245cba1f6f..c3fff0c9257a3bbcd9137d4fb9f470f629b88642 100644 (file)
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd March 23, 2009
+.Dd April 24, 2009
 .Dt DHCPCD 8 SMM
 .Os
 .Sh NAME
@@ -462,6 +462,9 @@ files.
 .It Fl V, -variables
 Display a list of option codes and the associated variable for use in
 .Xr dhcpcd-run-hooks 8 .
+Variables are prefixed with new_ and old_ unless the option number is -.
+Variables without an option are part of the DHCP message and cannot be
+directly requested.
 .It Fl X, -blacklist Ar address Ns Op Ar /cidr
 Ignore all packets from
 .Ar address Ns Op Ar /cidr .
@@ -530,5 +533,5 @@ Please report them to http://roy.marples.name/projects/dhcpcd
 does not wait for commands to complete when sending them to the master
 .Nm
 process, nor does it echo its progress to stderr.
-This is a behaviour change dhcpcd-4 and may need to be addressed if
+This is a behaviour change from dhcpcd-4 and may need to be addressed if
 there is sufficient need.