Reporting IP adress
With some assistance, I wrote this code in C to perform the functions of the last command. It displays some of the fields from the wtmp file. Instead of reporting the hostname, I'd like to report the IP address. From the man pages, it looks as though the host command will find IP addresses. But, do I need to use pipes to perform this action? Maybe something like read_fp = popen("host", "r"). Of course, the IP address field may be empty and in this case I can report something such as "empty" and perform no DNS lookup.
Code:
#include <utmp.h> |
How about using the IP address in the utmp struct.
Code:
struct utmp { |
All times are GMT -5. The time now is 08:51 AM. |