-rw-r--r-- | noncore/net/networksetup/TODO | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/noncore/net/networksetup/TODO b/noncore/net/networksetup/TODO index 020339f..862d681 100644 --- a/noncore/net/networksetup/TODO +++ b/noncore/net/networksetup/TODO | |||
@@ -3,12 +3,70 @@ WEP key in file wireless.conf is not encrypted !, therefore it is very easy to g | |||
3 | 3 | ||
4 | udchcp needs to output the dhcp information so interfaces can read it | 4 | udchcp needs to output the dhcp information so interfaces can read it |
5 | 5 | ||
6 | interfacesetupimp really doesn't need a interface* pointer | 6 | interfacesetupimp really doesn't need a interface* pointer |
7 | 7 | ||
8 | Possible other modules to write: ppp, ipsec, bluetooth, ipchains | 8 | Possible other modules to write: ppp, ipsec, bluetooth, ipchains |
9 | 9 | ||
10 | PPP module needs to scan pppd.tdb to see what is currently active | 10 | PPP module needs to scan pppd.tdb to see what is currently active |
11 | 11 | ||
12 | WLAN - add possiblity to input text or hex without knowing "s:" | 12 | WLAN - add possiblity to input text or hex without knowing "s:" |
13 | 13 | ||
14 | Interface setupimp needs to use kernel calls. | 14 | Interface setupimp needs to use kernel calls. |
15 | |||
16 | Automaticly update the main list of interfaces: | ||
17 | > That would be me. :-D netlink, can you point me in the right | ||
18 | > direction where I can get more info on it? (I figured there was some | ||
19 | > kenel call) | ||
20 | |||
21 | You can look up the meaning of the packets you receive, or you can just go | ||
22 | poll for changes you might be interested in each time you receive _any_ | ||
23 | packet. Anything's better than periodic polling. | ||
24 | |||
25 | Note that you can't do this as non-root on some kernels. There's a patch | ||
26 | which can go into the hh.org kernel if it's not already there. | ||
27 | cf. http://marc.theaimsgroup.com/?l=linux-kernel&m=103520821605353&w=2 | ||
28 | |||
29 | |||
30 | #include <asm/types.h> | ||
31 | #include <sys/socket.h> | ||
32 | #include <linux/netlink.h> | ||
33 | #include <linux/rtnetlink.h> | ||
34 | |||
35 | int main(int argc, char **argv) | ||
36 | { | ||
37 | int fd; | ||
38 | unsigned char buf[4096]; | ||
39 | int ret; | ||
40 | int i, j; | ||
41 | struct sockaddr_nl snl; | ||
42 | |||
43 | fd = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE); | ||
44 | if (fd < 0) { | ||
45 | perror("socket"); | ||
46 | exit(1); | ||
47 | } | ||
48 | |||
49 | snl.nl_family = AF_NETLINK; | ||
50 | snl.nl_pad = 0; | ||
51 | snl.nl_pid = getpid(); | ||
52 | snl.nl_groups = RTM_NEWLINK|RTM_DELLINK; | ||
53 | |||
54 | if (bind(fd, &snl, sizeof(snl)) < 0) { | ||
55 | perror("bind"); | ||
56 | exit(1); | ||
57 | } | ||
58 | while (1) { | ||
59 | ret = recv(fd, buf, 4096, 0); | ||
60 | if (ret < 0) { | ||
61 | perror("recv"); | ||
62 | exit(1); | ||
63 | } | ||
64 | for (i=0; i<ret; i++) { | ||
65 | printf("%02x ", buf[i]); | ||
66 | } | ||
67 | printf("\n"); | ||
68 | } | ||
69 | |||
70 | } | ||
71 | -- | ||
72 | |||