author | benmeyer <benmeyer> | 2002-12-11 19:39:18 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-12-11 19:39:18 (UTC) |
commit | f55158aac4a23cbdca20145634886b2b757d4465 (patch) (side-by-side diff) | |
tree | a1cdcc5365f7ebdbeacc955c87b3a03be3e46f60 /noncore/net/networksetup/TODO | |
parent | b3373b77e12e4b138848110884aedc37b56384e1 (diff) | |
download | opie-f55158aac4a23cbdca20145634886b2b757d4465.zip opie-f55158aac4a23cbdca20145634886b2b757d4465.tar.gz opie-f55158aac4a23cbdca20145634886b2b757d4465.tar.bz2 |
Cleaned up ui files so tab is in correct order
Diffstat (limited to 'noncore/net/networksetup/TODO') (more/less context) (ignore whitespace changes)
-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 @@ -9,6 +9,64 @@ Possible other modules to write: ppp, ipsec, bluetooth, ipchains PPP module needs to scan pppd.tdb to see what is currently active WLAN - add possiblity to input text or hex without knowing "s:" Interface setupimp needs to use kernel calls. + +Automaticly update the main list of interfaces: +> That would be me. :-D netlink, can you point me in the right +> direction where I can get more info on it? (I figured there was some +> kenel call) + +You can look up the meaning of the packets you receive, or you can just go +poll for changes you might be interested in each time you receive _any_ +packet. Anything's better than periodic polling. + +Note that you can't do this as non-root on some kernels. There's a patch +which can go into the hh.org kernel if it's not already there. +cf. http://marc.theaimsgroup.com/?l=linux-kernel&m=103520821605353&w=2 + + +#include <asm/types.h> +#include <sys/socket.h> +#include <linux/netlink.h> +#include <linux/rtnetlink.h> + +int main(int argc, char **argv) +{ + int fd; + unsigned char buf[4096]; + int ret; + int i, j; + struct sockaddr_nl snl; + + fd = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE); + if (fd < 0) { + perror("socket"); + exit(1); + } + + snl.nl_family = AF_NETLINK; + snl.nl_pad = 0; + snl.nl_pid = getpid(); + snl.nl_groups = RTM_NEWLINK|RTM_DELLINK; + + if (bind(fd, &snl, sizeof(snl)) < 0) { + perror("bind"); + exit(1); + } + while (1) { + ret = recv(fd, buf, 4096, 0); + if (ret < 0) { + perror("recv"); + exit(1); + } + for (i=0; i<ret; i++) { + printf("%02x ", buf[i]); + } + printf("\n"); + } + +} +-- + |