Commit a7af96cd authored by Bruno Randolf's avatar Bruno Randolf

fix some sparse warnings

parent ba1207f1
......@@ -176,7 +176,7 @@ device_get_arptype(void)
}
void
static void
set_receive_buffer(int fd, int sockbufsize)
{
int ret;
......@@ -206,6 +206,7 @@ open_packet_socket(char* devname, size_t bufsize, int recv_buffer_size)
{
int ret;
int ifindex;
struct sockaddr_ll sall;
mon_ifname = devname;
......@@ -216,7 +217,6 @@ open_packet_socket(char* devname, size_t bufsize, int recv_buffer_size)
/* bind only to one interface */
ifindex = device_index(mon_fd, devname);
struct sockaddr_ll sall;
sall.sll_ifindex = ifindex;
sall.sll_family = AF_PACKET;
sall.sll_protocol = htons(ETH_P_ALL);
......
......@@ -205,7 +205,7 @@ finish_display(int sig)
#define MAC_COL 30
void
static void
filter_input(int c)
{
char buf[18];
......@@ -360,7 +360,7 @@ compare_nodes_bssid(const struct list_head *p1, const struct list_head *p2)
}
void
static void
sort_input(int c)
{
switch(c) {
......@@ -391,7 +391,7 @@ sort_input(int c)
void
handle_user_input()
handle_user_input(void)
{
int key;
......@@ -497,7 +497,7 @@ show_sort_win(void)
#define CHECK_ETHER(_mac) MAC_NOT_EMPTY(_mac) ? '*' : ' '
static void
update_filter_win()
update_filter_win(void)
{
int l, i;
......@@ -630,7 +630,7 @@ update_display(struct packet_info* pkt, struct node_info* node)
static void
update_show_win()
update_show_win(void)
{
if (show_win_current == 'e')
update_essid_win();
......@@ -982,7 +982,7 @@ update_hist_win(void)
}
void
static void
update_dump_win(struct packet_info* pkt)
{
if (!pkt) {
......
......@@ -18,13 +18,14 @@
#include "ieee80211.h"
#include "ieee80211_radiotap.h"
#include "ieee80211_util.h"
#include "main.h"
#include "util.h"
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
u8*
ieee80211_get_bssid(struct ieee80211_hdr *hdr, int len)
ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len)
{
__le16 fc;
......@@ -99,7 +100,7 @@ ieee80211_get_hdrlen(u16 fc)
/* from mac80211/ieee80211_sta.c, modified */
void
ieee802_11_parse_elems(unsigned char *start, int len, struct packet_info *pkt)
ieee802_11_parse_elems(unsigned char *start, size_t len, struct packet_info *pkt)
{
int left = len;
unsigned char *pos = start;
......
......@@ -25,7 +25,7 @@ u8*
ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len);
void
ieee802_11_parse_elems(unsigned char *start, int len, struct packet_info *pkt);
ieee802_11_parse_elems(unsigned char *start, size_t len, struct packet_info *pkt);
int
ieee80211_frame_duration(int phymode, size_t len,
......
#include "list.h"
#include "listsort.h"
/*
* sorting a linked list.
......
......@@ -43,7 +43,7 @@ static int filter_packet(struct packet_info* pkt);
static void update_history(struct packet_info* pkt);
static void update_statistics(struct packet_info* pkt);
static void write_to_file(struct packet_info* pkt);
static inline void timeout_nodes(void);
static void timeout_nodes(void);
struct packet_info current_packet;
......@@ -163,7 +163,7 @@ main(int argc, char** argv)
}
void
static void
get_options(int argc, char** argv)
{
int c;
......@@ -548,7 +548,7 @@ write_to_file(struct packet_info* pkt)
}
static inline void
static void
timeout_nodes(void)
{
struct node_info *n, *m;
......
......@@ -228,7 +228,7 @@ struct config {
unsigned char filtermac[MAX_FILTERMAC][MAC_LEN];
unsigned char filterbssid[MAC_LEN];
int filter_pkt;
int filter_off:1,
unsigned int filter_off:1,
do_macfilter:1;
/* this isn't exactly config, but wtf... */
......
......@@ -38,7 +38,7 @@
static int parse_prism_header(unsigned char** buf, int len);
static int parse_radiotap_header(unsigned char** buf, int len);
static int parse_80211_header(unsigned char** buf, int len);
static int inline parse_llc(unsigned char** buf, int len);
static int parse_llc(unsigned char** buf, int len);
static int parse_ip_header(unsigned char** buf, int len);
static int parse_udp_header(unsigned char** buf, int len);
static int parse_olsr_packet(unsigned char** buf, int len);
......@@ -472,7 +472,7 @@ parse_80211_header(unsigned char** buf, int len)
}
static inline int
static int
parse_llc(unsigned char ** buf, int len)
{
DEBUG("* parse LLC\n");
......@@ -560,8 +560,7 @@ static int
parse_olsr_packet(unsigned char** buf, int len)
{
struct olsr* oh;
int number;
int i;
int number, i, msgtype;
if (len < sizeof(struct olsr))
return -1;
......@@ -569,7 +568,7 @@ parse_olsr_packet(unsigned char** buf, int len)
oh = (struct olsr*)*buf;
// TODO: more than one olsr messages can be in one packet
int msgtype = oh->olsr_msg[0].olsr_msgtype;
msgtype = oh->olsr_msg[0].olsr_msgtype;
DEBUG("OLSR msgtype: %d\n*** ", msgtype);
......
......@@ -30,7 +30,7 @@ struct pkt_names {
};
/* a list of packet type names for easier indexing with padding */
struct pkt_names mgmt_names[] = {
static struct pkt_names mgmt_names[] = {
{ 'a', "ASOCRQ" }, /* IEEE80211_STYPE_ASSOC_REQ 0x0000 */
{ 'A', "ASOCRP" }, /* IEEE80211_STYPE_ASSOC_RESP 0x0010 */
{ 'a', "REASRQ" }, /* IEEE80211_STYPE_REASSOC_REQ 0x0020 */
......@@ -46,7 +46,7 @@ struct pkt_names mgmt_names[] = {
{ 'T', "ACTION" }, /* IEEE80211_STYPE_ACTION 0x00D0 */
};
struct pkt_names ctrl_names[] = {
static struct pkt_names ctrl_names[] = {
{ 's', "PSPOLL" }, /* IEEE80211_STYPE_PSPOLL 0x00A0 */
{ 'R', "RTS" }, /* IEEE80211_STYPE_RTS 0x00B0 */
{ 'C', "CTS" }, /* IEEE80211_STYPE_CTS 0x00C0 */
......@@ -55,7 +55,7 @@ struct pkt_names ctrl_names[] = {
{ 'f', "CFENDK" }, /* IEEE80211_STYPE_CFENDACK 0x00F0 */
};
struct pkt_names data_names[] = {
static struct pkt_names data_names[] = {
{ 'D', "DATA" }, /* IEEE80211_STYPE_DATA 0x0000 */
{ 'F', "DCFACK" }, /* IEEE80211_STYPE_DATA_CFACK 0x0010 */
{ 'F', "DCFPLL" }, /* IEEE80211_STYPE_DATA_CFPOLL 0x0020 */
......@@ -79,7 +79,7 @@ struct pkt_names data_names[] = {
#define CTRL_NAME_INDEX(_i) ((((_i) & IEEE80211_FCTL_STYPE)>>4)-10)
inline int
int
normalize(float oval, int max_val, int max) {
int val;
val= (oval / max_val) * max;
......
......@@ -40,7 +40,7 @@ ip_sprintf(const unsigned int ip);
void
convert_string_to_mac(const char* string, unsigned char* mac);
inline int
int
normalize(float val, int max_val, int max);
#define normalize_db(_val, _max) \
......
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