summaryrefslogtreecommitdiffstats
path: root/src/iwkey.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/iwkey.c')
-rw-r--r--src/iwkey.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/iwkey.c b/src/iwkey.c
index 719c31a..bebe1bc 100644
--- a/src/iwkey.c
+++ b/src/iwkey.c
@@ -26,13 +26,15 @@
#include <libdaemon/dlog.h>
+#include "keyapi.h"
#include "iwkey.h"
#include "wireless.h"
#include "util.h"
+#include "interface.h"
static int n_used_keys = 0;
-int wep_key_add(struct interface *i, uint8_t w[WEP_KEY_LEN]) {
+static int wep_key_add(struct interface *i, const uint8_t w[WEP_KEY_LEN]) {
struct iwreq req;
assert(i);
@@ -44,7 +46,7 @@ int wep_key_add(struct interface *i, uint8_t w[WEP_KEY_LEN]) {
memset(&req, 0, sizeof(req));
strncpy(req.ifr_ifrn.ifrn_name, i->name, IFNAMSIZ);
- req.u.encoding.pointer = w;
+ req.u.encoding.pointer = (uint8_t*) w;
req.u.encoding.length = WEP_KEY_LEN;
req.u.encoding.flags = key_map[n_used_keys++]+1;
@@ -56,7 +58,7 @@ int wep_key_add(struct interface *i, uint8_t w[WEP_KEY_LEN]) {
return 0;
}
-int wep_key_finish(struct interface *i) {
+static int wep_key_finish(struct interface *i) {
struct iwreq req;
assert(i);
@@ -107,3 +109,11 @@ int wep_key_finish(struct interface *i) {
return 0;
}
+
+
+const struct key_api linux_key_api = {
+ open: (void*) interface_open,
+ close: (void*) interface_close,
+ add: (void*) wep_key_add,
+ finish: (void*) wep_key_finish
+};