summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2005-07-04 17:51:45 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2005-07-04 17:51:45 +0000
commit0c68ccbe1e6aa68724211e463bc969e764789128 (patch)
tree22c5097f12f2b42842fee60cbf7c80904b1dcf97 /usr.sbin
parenta8655b8e4eb2175319eb9252eb47fb46390e6f23 (diff)
remove command line options -i, -a and -b (iapp interface, hostap interface
and broadcast mode). please use the configuration file hostapd.conf(5) instead, it is now mandatory to run hostapd with it.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/hostapd/hostapd.832
-rw-r--r--usr.sbin/hostapd/hostapd.c21
-rw-r--r--usr.sbin/hostapd/parse.y17
3 files changed, 19 insertions, 51 deletions
diff --git a/usr.sbin/hostapd/hostapd.8 b/usr.sbin/hostapd/hostapd.8
index 55bead568d2..efcaf1b5981 100644
--- a/usr.sbin/hostapd/hostapd.8
+++ b/usr.sbin/hostapd/hostapd.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: hostapd.8,v 1.8 2005/04/18 04:05:25 jolan Exp $
+.\" $OpenBSD: hostapd.8,v 1.9 2005/07/04 17:51:44 reyk Exp $
.\"
.\" Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
.\"
@@ -22,13 +22,11 @@
.Nd Host Access Point daemon
.Sh SYNOPSIS
.Nm hostapd
-.Op Fl bdv
-.Op Fl a Ar interface
+.Op Fl dv
.Oo Xo
.Fl D Ar macro Ns = Ns Ar value Oc
.Xc
.Op Fl f Ar file
-.Op Fl i Ar interface
.Sh DESCRIPTION
.Nm
is a daemon which allows communication between different 802.11
@@ -49,12 +47,9 @@ additionally allows the monitoring and logging of station associations on a
non-hostap host which is receiving IAPP messages.
.Pp
.Nm
-uses two network interfaces as options on startup.
-The first interface,
-specified using the
-.Fl a
-flag,
-is used to access the Host AP,
+uses two network interfaces on startup specified in the configuration file
+.Xr hostapd.conf 5 .
+The first interface is used to access the Host AP,
which is a wireless interface running in Host AP mode.
Host AP mode can be enabled using
.Xr ifconfig 8 .
@@ -76,16 +71,6 @@ remove a station which has been associated to another access point.
.Pp
The options are as follows:
.Bl -tag -width Ds
-.It Fl a Ar interface
-Specify the 802.11 wireless network interface running in Host AP mode.
-This option could be omitted to use the
-.Nm
-to log received
-.Pa IAPP
-messages.
-.It Fl b
-Use UDP broadcast instead of multicast group 224.0.1.178 for IAPP
-messages.
.It Fl D Ar macro Ns = Ns Ar value
Define
.Ar macro
@@ -103,13 +88,6 @@ Use
.Ar file
as the configuration file, instead of the default
.Pa /etc/hostapd.conf .
-.It Fl i Ar interface
-Specify the network interface used to send
-.Pa IAPP
-messages.
-It is important that the IAPP interface is on a trusted
-network because there is no authentication and an attacker could force
-disassociation of selected stations on all listening access points.
.It Fl v
Produce more verbose output.
.El
diff --git a/usr.sbin/hostapd/hostapd.c b/usr.sbin/hostapd/hostapd.c
index 0a971817c63..d437cd81819 100644
--- a/usr.sbin/hostapd/hostapd.c
+++ b/usr.sbin/hostapd/hostapd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hostapd.c,v 1.13 2005/07/04 17:13:39 reyk Exp $ */
+/* $OpenBSD: hostapd.c,v 1.14 2005/07/04 17:51:44 reyk Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
@@ -60,8 +60,8 @@ char printbuf[BUFSIZ];
void
hostapd_usage(void)
{
- fprintf(stderr, "usage: %s [-bdv] [-a interface] [-D macro=value] "
- "[-f file] [-i interface]\n", __progname);
+ fprintf(stderr, "usage: %s [-dv] [-D macro=value] [-f file]\n",
+ __progname);
exit(EXIT_FAILURE);
}
@@ -369,15 +369,8 @@ main(int argc, char *argv[])
/*
* Get and parse command line options
*/
- while ((ch = getopt(argc, argv, "a:bf:D:di:v")) != -1) {
+ while ((ch = getopt(argc, argv, "f:D:dv")) != -1) {
switch (ch) {
- case 'a':
- hostap_iface = optarg;
- cfg->c_flags |= HOSTAPD_CFG_F_APME;
- break;
- case 'b':
- cfg->c_flags |= HOSTAPD_CFG_F_BRDCAST;
- break;
case 'f':
config = optarg;
break;
@@ -389,10 +382,6 @@ main(int argc, char *argv[])
case 'd':
debug++;
break;
- case 'i':
- iapp_iface = optarg;
- cfg->c_flags |= HOSTAPD_CFG_F_IAPP;
- break;
case 'v':
cfg->c_verbose++;
break;
@@ -419,7 +408,7 @@ main(int argc, char *argv[])
/* Parse the configuration file */
if (hostapd_parse_file(cfg) != 0)
- hostapd_fatal("invalid configuration\n");
+ hostapd_fatal("invalid configuration in %s\n", cfg->c_config);
if ((cfg->c_flags & HOSTAPD_CFG_F_IAPP) == 0)
hostapd_fatal("unspecified IAPP interface\n");
diff --git a/usr.sbin/hostapd/parse.y b/usr.sbin/hostapd/parse.y
index 3d06bc71d47..003bde9c3c7 100644
--- a/usr.sbin/hostapd/parse.y
+++ b/usr.sbin/hostapd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.7 2005/07/04 16:48:55 reyk Exp $ */
+/* $OpenBSD: parse.y,v 1.8 2005/07/04 17:51:44 reyk Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
@@ -842,6 +842,10 @@ not : /* empty */
{
negative = 1;
}
+ | NOT
+ {
+ negative = 1;
+ }
;
%%
@@ -1212,17 +1216,14 @@ hostapd_parse_file(struct hostapd_config *cfg)
struct sym *sym, *next;
int ret;
- if ((fin = fopen(cfg->c_config, "r")) == NULL) {
- hostapd_log(HOSTAPD_LOG, "unable to find %s, using defaults\n",
- cfg->c_config);
- return (0);
- }
+ if ((fin = fopen(cfg->c_config, "r")) == NULL)
+ hostapd_fatal("failed to open %s\n", cfg->c_config);
+
infile = cfg->c_config;
if (hostapd_check_file_secrecy(fileno(fin), cfg->c_config)) {
- hostapd_fatal("invalid permissions for %s\n", cfg->c_config);
fclose(fin);
- return (-1);
+ hostapd_fatal("invalid permissions for %s\n", cfg->c_config);
}
/* Init tables and data structures */