summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/libwellenreiter/docs/quickintro15
1 files changed, 12 insertions, 3 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/docs/quickintro b/noncore/net/wellenreiter/libwellenreiter/docs/quickintro
index a027a4e..97458b7 100644
--- a/noncore/net/wellenreiter/libwellenreiter/docs/quickintro
+++ b/noncore/net/wellenreiter/libwellenreiter/docs/quickintro
@@ -1,79 +1,88 @@
1 1
2Name: libwellenreiter 2Name: libwellenreiter
3Author: Martin J. Muench 3Author: Martin J. Muench
4 4
5NOTE: This is just a very short summary of the functions included 5NOTE: This is just a very short summary of the functions included
6in libwellenreiter, written because a lack of time. The whole 6in libwellenreiter, written because a lack of time. The whole
7library will be rewritten with extended documentation and 7library will be rewritten with extended documentation and
8test programs. 8test programs.
9 9
10-- 10--
11Wellenreiter types: 11Wellenreiter types:
12In proto.hh the following type (wl_network_t) is declared: 12In proto.hh the following type (wl_network_t) is declared:
13 13
14typedef struct { 14typedef struct {
15 int net_type; /* 1 = Accesspoint ; 2 = Ad-Hoc */ 15 int net_type; /* 1 = Accesspoint ; 2 = Ad-Hoc */
16 int ssid_len; /* Length of SSID */ 16 int ssid_len; /* Length of SSID */
17 int channel; /* Channel */ 17 int channel; /* Channel */
18 int wep; /* 1 = WEP enabled ; 0 = disabled */ 18 int wep; /* 1 = WEP enabled ; 0 = disabled */
19 char mac[64]; /* MAC address of Accesspoint */ 19 char mac[64]; /* MAC address of Accesspoint */
20 char bssid[128]; /* BSSID of Accesspoint */ 20 char bssid[128]; /* BSSID of Accesspoint */
21} wl_network_t; 21} wl_network_t;
22 22
23When a network is found, the structure has to be set and 23When a network is found, the structure has to be set and
24sent to the send_network_found() function. 24sent to the send_network_found() function.
25 25
26When the GUI receives a found network string it calls the 26When the GUI receives a found network string it calls the
27get_network_found() function to get its own structure set. 27get_network_found() function to get its own structure set.
28 28
29-- 29--
30Included functions: 30Included functions:
31 31
32-- 32--
33Protocol: 33Protocol:
34 34
35Send a found network to GUI: 35Send a found network to GUI:
36int send_network_found (const char *, int, void *); 36int send_network_found (const char *, int, void *);
37 37
38The first two arguments are the guihost and the guiport. 38The first two arguments are the guihost and the guiport.
39The third is the filled structure (wl_network_t), that will 39The third is the filled structure (wl_network_t), that will
40be send to the GUI. 40be send to the GUI.
41 41
42Setup structure for found network: 42Setup structure for found network:
43int get_network_found (void *, const char *); 43int get_network_found (void *, const char *);
44 44
45When the GUI receives a new network found packet it calls 45When the GUI receives a new network found packet it calls
46this function and passes a wl_network_t structure and the 46this function and passes a wl_network_t structure and the
47received buffer. The function will strip the data from 47received buffer. The function will strip the data from
48the buffer and set it to the structure. 48the buffer and set it to the structure.
49 49
50-- 50--
51Log to syslog/info: 51Log to syslog/info:
52void wl_loginfo(const char *, ...); 52void wl_loginfo(const char *, ...);
53 53
54Log to syslog/err: 54Log to syslog/err:
55void wl_logerr(const char *, ...); 55void wl_logerr(const char *, ...);
56 56
57Use like printf() function with format strings and so on. 57Use like printf() function with format strings and so on.
58 58
59-- 59--
60Setup udp socket for incoming commands: 60Setup udp socket for incoming commands:
61int commsock(const char *, int); 61int commsock(const char *, int);
62 62
63Fist argument is the host where it should listen and second 63Fist argument is the host where it should listen and second
64is the port. 64is the port. Socket is returned, on failure -1 is returned.
65 65
66Return values: 66
67Recvfrom socket:
68int recv_commsock(int *, char *, int);
69
70First argument is the address of the socket, second is a buffer
71that should be filled in and the third is the maxlength of the
72buffer. On error, -1 is returned, on success the number of
73packet type is returned. (return value should be used with switch
74command, for types see proto.hh)
67 75
68Send command to udp socket: 76Send command to udp socket:
69int sendcomm(const char *, int, const char *, ...); 77int sendcomm(const char *, int, const char *, ...);
70 78
71First two arguments are the host and port where the command should 79First two arguments are the host and port where the command should
72be send to, followed by buffer that should be send. 80be send to, followed by buffer that should be send. On error, -1
81is returned.
73 82
74 83
75--- 84---
76 85
77Thats it for the moment. 86Thats it for the moment.
78 87
79mjm. 88mjm.