Browse Source

Mark functions static if not used elsewhere and use proper prototypes

Jouni Malinen 16 years ago
parent
commit
7e5ba1b916

+ 2 - 6
hostapd/accounting.c

@@ -28,10 +28,6 @@
  * input/output octets and updates Acct-{Input,Output}-Gigawords. */
  * input/output octets and updates Acct-{Input,Output}-Gigawords. */
 #define ACCT_DEFAULT_UPDATE_INTERVAL 300
 #define ACCT_DEFAULT_UPDATE_INTERVAL 300
 
 
-/* from ieee802_1x.c */
-const char *radius_mode_txt(struct hostapd_data *hapd);
-int radius_sta_rate(struct hostapd_data *hapd, struct sta_info *sta);
-
 static void accounting_sta_get_id(struct hostapd_data *hapd,
 static void accounting_sta_get_id(struct hostapd_data *hapd,
 				  struct sta_info *sta);
 				  struct sta_info *sta);
 
 
@@ -266,8 +262,8 @@ void accounting_sta_start(struct hostapd_data *hapd, struct sta_info *sta)
 }
 }
 
 
 
 
-void accounting_sta_report(struct hostapd_data *hapd, struct sta_info *sta,
-			   int stop)
+static void accounting_sta_report(struct hostapd_data *hapd,
+				  struct sta_info *sta, int stop)
 {
 {
 	struct radius_msg *msg;
 	struct radius_msg *msg;
 	int cause = sta->acct_terminate_cause;
 	int cause = sta->acct_terminate_cause;

+ 3 - 0
hostapd/ieee802_1x.h

@@ -84,4 +84,7 @@ void ieee802_1x_free_radius_class(struct radius_class_data *class);
 int ieee802_1x_copy_radius_class(struct radius_class_data *dst,
 int ieee802_1x_copy_radius_class(struct radius_class_data *dst,
 				 const struct radius_class_data *src);
 				 const struct radius_class_data *src);
 
 
+const char *radius_mode_txt(struct hostapd_data *hapd);
+int radius_sta_rate(struct hostapd_data *hapd, struct sta_info *sta);
+
 #endif /* IEEE802_1X_H */
 #endif /* IEEE802_1X_H */

+ 7 - 6
src/drivers/driver_nl80211.c

@@ -1246,13 +1246,13 @@ static int wpa_driver_nl80211_create_monitor_interface(
 
 
 
 
 /**
 /**
- * wpa_driver_nl80211_init - Initialize WE driver interface
+ * wpa_driver_nl80211_init - Initialize nl80211 driver interface
  * @ctx: context to be used when calling wpa_supplicant functions,
  * @ctx: context to be used when calling wpa_supplicant functions,
  * e.g., wpa_supplicant_event()
  * e.g., wpa_supplicant_event()
  * @ifname: interface name, e.g., wlan0
  * @ifname: interface name, e.g., wlan0
  * Returns: Pointer to private data, %NULL on failure
  * Returns: Pointer to private data, %NULL on failure
  */
  */
-void * wpa_driver_nl80211_init(void *ctx, const char *ifname)
+static void * wpa_driver_nl80211_init(void *ctx, const char *ifname)
 {
 {
 	int s;
 	int s;
 	struct sockaddr_nl local;
 	struct sockaddr_nl local;
@@ -1386,13 +1386,13 @@ wpa_driver_nl80211_finish_drv_init(struct wpa_driver_nl80211_data *drv)
 
 
 
 
 /**
 /**
- * wpa_driver_nl80211_deinit - Deinitialize WE driver interface
- * @priv: Pointer to private wext data from wpa_driver_nl80211_init()
+ * wpa_driver_nl80211_deinit - Deinitialize nl80211 driver interface
+ * @priv: Pointer to private nl80211 data from wpa_driver_nl80211_init()
  *
  *
  * Shut down driver interface and processing of driver events. Free
  * Shut down driver interface and processing of driver events. Free
  * private data buffer if one was allocated in wpa_driver_nl80211_init().
  * private data buffer if one was allocated in wpa_driver_nl80211_init().
  */
  */
-void wpa_driver_nl80211_deinit(void *priv)
+static void wpa_driver_nl80211_deinit(void *priv)
 {
 {
 	struct wpa_driver_nl80211_data *drv = priv;
 	struct wpa_driver_nl80211_data *drv = priv;
 	int flags;
 	int flags;
@@ -1849,7 +1849,8 @@ static void wpa_driver_nl80211_add_scan_entry(struct wpa_scan_results *res,
  * @priv: Pointer to private wext data from wpa_driver_nl80211_init()
  * @priv: Pointer to private wext data from wpa_driver_nl80211_init()
  * Returns: Scan results on success, -1 on failure
  * Returns: Scan results on success, -1 on failure
  */
  */
-struct wpa_scan_results * wpa_driver_nl80211_get_scan_results(void *priv)
+static struct wpa_scan_results *
+wpa_driver_nl80211_get_scan_results(void *priv)
 {
 {
 	struct wpa_driver_nl80211_data *drv = priv;
 	struct wpa_driver_nl80211_data *drv = priv;
 	size_t ap_num = 0, len;
 	size_t ap_num = 0, len;

+ 20 - 19
src/eap_peer/eap_gpsk.c

@@ -130,8 +130,8 @@ static void eap_gpsk_deinit(struct eap_sm *sm, void *priv)
 }
 }
 
 
 
 
-const u8 * eap_gpsk_process_id_server(struct eap_gpsk_data *data,
-				      const u8 *pos, const u8 *end)
+static const u8 * eap_gpsk_process_id_server(struct eap_gpsk_data *data,
+					     const u8 *pos, const u8 *end)
 {
 {
 	u16 alen;
 	u16 alen;
 
 
@@ -161,8 +161,8 @@ const u8 * eap_gpsk_process_id_server(struct eap_gpsk_data *data,
 }
 }
 
 
 
 
-const u8 * eap_gpsk_process_rand_server(struct eap_gpsk_data *data,
-					const u8 *pos, const u8 *end)
+static const u8 * eap_gpsk_process_rand_server(struct eap_gpsk_data *data,
+					       const u8 *pos, const u8 *end)
 {
 {
 	if (pos == NULL)
 	if (pos == NULL)
 		return NULL;
 		return NULL;
@@ -219,10 +219,11 @@ static int eap_gpsk_select_csuite(struct eap_sm *sm,
 }
 }
 
 
 
 
-const u8 * eap_gpsk_process_csuite_list(struct eap_sm *sm,
-					struct eap_gpsk_data *data,
-					const u8 **list, size_t *list_len,
-					const u8 *pos, const u8 *end)
+static const u8 * eap_gpsk_process_csuite_list(struct eap_sm *sm,
+					       struct eap_gpsk_data *data,
+					       const u8 **list,
+					       size_t *list_len,
+					       const u8 *pos, const u8 *end)
 {
 {
 	if (pos == NULL)
 	if (pos == NULL)
 		return NULL;
 		return NULL;
@@ -374,8 +375,8 @@ static struct wpabuf * eap_gpsk_send_gpsk_2(struct eap_gpsk_data *data,
 }
 }
 
 
 
 
-const u8 * eap_gpsk_validate_rand(struct eap_gpsk_data *data, const u8 *pos,
-				  const u8 *end)
+static const u8 * eap_gpsk_validate_rand(struct eap_gpsk_data *data,
+					 const u8 *pos, const u8 *end)
 {
 {
 	if (end - pos < EAP_GPSK_RAND_LEN) {
 	if (end - pos < EAP_GPSK_RAND_LEN) {
 		wpa_printf(MSG_DEBUG, "EAP-GPSK: Message too short for "
 		wpa_printf(MSG_DEBUG, "EAP-GPSK: Message too short for "
@@ -413,8 +414,8 @@ const u8 * eap_gpsk_validate_rand(struct eap_gpsk_data *data, const u8 *pos,
 }
 }
 
 
 
 
-const u8 * eap_gpsk_validate_id_server(struct eap_gpsk_data *data,
-				       const u8 *pos, const u8 *end)
+static const u8 * eap_gpsk_validate_id_server(struct eap_gpsk_data *data,
+					      const u8 *pos, const u8 *end)
 {
 {
 	size_t len;
 	size_t len;
 
 
@@ -453,8 +454,8 @@ const u8 * eap_gpsk_validate_id_server(struct eap_gpsk_data *data,
 }
 }
 
 
 
 
-const u8 * eap_gpsk_validate_csuite(struct eap_gpsk_data *data, const u8 *pos,
-				    const u8 *end)
+static const u8 * eap_gpsk_validate_csuite(struct eap_gpsk_data *data,
+					   const u8 *pos, const u8 *end)
 {
 {
 	int vendor, specifier;
 	int vendor, specifier;
 	const struct eap_gpsk_csuite *csuite;
 	const struct eap_gpsk_csuite *csuite;
@@ -482,8 +483,8 @@ const u8 * eap_gpsk_validate_csuite(struct eap_gpsk_data *data, const u8 *pos,
 }
 }
 
 
 
 
-const u8 * eap_gpsk_validate_pd_payload_2(struct eap_gpsk_data *data,
-					  const u8 *pos, const u8 *end)
+static const u8 * eap_gpsk_validate_pd_payload_2(struct eap_gpsk_data *data,
+						 const u8 *pos, const u8 *end)
 {
 {
 	u16 alen;
 	u16 alen;
 
 
@@ -509,9 +510,9 @@ const u8 * eap_gpsk_validate_pd_payload_2(struct eap_gpsk_data *data,
 }
 }
 
 
 
 
-const u8 * eap_gpsk_validate_gpsk_3_mic(struct eap_gpsk_data *data,
-					const u8 *payload,
-					const u8 *pos, const u8 *end)
+static const u8 * eap_gpsk_validate_gpsk_3_mic(struct eap_gpsk_data *data,
+					       const u8 *payload,
+					       const u8 *pos, const u8 *end)
 {
 {
 	size_t miclen;
 	size_t miclen;
 	u8 mic[EAP_GPSK_MAX_MIC_LEN];
 	u8 mic[EAP_GPSK_MAX_MIC_LEN];

+ 3 - 3
src/radius/radius_client.c

@@ -712,9 +712,9 @@ void radius_client_flush(struct radius_client_data *radius, int only_auth)
 }
 }
 
 
 
 
-void radius_client_update_acct_msgs(struct radius_client_data *radius,
-				    u8 *shared_secret,
-				    size_t shared_secret_len)
+static void radius_client_update_acct_msgs(struct radius_client_data *radius,
+					   u8 *shared_secret,
+					   size_t shared_secret_len)
 {
 {
 	struct radius_msg_list *entry;
 	struct radius_msg_list *entry;
 
 

+ 2 - 2
src/wps/wps_registrar.c

@@ -169,8 +169,8 @@ static void wps_registrar_remove_pbc_session(struct wps_registrar *reg,
 }
 }
 
 
 
 
-int wps_registrar_pbc_overlap(struct wps_registrar *reg,
-			      const u8 *addr, const u8 *uuid_e)
+static int wps_registrar_pbc_overlap(struct wps_registrar *reg,
+				     const u8 *addr, const u8 *uuid_e)
 {
 {
 	int count = 0;
 	int count = 0;
 	struct wps_pbc_session *pbc;
 	struct wps_pbc_session *pbc;

+ 0 - 2
wpa_supplicant/ctrl_iface.c

@@ -30,8 +30,6 @@
 #include "wps_supplicant.h"
 #include "wps_supplicant.h"
 #include "wps/wps.h"
 #include "wps/wps.h"
 
 
-extern struct wpa_driver_ops *wpa_supplicant_drivers[];
-
 static int wpa_supplicant_global_iface_list(struct wpa_global *global,
 static int wpa_supplicant_global_iface_list(struct wpa_global *global,
 					    char *buf, int len);
 					    char *buf, int len);
 static int wpa_supplicant_global_iface_interfaces(struct wpa_global *global,
 static int wpa_supplicant_global_iface_interfaces(struct wpa_global *global,

+ 0 - 13
wpa_supplicant/main.c

@@ -21,19 +21,6 @@
 #include "wpa_supplicant_i.h"
 #include "wpa_supplicant_i.h"
 
 
 
 
-extern const char *wpa_supplicant_version;
-extern const char *wpa_supplicant_license;
-#ifndef CONFIG_NO_STDOUT_DEBUG
-extern const char *wpa_supplicant_full_license1;
-extern const char *wpa_supplicant_full_license2;
-extern const char *wpa_supplicant_full_license3;
-extern const char *wpa_supplicant_full_license4;
-extern const char *wpa_supplicant_full_license5;
-#endif /* CONFIG_NO_STDOUT_DEBUG */
-
-extern struct wpa_driver_ops *wpa_supplicant_drivers[];
-
-
 static void usage(void)
 static void usage(void)
 {
 {
 	int i;
 	int i;

+ 0 - 2
wpa_supplicant/wpa_supplicant.c

@@ -108,8 +108,6 @@ const char *wpa_supplicant_full_license5 =
 "\n";
 "\n";
 #endif /* CONFIG_NO_STDOUT_DEBUG */
 #endif /* CONFIG_NO_STDOUT_DEBUG */
 
 
-extern struct wpa_driver_ops *wpa_supplicant_drivers[];
-
 extern int wpa_debug_level;
 extern int wpa_debug_level;
 extern int wpa_debug_show_keys;
 extern int wpa_debug_show_keys;
 extern int wpa_debug_timestamp;
 extern int wpa_debug_timestamp;

+ 13 - 0
wpa_supplicant/wpa_supplicant_i.h

@@ -17,6 +17,19 @@
 
 
 #include "drivers/driver.h"
 #include "drivers/driver.h"
 
 
+extern const char *wpa_supplicant_version;
+extern const char *wpa_supplicant_license;
+#ifndef CONFIG_NO_STDOUT_DEBUG
+extern const char *wpa_supplicant_full_license1;
+extern const char *wpa_supplicant_full_license2;
+extern const char *wpa_supplicant_full_license3;
+extern const char *wpa_supplicant_full_license4;
+extern const char *wpa_supplicant_full_license5;
+#endif /* CONFIG_NO_STDOUT_DEBUG */
+
+extern struct wpa_driver_ops *wpa_supplicant_drivers[];
+
+
 struct wpa_scan_result;
 struct wpa_scan_result;
 struct wpa_sm;
 struct wpa_sm;
 struct wpa_supplicant;
 struct wpa_supplicant;