Added build option for disabling control interface (CONFIG_NO_CTRL_IFACE)
authorJouni Malinen <j@w1.fi>
Mon, 12 Jan 2009 19:44:57 +0000 (21:44 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 12 Jan 2009 19:44:57 +0000 (21:44 +0200)
hostapd/Makefile
hostapd/config.c
hostapd/ctrl_iface.h

index 7463316..efde3ed 100644 (file)
@@ -40,7 +40,7 @@ endif
 
 OBJS = hostapd.o ieee802_1x.o eapol_sm.o \
        config.o ieee802_11_auth.o \
-       sta_info.o wpa.o ctrl_iface.o \
+       sta_info.o wpa.o \
        drivers.o preauth.o pmksa_cache.o \
        hw_features.o \
        drv_callbacks.o \
@@ -77,6 +77,12 @@ else
 OBJS += vlan_init.o
 endif
 
+ifdef CONFIG_NO_CTRL_IFACE
+CFLAGS += -DCONFIG_NO_CTRL_IFACE
+else
+OBJS += ctrl_iface.o
+endif
+
 OBJS += ../src/crypto/md5.o
 OBJS += ../src/crypto/rc4.o
 OBJS += ../src/crypto/md4.o
index 3d520f5..5a5751a 100644 (file)
@@ -1902,6 +1902,7 @@ struct hostapd_config * hostapd_config_read(const char *fname)
                } else if (os_strcmp(buf, "pmk_r1_push") == 0) {
                        bss->pmk_r1_push = atoi(pos);
 #endif /* CONFIG_IEEE80211R */
+#ifndef CONFIG_NO_CTRL_IFACE
                } else if (os_strcmp(buf, "ctrl_interface") == 0) {
                        os_free(bss->ctrl_interface);
                        bss->ctrl_interface = os_strdup(pos);
@@ -1933,6 +1934,7 @@ struct hostapd_config * hostapd_config_read(const char *fname)
                        wpa_printf(MSG_DEBUG, "ctrl_interface_group=%d",
                                   bss->ctrl_interface_gid);
 #endif /* CONFIG_NATIVE_WINDOWS */
+#endif /* CONFIG_NO_CTRL_IFACE */
 #ifdef RADIUS_SERVER
                } else if (os_strcmp(buf, "radius_server_clients") == 0) {
                        os_free(bss->radius_server_clients);
index 2ac2f3b..4d9d663 100644 (file)
 #ifndef CTRL_IFACE_H
 #define CTRL_IFACE_H
 
+#ifndef CONFIG_NO_CTRL_IFACE
 int hostapd_ctrl_iface_init(struct hostapd_data *hapd);
 void hostapd_ctrl_iface_deinit(struct hostapd_data *hapd);
 void hostapd_ctrl_iface_send(struct hostapd_data *hapd, int level,
                             char *buf, size_t len);
+#else /* CONFIG_NO_CTRL_IFACE */
+static inline int hostapd_ctrl_iface_init(struct hostapd_data *hapd)
+{
+       return 0;
+}
+
+static inline void hostapd_ctrl_iface_deinit(struct hostapd_data *hapd)
+{
+}
+
+static inline void hostapd_ctrl_iface_send(struct hostapd_data *hapd,
+                                          int level, char *buf, size_t len)
+{
+}
+#endif /* CONFIG_NO_CTRL_IFACE */
 
 #endif /* CTRL_IFACE_H */