author | mjm <mjm> | 2002-12-28 15:28:49 (UTC) |
---|---|---|
committer | mjm <mjm> | 2002-12-28 15:28:49 (UTC) |
commit | 94ac3da47b0b36316cff680d319dab23c9339308 (patch) (unidiff) | |
tree | 5161a4da84fb05c53fd5225be5674ab75087ff3f | |
parent | 0ab4ac99bead80d8af18988045748fd2b3dd3a15 (diff) | |
download | opie-94ac3da47b0b36316cff680d319dab23c9339308.zip opie-94ac3da47b0b36316cff680d319dab23c9339308.tar.gz opie-94ac3da47b0b36316cff680d319dab23c9339308.tar.bz2 |
cleanup
3 files changed, 20 insertions, 28 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc b/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc index 5317f52..ae6d406 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc +++ b/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc | |||
@@ -45,7 +45,4 @@ int send_network_found (const char *guihost, int guiport, void *structure) | |||
45 | wl_network_t *ptr; | 45 | wl_network_t *ptr; |
46 | char buffer[2048]; | 46 | char buffer[2048], temp[5]; |
47 | char temp[128]; | 47 | int len = 0; |
48 | int retval=0, len=0; | ||
49 | |||
50 | memset(temp, 0, sizeof(temp)); | ||
51 | 48 | ||
@@ -62,4 +59,3 @@ int send_network_found (const char *guihost, int guiport, void *structure) | |||
62 | snprintf(temp, sizeof(temp), "%d", ptr->net_type); | 59 | snprintf(temp, sizeof(temp), "%d", ptr->net_type); |
63 | retval = add_field(buffer + len, temp, 1); | 60 | len += add_field(buffer + len, temp, 1); |
64 | len += retval; | ||
65 | 61 | ||
@@ -68,4 +64,3 @@ int send_network_found (const char *guihost, int guiport, void *structure) | |||
68 | snprintf(temp, sizeof(temp), "%.2d", ptr->channel); | 64 | snprintf(temp, sizeof(temp), "%.2d", ptr->channel); |
69 | retval = add_field(buffer + len, temp, 2); | 65 | len += add_field(buffer + len, temp, 2); |
70 | len += retval; | ||
71 | 66 | ||
@@ -74,11 +69,12 @@ int send_network_found (const char *guihost, int guiport, void *structure) | |||
74 | snprintf(temp, sizeof(temp), "%d", ptr->wep); | 69 | snprintf(temp, sizeof(temp), "%d", ptr->wep); |
75 | retval = add_field(buffer + len, temp, 1); | 70 | len += add_field(buffer + len, temp, 1); |
76 | len += retval; | ||
77 | 71 | ||
78 | /* Set Mac */ | 72 | /* Set Mac */ |
79 | retval = add_field(buffer + len, ptr->mac, 17); | 73 | len += add_field(buffer + len, ptr->mac, 17); |
80 | len += retval; | ||
81 | 74 | ||
82 | /* Set ssid */ | 75 | /* Set ssid */ |
83 | retval = add_field(buffer + len, ptr->bssid, ptr->ssid_len); | 76 | if(len + ptr->ssid_len < sizeof(buffer) - 1) |
77 | len += add_field(buffer + len, ptr->bssid, ptr->ssid_len); | ||
78 | else | ||
79 | len += add_field(buffer + len, ptr->bssid, sizeof(buffer) - len - 1); | ||
84 | 80 | ||
@@ -96,4 +92,4 @@ int get_network_found (void *structure, const char *buffer) | |||
96 | wl_network_t *ptr; | 92 | wl_network_t *ptr; |
97 | char temp[512]; | 93 | char temp[5]; |
98 | int retval=0, len=0; | 94 | int len = 0; |
99 | 95 | ||
@@ -101,9 +97,8 @@ int get_network_found (void *structure, const char *buffer) | |||
101 | 97 | ||
102 | /* packet type already determined */ | 98 | /* packet type already determined, skip check */ |
103 | len += 2; | 99 | len += 2; |
104 | 100 | ||
105 | /* Get net type */ | 101 | /* Get net type (accesspoint || ad-hoc || ...) */ |
106 | memset(temp, 0, sizeof(temp)); | 102 | memset(temp, 0, sizeof(temp)); |
107 | retval = get_field(buffer + len, temp); | 103 | len += get_field(buffer + len, temp); |
108 | len += retval; | ||
109 | ptr->net_type = atoi(temp); | 104 | ptr->net_type = atoi(temp); |
@@ -112,4 +107,3 @@ int get_network_found (void *structure, const char *buffer) | |||
112 | memset(temp, 0, sizeof(temp)); | 107 | memset(temp, 0, sizeof(temp)); |
113 | retval = get_field(buffer + len, temp); | 108 | len += get_field(buffer + len, temp); |
114 | len += retval; | ||
115 | ptr->channel = atoi(temp); | 109 | ptr->channel = atoi(temp); |
@@ -118,4 +112,3 @@ int get_network_found (void *structure, const char *buffer) | |||
118 | memset(temp, 0, sizeof(temp)); | 112 | memset(temp, 0, sizeof(temp)); |
119 | retval = get_field(buffer + len, temp); | 113 | len += get_field(buffer + len, temp); |
120 | len += retval; | ||
121 | ptr->wep = atoi(temp); | 114 | ptr->wep = atoi(temp); |
@@ -123,7 +116,6 @@ int get_network_found (void *structure, const char *buffer) | |||
123 | /* Set MAC address */ | 116 | /* Set MAC address */ |
124 | retval = get_field(buffer + len, ptr->mac); | 117 | len += get_field(buffer + len, ptr->mac); |
125 | len += retval; | ||
126 | 118 | ||
127 | /* Set BSSID */ | 119 | /* Set BSSID */ |
128 | retval = get_field(buffer + len, ptr->bssid); | 120 | len += get_field(buffer + len, ptr->bssid); |
129 | 121 | ||
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.hh b/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.hh index f755589..a196091 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.hh +++ b/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.hh | |||
@@ -24,3 +24,3 @@ typedef struct { | |||
24 | char mac[64]; /* MAC address of Accesspoint */ | 24 | char mac[64]; /* MAC address of Accesspoint */ |
25 | char bssid[128]; /* BSSID of Accesspoint */ | 25 | char bssid[128]; /* BSSID of Net */ |
26 | } wl_network_t; | 26 | } wl_network_t; |
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/wl_sock.cc b/noncore/net/wellenreiter/libwellenreiter/source/wl_sock.cc index 4942fba..db6b7b8 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/wl_sock.cc +++ b/noncore/net/wellenreiter/libwellenreiter/source/wl_sock.cc | |||