summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2005-10-07 22:32:53 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2005-10-07 22:32:53 +0000
commit043612a3d447b68083ceb04bfc44986cbc04f51b (patch)
treefa68ad9a3b55a699bd91fee5af37f471baa66112
parent6647ea05aff742016253d1428e71ed6118918651 (diff)
move IAPP definitions to separate header file
-rw-r--r--usr.sbin/hostapd/apme.c3
-rw-r--r--usr.sbin/hostapd/hostapd.c3
-rw-r--r--usr.sbin/hostapd/hostapd.h38
-rw-r--r--usr.sbin/hostapd/iapp.c3
-rw-r--r--usr.sbin/hostapd/iapp.h77
-rw-r--r--usr.sbin/hostapd/privsep.c3
6 files changed, 86 insertions, 41 deletions
diff --git a/usr.sbin/hostapd/apme.c b/usr.sbin/hostapd/apme.c
index 77ff8d33eae..153a99ccf51 100644
--- a/usr.sbin/hostapd/apme.c
+++ b/usr.sbin/hostapd/apme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apme.c,v 1.4 2005/06/17 19:13:35 reyk Exp $ */
+/* $OpenBSD: apme.c,v 1.5 2005/10/07 22:32:52 reyk Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
@@ -43,6 +43,7 @@
#include <unistd.h>
#include "hostapd.h"
+#include "iapp.h"
void hostapd_apme_frame(struct hostapd_config *, u_int8_t *, u_int);
diff --git a/usr.sbin/hostapd/hostapd.c b/usr.sbin/hostapd/hostapd.c
index 6b0e05bd72f..af11614042a 100644
--- a/usr.sbin/hostapd/hostapd.c
+++ b/usr.sbin/hostapd/hostapd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hostapd.c,v 1.20 2005/10/07 21:52:40 reyk Exp $ */
+/* $OpenBSD: hostapd.c,v 1.21 2005/10/07 22:32:52 reyk Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
@@ -47,6 +47,7 @@
#include <err.h>
#include "hostapd.h"
+#include "iapp.h"
void hostapd_usage(void);
void hostapd_udp_init(struct hostapd_config *);
diff --git a/usr.sbin/hostapd/hostapd.h b/usr.sbin/hostapd/hostapd.h
index f57496e8187..7a92cebd8e5 100644
--- a/usr.sbin/hostapd/hostapd.h
+++ b/usr.sbin/hostapd/hostapd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: hostapd.h,v 1.7 2005/09/30 16:50:03 reyk Exp $ */
+/* $OpenBSD: hostapd.h,v 1.8 2005/10/07 22:32:52 reyk Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
@@ -35,8 +35,6 @@
#include <net80211/ieee80211.h>
#include <net80211/ieee80211_ioctl.h>
-#define IEEE80211_IAPP_VERSION 0
-
/*
* hostapd (IAPP) <-> Host AP (APME)
*/
@@ -52,36 +50,6 @@ struct hostapd_node {
};
/*
- * IAPP <-> IAPP
- */
-
-struct ieee80211_iapp_frame {
- u_int8_t i_version;
- u_int8_t i_command;
- u_int16_t i_identifier;
- u_int16_t i_length;
-} __packed;
-
-enum ieee80211_iapp_frame_type {
- IEEE80211_IAPP_FRAME_ADD_NOTIFY = 0,
- IEEE80211_IAPP_FRAME_MOVE_NOTIFY = 1,
- IEEE80211_IAPP_FRAME_MOVE_RESPONSE = 2,
- IEEE80211_IAPP_FRAME_SEND_SECURITY_BLOCK = 3,
- IEEE80211_IAPP_FRAME_ACK_SECURITY_BLOCK = 4,
- IEEE80211_IAPP_FRAME_CACHE_NOTIFY = 5,
- IEEE80211_IAPP_FRAME_CACHE_RESPONSE = 6,
- IEEE80211_IAPP_FRAME_HOSTAPD_RADIOTAP = 12,
- IEEE80211_IAPP_FRAME_HOSTAPD_PCAP = 13
-};
-
-struct ieee80211_iapp_add_notify {
- u_int8_t a_length;
- u_int8_t a_reserved;
- u_int8_t a_macaddr[IEEE80211_ADDR_LEN];
- u_int16_t a_seqnum;
-} __packed;
-
-/*
* IAPP -> switches (LLC)
*/
@@ -301,10 +269,6 @@ struct hostapd_config {
TAILQ_HEAD(, hostapd_frame) c_frames;
};
-#define IAPP_PORT 3517 /* XXX this should be added to /etc/services */
-#define IAPP_MCASTADDR "224.0.1.178"
-#define IAPP_MAXSIZE 512
-
#define HOSTAPD_USER "_hostapd"
#define HOSTAPD_CONFIG "/etc/hostapd.conf"
#define HOSTAPD_DLT DLT_IEEE802_11
diff --git a/usr.sbin/hostapd/iapp.c b/usr.sbin/hostapd/iapp.c
index 95d4a09859b..c706b11be04 100644
--- a/usr.sbin/hostapd/iapp.c
+++ b/usr.sbin/hostapd/iapp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iapp.c,v 1.7 2005/08/17 13:18:33 reyk Exp $ */
+/* $OpenBSD: iapp.c,v 1.8 2005/10/07 22:32:52 reyk Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
@@ -40,6 +40,7 @@
#include <unistd.h>
#include "hostapd.h"
+#include "iapp.h"
void
hostapd_iapp_init(struct hostapd_config *cfg)
diff --git a/usr.sbin/hostapd/iapp.h b/usr.sbin/hostapd/iapp.h
new file mode 100644
index 00000000000..5bf24a5d214
--- /dev/null
+++ b/usr.sbin/hostapd/iapp.h
@@ -0,0 +1,77 @@
+/* $OpenBSD: iapp.h,v 1.1 2005/10/07 22:32:52 reyk Exp $ */
+
+/*
+ * Copyright (c) 2005 Reyk Floeter <reyk@vantronix.net>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _IAPP_H
+#define _IAPP_H
+
+#define IEEE80211_IAPP_VERSION 0
+
+/*
+ * IAPP (Inter Access Point Protocol)
+ */
+
+struct ieee80211_iapp_frame {
+ u_int8_t i_version;
+ u_int8_t i_command;
+ u_int16_t i_identifier;
+ u_int16_t i_length;
+} __packed;
+
+enum ieee80211_iapp_frame_type {
+ IEEE80211_IAPP_FRAME_ADD_NOTIFY = 0,
+ IEEE80211_IAPP_FRAME_MOVE_NOTIFY = 1,
+ IEEE80211_IAPP_FRAME_MOVE_RESPONSE = 2,
+ IEEE80211_IAPP_FRAME_SEND_SECURITY_BLOCK = 3,
+ IEEE80211_IAPP_FRAME_ACK_SECURITY_BLOCK = 4,
+ IEEE80211_IAPP_FRAME_CACHE_NOTIFY = 5,
+ IEEE80211_IAPP_FRAME_CACHE_RESPONSE = 6,
+ IEEE80211_IAPP_FRAME_HOSTAPD_RADIOTAP = 12,
+ IEEE80211_IAPP_FRAME_HOSTAPD_PCAP = 13
+};
+
+#define IEEE80211_IAPP_FRAME_TYPE_NAME { \
+ "add notify", \
+ "move notify", \
+ "move response", \
+ "send security block", \
+ "ack security block", \
+ "cache notify", \
+ "cache response", \
+ "reserved#07", \
+ "reserved#08", \
+ "reserved#09", \
+ "reserved#10", \
+ "reserved#11", \
+ "hostapd radiotap", \
+ "hostapd pcap" \
+ "reserved#14", \
+ "reserved#15", \
+}
+
+struct ieee80211_iapp_add_notify {
+ u_int8_t a_length;
+ u_int8_t a_reserved;
+ u_int8_t a_macaddr[IEEE80211_ADDR_LEN];
+ u_int16_t a_seqnum;
+} __packed;
+
+#define IAPP_PORT 3517
+#define IAPP_MCASTADDR "224.0.1.178"
+#define IAPP_MAXSIZE 512
+
+#endif /* _IAPP_H */
diff --git a/usr.sbin/hostapd/privsep.c b/usr.sbin/hostapd/privsep.c
index 5530cce53f5..7294841c83a 100644
--- a/usr.sbin/hostapd/privsep.c
+++ b/usr.sbin/hostapd/privsep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep.c,v 1.13 2005/08/17 13:18:33 reyk Exp $ */
+/* $OpenBSD: privsep.c,v 1.14 2005/10/07 22:32:52 reyk Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
@@ -50,6 +50,7 @@
#include <unistd.h>
#include "hostapd.h"
+#include "iapp.h"
enum hostapd_cmd_types {
PRIV_APME_BSSID, /* Get the Host AP's BSSID */