Commit 728b8c9d authored by Bruno Randolf's avatar Bruno Randolf

Fix some sparse warnings

parent 0c387160
......@@ -358,12 +358,12 @@ bool channel_list_add(int freq)
return true;
}
int channel_get_num_channels()
int channel_get_num_channels(void)
{
return channels.num_channels;
}
int channel_get_num_bands()
int channel_get_num_bands(void)
{
return channels.num_bands;
}
......
......@@ -26,6 +26,7 @@
#include "util.h"
#include "wlan_util.h"
#include "control.h"
#include "conf_options.h"
struct conf_option {
int option;
......@@ -449,7 +450,7 @@ static char* config_get_getopt_string(char* buf, size_t maxlen, const char* add)
return buf;
}
void print_usage(const char* name)
static void print_usage(const char* name)
{
printf("\nUsage: %s [-v] [-h] [-q] [-D] [-a] [-c file] [-i interface] [-t sec] [-d ms] [-V view] [-b bytes]\n"
"\t\t[-s] [-u] [-N] [-n IP] [-p port] [-o file] [-X[name]] [-x command]\n"
......
......@@ -23,6 +23,6 @@
#include <stdbool.h>
void config_parse_file_and_cmdline(int argc, char** argv);
bool config_handle_option(char c, const char* name, const char* value);
bool config_handle_option(int c, const char* name, const char* value);
#endif
......@@ -41,30 +41,8 @@ static struct timespec last_time;
static int display_resize_needed = 0;
/* main windows are special */
void init_display_main(void);
void clear_display_main(void);
void update_main_win(struct packet_info *pkt);
void update_dump_win(struct packet_info* pkt);
bool main_input(int c);
void print_dump_win(const char *str, int refresh);
void resize_display_main(void);
static void resize_display_all(void);
/* smaller config windows */
void update_filter_win(WINDOW *win);
void update_channel_win(WINDOW *win);
bool filter_input(WINDOW *win, int c);
bool channel_input(WINDOW *win, int c);
/* "standard" windows */
void update_spectrum_win(WINDOW *win);
void update_statistics_win(WINDOW *win);
void update_essid_win(WINDOW *win);
void update_history_win(WINDOW *win);
void update_help_win(WINDOW *win);
bool spectrum_input(WINDOW *win, int c);
/******************* HELPERS *******************/
void get_per_second(unsigned long bytes, unsigned long duration,
......
......@@ -66,4 +66,27 @@ void init_display(void);
void finish_display(void);
void display_clear(void);
/* main windows are special */
void init_display_main(void);
void clear_display_main(void);
void update_main_win(struct packet_info *pkt);
void update_dump_win(struct packet_info* pkt);
bool main_input(int c);
void print_dump_win(const char *str, int refresh);
void resize_display_main(void);
/* smaller config windows */
void update_filter_win(WINDOW *win);
void update_channel_win(WINDOW *win);
bool filter_input(WINDOW *win, int c);
bool channel_input(WINDOW *win, int c);
/* "standard" windows */
void update_spectrum_win(WINDOW *win);
void update_statistics_win(WINDOW *win);
void update_essid_win(WINDOW *win);
void update_history_win(WINDOW *win);
void update_help_win(WINDOW *win);
bool spectrum_input(WINDOW *win, int c);
#endif
......@@ -17,6 +17,8 @@
#ifndef _IEEE80211_UTIL_H_
#define _IEEE80211_UTIL_H_
#include <stddef.h>
int ieee80211_frame_duration(int phymode, size_t len, int rate, int short_preamble,
int ackcts, int shortslot, char qos_class, int retries);
int ieee80211_freq2channel(int freq);
......
......@@ -20,12 +20,12 @@
#include "ifctrl.h"
#include "main.h"
bool ifctrl_init()
bool ifctrl_init(void)
{
return true;
};
void ifctrl_finish()
void ifctrl_finish(void)
{
};
......@@ -70,7 +70,7 @@ bool ifctrl_iwget_freqlist(__attribute__((unused)) int phy,
return false;
};
bool ifctrl_is_monitor()
bool ifctrl_is_monitor(void)
{
return true;
};
......@@ -44,7 +44,7 @@ static struct nl_sock *sock = NULL;
static struct nl_cache *cache = NULL;
static struct genl_family *family = NULL;
static bool nl80211_init()
static bool nl80211_init(void)
{
int err;
......@@ -80,7 +80,7 @@ out:
return false;
}
static void nl80211_finish()
static void nl80211_finish(void)
{
nl_socket_free(sock);
genl_family_put(family);
......@@ -228,12 +228,12 @@ static struct nlattr** nl80211_parse(struct nl_msg *msg)
* ifctrl interface
*/
bool ifctrl_init()
bool ifctrl_init(void)
{
return nl80211_init();
}
void ifctrl_finish()
void ifctrl_finish(void)
{
nl80211_finish();
}
......@@ -470,7 +470,7 @@ nla_put_failure:
return false;
}
bool ifctrl_is_monitor()
bool ifctrl_is_monitor(void)
{
return conf.if_type == NL80211_IFTYPE_MONITOR;
}
......@@ -29,7 +29,7 @@
extern int mon; /* monitoring socket */
bool wext_set_freq(int fd, const char* devname, int freq)
static bool wext_set_freq(int fd, const char* devname, int freq)
{
struct iwreq iwr;
......@@ -47,7 +47,7 @@ bool wext_set_freq(int fd, const char* devname, int freq)
return true;
}
int wext_get_freq(int fd, const char* devname)
static int wext_get_freq(int fd, const char* devname)
{
struct iwreq iwr;
......@@ -63,7 +63,7 @@ int wext_get_freq(int fd, const char* devname)
return iwr.u.freq.m;
}
int wext_get_channels(int fd, const char* devname,
static int wext_get_channels(int fd, const char* devname,
struct channel_list* channels)
{
struct iwreq iwr;
......@@ -117,12 +117,12 @@ int wext_get_channels(int fd, const char* devname,
* ifctrl.h implementation
*/
bool ifctrl_init()
bool ifctrl_init(void)
{
return true;
};
void ifctrl_finish()
void ifctrl_finish(void)
{
};
......@@ -171,7 +171,7 @@ bool ifctrl_iwget_freqlist(__attribute__((unused)) int phy, struct channel_list*
return false;
}
bool ifctrl_is_monitor()
bool ifctrl_is_monitor(void)
{
return true; /* assume yes */
}
......@@ -293,7 +293,7 @@ static bool filter_packet(struct packet_info* p)
return false;
}
void fixup_packet_channel(struct packet_info* p)
static void fixup_packet_channel(struct packet_info* p)
{
int i = -1;
......@@ -721,7 +721,7 @@ int main(int argc, char** argv)
exit(1);
clock_gettime(CLOCK_MONOTONIC, &the_time);
timeout_nodes();
node_timeout();
if (conf.serveraddr[0] == '\0') { /* server */
if (!conf.paused && channel_auto_change()) {
......@@ -745,7 +745,7 @@ void main_pause(int pause)
printlog(conf.paused ? "- PAUSED -" : "- RESUME -");
}
void main_reset()
void main_reset(void)
{
if (!conf.quiet && !conf.debug)
display_clear();
......
......@@ -162,7 +162,7 @@ struct node_info* node_update(struct packet_info* p)
return n;
}
void timeout_nodes(void)
void node_timeout(void)
{
struct node_info *n, *m, *n2, *m2;
struct chan_node *cn, *cn2;
......
......@@ -21,6 +21,6 @@
#define _NODE_H_
struct node_info* node_update(struct packet_info* p);
void timeout_nodes(void);
void node_timeout(void);
#endif
......@@ -20,6 +20,9 @@
#ifndef _PROTOCOL_PARSER_H_
#define _PROTOCOL_PARSER_H_
#include <stdbool.h>
#include <stddef.h>
struct packet_info;
bool parse_packet(unsigned char* buf, size_t len, struct packet_info* p);
......
......@@ -259,7 +259,7 @@ static int parse_radiotap_header(unsigned char* buf, size_t len, struct packet_i
}
}
void wlan_parse_information_elements(unsigned char* buf, size_t bufLen, struct packet_info *p)
static void wlan_parse_information_elements(unsigned char* buf, size_t bufLen, struct packet_info *p)
{
int len = bufLen;
while (len > 2) {
......
......@@ -21,6 +21,9 @@
#define _WLAN_UTIL_H_
#include <stdbool.h>
#include <stdint.h>
#include "wlan80211.h"
enum chan_width;
......@@ -35,7 +38,7 @@ struct pkt_name {
* Names and abbreviations for all WLAN frame types (2 bit, but only MGMT, CTRL
* and DATA defined) and subtypes (4 bit)
*/
struct pkt_name stype_names[WLAN_NUM_TYPES][WLAN_NUM_STYPES];
extern struct pkt_name stype_names[WLAN_NUM_TYPES][WLAN_NUM_STYPES];
struct pkt_name get_packet_struct(uint16_t type);
char get_packet_type_char(uint16_t type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment