Diffstat (limited to 'noncore/net/wellenreiter/libwellenreiter/source/proto.cc') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/libwellenreiter/source/proto.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/proto.cc b/noncore/net/wellenreiter/libwellenreiter/source/proto.cc index 305f401..2ec23f4 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/proto.cc +++ b/noncore/net/wellenreiter/libwellenreiter/source/proto.cc | |||
@@ -35,57 +35,56 @@ int send_network_found (const char *guihost, int guiport, void *structure) | |||
35 | snprintf(temp, 3, "%d", ptr->channel); | 35 | snprintf(temp, 3, "%d", ptr->channel); |
36 | 36 | ||
37 | memcpy(buffer + 3, temp, 2); | 37 | memcpy(buffer + 3, temp, 2); |
38 | 38 | ||
39 | /* Set WEP y/n */ | 39 | /* Set WEP y/n */ |
40 | memset(temp, 0, sizeof(temp)); | 40 | memset(temp, 0, sizeof(temp)); |
41 | snprintf(temp, 2, "%d", ptr->wep); | 41 | snprintf(temp, 2, "%d", ptr->wep); |
42 | memcpy(buffer + 5, temp, 1); | 42 | memcpy(buffer + 5, temp, 1); |
43 | 43 | ||
44 | /* Set MAC address */ | 44 | /* Set MAC address */ |
45 | memcpy(buffer + 6, ptr->mac, 17); | 45 | memcpy(buffer + 6, ptr->mac, 17); |
46 | 46 | ||
47 | /* Set lenght of ssid */ | 47 | /* Set lenght of ssid */ |
48 | memset(temp, 0, sizeof(temp)); | 48 | memset(temp, 0, sizeof(temp)); |
49 | 49 | ||
50 | if(ptr->ssid_len > 99) | 50 | if(ptr->ssid_len > 99) |
51 | snprintf(temp, 4, "%d", ptr->ssid_len); | 51 | snprintf(temp, 4, "%d", ptr->ssid_len); |
52 | else if(ptr->ssid_len < 10) | 52 | else if(ptr->ssid_len < 10) |
53 | snprintf(temp, 4, "00%d", ptr->ssid_len); | 53 | snprintf(temp, 4, "00%d", ptr->ssid_len); |
54 | else | 54 | else |
55 | snprintf(temp, 4, "0%d", ptr->ssid_len); | 55 | snprintf(temp, 4, "0%d", ptr->ssid_len); |
56 | 56 | ||
57 | memcpy(buffer + 23, temp, 3); | 57 | memcpy(buffer + 23, temp, 3); |
58 | 58 | ||
59 | fprintf( stderr, "Temp is %s\n", temp ); | ||
60 | fprintf( stderr, "ssid_len is %d\n", ptr->ssid_len ); | ||
61 | |||
62 | /* Set ssid */ | 59 | /* Set ssid */ |
63 | memcpy(buffer + 26, ptr->bssid, ptr->ssid_len); | 60 | memcpy(buffer + 26, ptr->bssid, ptr->ssid_len); |
64 | 61 | ||
65 | fprintf( stderr, "Buffer is %s\n", buffer ); | ||
66 | |||
67 | /* Send prepared buffer to GUI */ | 62 | /* Send prepared buffer to GUI */ |
63 | #ifdef DEBUG | ||
64 | wl_loginfo("Sending network to GUI: '%s'", buffer); | ||
65 | #endif | ||
66 | |||
68 | sendcomm(guihost, guiport, buffer); | 67 | sendcomm(guihost, guiport, buffer); |
69 | 68 | ||
70 | return 1; | 69 | return 1; |
71 | } | 70 | } |
72 | 71 | ||
73 | /* Fill buffer into structur */ | 72 | /* Fill buffer into structur */ |
74 | int get_network_found (void *structure, const char *buffer) | 73 | int get_network_found (void *structure, const char *buffer) |
75 | { | 74 | { |
76 | wl_network_t *ptr; | 75 | wl_network_t *ptr; |
77 | char temp[512]; | 76 | char temp[512]; |
78 | 77 | ||
79 | ptr = (wl_network_t *)structure; | 78 | ptr = (wl_network_t *)structure; |
80 | 79 | ||
81 | /* Get net type */ | 80 | /* Get net type */ |
82 | memset(temp, 0, sizeof(temp)); | 81 | memset(temp, 0, sizeof(temp)); |
83 | memcpy(temp, buffer + 2, 1); | 82 | memcpy(temp, buffer + 2, 1); |
84 | ptr->net_type = atoi(temp); | 83 | ptr->net_type = atoi(temp); |
85 | 84 | ||
86 | /* Get channel */ | 85 | /* Get channel */ |
87 | memset(temp, 0, sizeof(temp)); | 86 | memset(temp, 0, sizeof(temp)); |
88 | memcpy(temp, buffer + 3, 2); | 87 | memcpy(temp, buffer + 3, 2); |
89 | ptr->channel = atoi(temp); | 88 | ptr->channel = atoi(temp); |
90 | 89 | ||
91 | /* Set WEP y/n */ | 90 | /* Set WEP y/n */ |