2014-09-22 06:56:49 +02:00
|
|
|
#include <errno.h>
|
|
|
|
|
2015-05-04 19:07:39 +02:00
|
|
|
#ifdef __FreeBSD__
|
|
|
|
#include "sys/endian.h"
|
|
|
|
#else
|
|
|
|
#include <endian.h>
|
|
|
|
#endif
|
2014-11-08 08:51:44 +01:00
|
|
|
|
2014-09-22 06:56:49 +02:00
|
|
|
|
|
|
|
|
2015-04-26 12:36:53 +02:00
|
|
|
//#include "wtpdrv.h"
|
|
|
|
//#include "nlt.h"
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
2016-03-03 19:51:42 +01:00
|
|
|
#include "cw/log.h"
|
|
|
|
#include "cw/radioinfo.h"
|
|
|
|
#include "cw/sock.h"
|
2016-03-08 20:06:42 +01:00
|
|
|
//#include "cw/capwap_80211.h"
|
2016-03-03 19:51:42 +01:00
|
|
|
#include "cw/dbg.h"
|
2014-09-22 06:56:49 +02:00
|
|
|
|
2015-04-26 12:36:53 +02:00
|
|
|
/*
|
2014-10-19 12:14:44 +02:00
|
|
|
int wpa_printf()
|
2014-09-14 16:25:23 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-10-19 12:14:44 +02:00
|
|
|
int wpa_hexdump()
|
2014-09-14 16:25:23 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-22 06:56:49 +02:00
|
|
|
#include <linux/types.h>
|
2014-09-14 16:25:23 +02:00
|
|
|
|
|
|
|
#include "netlink/netlink.h"
|
|
|
|
#include "netlink/genl/genl.h"
|
|
|
|
#include "netlink/genl/ctrl.h"
|
|
|
|
#include <netlink/msg.h>
|
|
|
|
#include <net/if.h>
|
|
|
|
|
|
|
|
#include "nl80211.h"
|
2015-04-26 12:36:53 +02:00
|
|
|
*/
|
2014-09-14 16:25:23 +02:00
|
|
|
|
2014-09-22 06:56:49 +02:00
|
|
|
/*
|
|
|
|
typedef uint16_t u16;
|
|
|
|
typedef uint32_t u32;
|
|
|
|
typedef uint8_t u8;
|
|
|
|
typedef int bool;
|
|
|
|
typedef signed char s8;
|
|
|
|
#define false 0
|
|
|
|
#define true (!0)
|
|
|
|
#define __packed __attribute__ ((packed))
|
|
|
|
|
|
|
|
typedef __le16 le16
|
|
|
|
*/
|
|
|
|
|
2015-04-26 12:36:53 +02:00
|
|
|
/*
|
2014-09-22 06:56:49 +02:00
|
|
|
#include <sys/ioctl.h>
|
2014-11-02 07:34:17 +01:00
|
|
|
#include <net/if_arp.h>
|
|
|
|
|
2014-09-22 06:56:49 +02:00
|
|
|
|
|
|
|
#include "dot11.h"
|
|
|
|
//#include "ieee802_11_defs.h"
|
|
|
|
|
|
|
|
|
|
|
|
struct radioinfo radioinfos[31];
|
|
|
|
static struct nl_sock * sk;
|
|
|
|
|
2014-10-19 12:14:44 +02:00
|
|
|
|
2014-11-10 00:16:55 +01:00
|
|
|
static struct apdata rd;
|
2014-10-19 12:14:44 +02:00
|
|
|
|
|
|
|
|
2014-11-02 07:34:17 +01:00
|
|
|
struct wiphydata {
|
2014-11-02 14:28:38 +01:00
|
|
|
const char * name;
|
2014-11-02 07:34:17 +01:00
|
|
|
|
|
|
|
};
|
2015-04-26 12:36:53 +02:00
|
|
|
*/
|
2014-11-02 07:34:17 +01:00
|
|
|
|
|
|
|
|
2015-04-26 12:36:53 +02:00
|
|
|
/*
|
2014-11-02 07:34:17 +01:00
|
|
|
static struct wiphydata * wiphydata[31];
|
|
|
|
|
2014-12-16 09:04:59 +01:00
|
|
|
static int ack_handler(struct nl_msg *msg, void *arg)
|
|
|
|
{
|
|
|
|
printf ("Ack handler ------lllllllllllllllllllllllllllllllllllllllllllllllllllllll\n");
|
|
|
|
int *err = arg;
|
|
|
|
*err = 0;
|
|
|
|
return NL_STOP;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int finish_handler(struct nl_msg *msg, void *arg)
|
|
|
|
{
|
|
|
|
printf ("Finish handler ------lllllllllllllllllllllllllllllllllllllllllllllllllllllll\n");
|
|
|
|
int *ret = arg;
|
|
|
|
*ret = 0;
|
|
|
|
return NL_SKIP;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int error_handler(struct sockaddr_nl *nla, struct nlmsgerr *err,
|
|
|
|
void *arg)
|
|
|
|
{
|
|
|
|
|
|
|
|
printf ("Error handler ------lllllllllllllllllllllllllllllllllllllllllllllllllllllll\n");
|
|
|
|
int *ret = arg;
|
|
|
|
*ret = err->error;
|
|
|
|
printf("Err: %d\n",*ret);
|
|
|
|
return NL_SKIP;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-03-14 10:15:12 +01:00
|
|
|
*/
|
2014-07-11 22:12:11 +02:00
|
|
|
|