3 files changed, 5 insertions, 1 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh index 7c6a21d..b85b7b7 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh +++ b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh | |||
@@ -1,35 +1,36 @@ | |||
1 | /* $Id$ */ | 1 | /* $Id$ */ |
2 | 2 | ||
3 | #ifndef CARDMODE_HH | 3 | #ifndef CARDMODE_HH |
4 | #define CARDMODE_HH | 4 | #define CARDMODE_HH |
5 | 5 | ||
6 | #include <string.h> | 6 | #include <string.h> |
7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
8 | #include <errno.h> | 8 | #include <errno.h> |
9 | #include <sys/types.h> | ||
10 | #include <sys/time.h> | ||
9 | #include <sys/socket.h> | 11 | #include <sys/socket.h> |
10 | #include <netinet/in.h> | 12 | #include <netinet/in.h> |
11 | #include <arpa/inet.h> | ||
12 | 13 | ||
13 | extern "C" | 14 | extern "C" |
14 | { | 15 | { |
15 | #include <net/bpf.h> | 16 | #include <net/bpf.h> |
16 | #include <pcap.h> | 17 | #include <pcap.h> |
17 | } | 18 | } |
18 | 19 | ||
19 | /* Defines, used for the card setup */ | 20 | /* Defines, used for the card setup */ |
20 | #define DEFAULT_PATH "/proc/driver/aironet/%s/Config" | 21 | #define DEFAULT_PATH "/proc/driver/aironet/%s/Config" |
21 | #define CARD_TYPE_CISCO1 | 22 | #define CARD_TYPE_CISCO1 |
22 | #define CARD_TYPE_NG 2 | 23 | #define CARD_TYPE_NG 2 |
23 | #define CARD_TYPE_HOSTAP3 | 24 | #define CARD_TYPE_HOSTAP3 |
24 | 25 | ||
25 | /* only for now, until we have the daemon running */ | 26 | /* only for now, until we have the daemon running */ |
26 | /*the config file should provide these information */ | 27 | /*the config file should provide these information */ |
27 | #define CARD_TYPE CARD_TYPE_HOSTAP | 28 | #define CARD_TYPE CARD_TYPE_HOSTAP |
28 | #define SBIN_PATH "/sbin/ifconfig %s promisc up" | 29 | #define SBIN_PATH "/sbin/ifconfig %s promisc up" |
29 | #define WLANCTL_PATH "/sbin/wlanctl-ng" | 30 | #define WLANCTL_PATH "/sbin/wlanctl-ng" |
30 | 31 | ||
31 | /* Prototypes */ | 32 | /* Prototypes */ |
32 | int card_into_monitormode (pcap_t **, char *, int); | 33 | int card_into_monitormode (pcap_t **, char *, int); |
33 | int card_set_promisc_up (const char *); | 34 | int card_set_promisc_up (const char *); |
34 | 35 | ||
35 | #endif /* CARDMODE_HH */ | 36 | #endif /* CARDMODE_HH */ |
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/proto.cc b/noncore/net/wellenreiter/libwellenreiter/source/proto.cc index 2ec23f4..a1228e4 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/proto.cc +++ b/noncore/net/wellenreiter/libwellenreiter/source/proto.cc | |||
@@ -1,40 +1,41 @@ | |||
1 | /* | 1 | /* |
2 | * Communication protocol | 2 | * Communication protocol |
3 | * | 3 | * |
4 | * $Id$ | 4 | * $Id$ |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include "proto.hh" | 7 | #include "proto.hh" |
8 | #include "sock.hh" | 8 | #include "sock.hh" |
9 | #include "log.hh" | ||
9 | 10 | ||
10 | /* Send found network to GUI */ | 11 | /* Send found network to GUI */ |
11 | int send_network_found (const char *guihost, int guiport, void *structure) | 12 | int send_network_found (const char *guihost, int guiport, void *structure) |
12 | { | 13 | { |
13 | wl_network_t *ptr; | 14 | wl_network_t *ptr; |
14 | char buffer[2048]; | 15 | char buffer[2048]; |
15 | char temp[5]; | 16 | char temp[5]; |
16 | 17 | ||
17 | ptr = (wl_network_t *)structure; | 18 | ptr = (wl_network_t *)structure; |
18 | 19 | ||
19 | memset(buffer, 0, 2048); | 20 | memset(buffer, 0, 2048); |
20 | 21 | ||
21 | /* Type = Found new net */ | 22 | /* Type = Found new net */ |
22 | memcpy(buffer, "01", 2); | 23 | memcpy(buffer, "01", 2); |
23 | 24 | ||
24 | /* Set Net-type */ | 25 | /* Set Net-type */ |
25 | memset(temp, 0, sizeof(temp)); | 26 | memset(temp, 0, sizeof(temp)); |
26 | snprintf(temp, 2, "%d", ptr->net_type); | 27 | snprintf(temp, 2, "%d", ptr->net_type); |
27 | memcpy(buffer + 2, temp, 1); | 28 | memcpy(buffer + 2, temp, 1); |
28 | 29 | ||
29 | /* Set channel */ | 30 | /* Set channel */ |
30 | memset(temp, 0, sizeof(temp)); | 31 | memset(temp, 0, sizeof(temp)); |
31 | 32 | ||
32 | if(ptr->channel < 10) | 33 | if(ptr->channel < 10) |
33 | snprintf(temp, 3, "0%d", ptr->channel); | 34 | snprintf(temp, 3, "0%d", ptr->channel); |
34 | else | 35 | else |
35 | snprintf(temp, 3, "%d", ptr->channel); | 36 | snprintf(temp, 3, "%d", ptr->channel); |
36 | 37 | ||
37 | memcpy(buffer + 3, temp, 2); | 38 | memcpy(buffer + 3, temp, 2); |
38 | 39 | ||
39 | /* Set WEP y/n */ | 40 | /* Set WEP y/n */ |
40 | memset(temp, 0, sizeof(temp)); | 41 | memset(temp, 0, sizeof(temp)); |
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/sniff.hh b/noncore/net/wellenreiter/libwellenreiter/source/sniff.hh index c13461a..c7108ac 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/sniff.hh +++ b/noncore/net/wellenreiter/libwellenreiter/source/sniff.hh | |||
@@ -1,41 +1,43 @@ | |||
1 | /* $Id$ */ | 1 | /* $Id$ */ |
2 | 2 | ||
3 | #ifndef SNIFF_HH | 3 | #ifndef SNIFF_HH |
4 | #define SNIFF_HH | 4 | #define SNIFF_HH |
5 | 5 | ||
6 | #include <string.h> | 6 | #include <string.h> |
7 | #include <stdio.h> | 7 | #include <stdio.h> |
8 | #include <stdlib.h> | 8 | #include <stdlib.h> |
9 | #include <errno.h> | 9 | #include <errno.h> |
10 | #include <sys/types.h> | ||
11 | #include <sys/time.h> | ||
10 | #include <sys/socket.h> | 12 | #include <sys/socket.h> |
11 | #include <netinet/in.h> | 13 | #include <netinet/in.h> |
12 | #include <arpa/inet.h> | 14 | #include <arpa/inet.h> |
13 | 15 | ||
14 | extern "C" | 16 | extern "C" |
15 | { | 17 | { |
16 | #include <net/bpf.h> | 18 | #include <net/bpf.h> |
17 | #include <pcap.h> | 19 | #include <pcap.h> |
18 | } | 20 | } |
19 | 21 | ||
20 | #define NONBROADCASTING "non-broadcasting" | 22 | #define NONBROADCASTING "non-broadcasting" |
21 | 23 | ||
22 | /* holds all the interresting data */ | 24 | /* holds all the interresting data */ |
23 | struct packetinfo | 25 | struct packetinfo |
24 | { | 26 | { |
25 | int isvalid; | 27 | int isvalid; |
26 | int pktlen; | 28 | int pktlen; |
27 | int fctype; | 29 | int fctype; |
28 | int fcsubtype; | 30 | int fcsubtype; |
29 | int fc_wep; | 31 | int fc_wep; |
30 | int cap_WEP; | 32 | int cap_WEP; |
31 | int cap_IBSS; | 33 | int cap_IBSS; |
32 | int cap_ESS; | 34 | int cap_ESS; |
33 | int channel; | 35 | int channel; |
34 | char bssid[sizeof("00:00:00:00:00:00") + 1]; | 36 | char bssid[sizeof("00:00:00:00:00:00") + 1]; |
35 | char desthwaddr[sizeof("00:00:00:00:00:00") + 1]; | 37 | char desthwaddr[sizeof("00:00:00:00:00:00") + 1]; |
36 | char sndhwaddr[sizeof("00:00:00:00:00:00") + 1]; | 38 | char sndhwaddr[sizeof("00:00:00:00:00:00") + 1]; |
37 | char ssid[128]; | 39 | char ssid[128]; |
38 | int ssid_len; | 40 | int ssid_len; |
39 | }; | 41 | }; |
40 | 42 | ||
41 | void process_packets(const struct pcap_pkthdr* pkthdr,const u_char* packet, char *, int); | 43 | void process_packets(const struct pcap_pkthdr* pkthdr,const u_char* packet, char *, int); |