LCDproc development and user support list

Text archives Help


[lcdproc] New client


Chronological Thread 
  • From: jdw AT freeamp.org (Jason Dale Woodward)
  • Subject: [lcdproc] New client
  • Date: Fri, 12 Feb 1999 23:22:09 -0800

IP addresses are 32 bit numbers. ut_addr is a int32_t (according to my
man page). It is likely that:

char foo[16];
struct utmp *pUtmp = getutent();
sprintf(foo,"%d.%d.%d.%d",(unsigned char)(pUtmp->ut_addr >> 24),
(unsigned char)(pUtmp->ut_addr >> 16),
(unsigned char)(pUtmp->ut_addr >> 8),
(unsigned char)(pUtmp->ut_addr));

will be happy.

jason

dosowski0474 AT vax2.winona.msus.edu
wrote:
>
> I'm working on a "who" type client. On each line, it displays a
> username, where logged in from, and the tty where the user is logged in.
> I'd like to have the option to use either hostname or IP address, but I'm
> not quite sure on how exactly getutent() formats it. The struct it
> returns contains a long value ut_addr, which is supposed to be the IP
> address, but I don't know how to get the 123.123.123.123 out of that.
> Any suggestions?
>
> --
> Dale Osowski
> dosowski0474 AT vax2.winona.msus.edu
> http://www3.winona.msus.edu/dosowski0474
>
> -----------------------------------------------------------
> To unsubscribe from this list send a blank message to
> lcdproc-unsubscribe AT lists.omnipotent.net


-----------------------------------------------------------
To unsubscribe from this list send a blank message to
lcdproc-unsubscribe AT lists.omnipotent.net



  • [lcdproc] New client, dosowski0474 AT vax2.winona.msus.edu, 02/13/1999
    • [lcdproc] New client, Jason Dale Woodward, 02/13/1999

Archive powered by MHonArc 2.6.18.

Top of page