| PLEX86 | ||
|
C program for getting IP address of standlone box with no sockets 7164What? If you're going to call ifconfig, why not just use popen()? PA: I was just not aware of this function. Thanks for pointing it out. Linux Security 7166 If you run redhat-fedora there is a program system-config-securitylevel you can use to configure a firewall rather easily. In the Gnome menus it's called security level or something... Unwilling to make system calls? Are you *sure* you know what you're doing? Maybe you should read the ifconfig source code as Peter T. Breuer suggested, so you can understand what it does. PA: I am sorry if I was unclear but I said I am *unwilling* and not *strictly averse* to make system calls. I do understand that the IP-address lookup has to come from the kernel (it JUST cannot BE in user space!!). If you meant "might not have a DNS name", then that's cool. PA: Thats what I meant. Sorry for being not precise! The solution that'd take the least amount of time for you is to popen() ifconfig and parse the data returned. (Remember, Laziness is one of the virtues.) PA: Laziness did help :-) Works like a charm .. ummm...but popen makes multiple system calls .. pipe and then fork (a third for invoking a shell with execve?) .. I was just trying to be efficient with least number of system calls! :-( Escaping backslash programming question You'll need to create a new file anyway. If all you want to do is delete... Thank you!
|
||||
Escaping backslash programming question Linux groups from Newsgroups The #1 Usenet Provider on the Internet
C program for getting IP address of standlone box with no sockets 7163 |
||||