Please help!
From: Fredrik Håkansson (fredrik_at_spamme.younix.se)
Date: 07/30/04
- Next message: Jens.Toerring_at_physik.fu-berlin.de: "Re: Please help!"
- Previous message: Emmanuel Delahaye: "Re: Bitwise operation"
- Next in thread: Jens.Toerring_at_physik.fu-berlin.de: "Re: Please help!"
- Reply: Jens.Toerring_at_physik.fu-berlin.de: "Re: Please help!"
- Reply: Alan Balmer: "Re: Please help!"
- Reply: SM Ryan: "Re: Please help!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Jul 2004 09:00:49 GMT
Hello!
I'm a beginner and are struggling to learn.
I'm on Linux and i know that i have an IP address in the member
variable RealHostAddr.sin.sin_addr.s_addr in HEX format. However i'm not
sure if this is a char[], long or what it is.
I have tried to have the contents of RealHostAddr.sin.sin_addr.s_addr to
be put into syslog.
I have tried the following:
syslog(LOG_DEBUG,"%s",(char *)RealHostAddr.sin.sin_addr.s_addr);
and
syslog(LOG_DEBUG,"%s",(char *)RealHostAddr.sin.sin_addr.s_addr, 10);
and
syslog(LOG_DEBUG,"%d",(int)RealHostAddr.sin.sin_addr.s_addr, 10);
and
syslog(LOG_DEBUG,"%d",(long)RealHostAddr.sin.sin_addr.s_addr, 10);
And many other but nothing seems to work. I have reasons to believe that
the IP is stored backwards so that 192.168.20.50 is 50.20.168.192. So i
also later want to use ntohl().
Fredrik
- Next message: Jens.Toerring_at_physik.fu-berlin.de: "Re: Please help!"
- Previous message: Emmanuel Delahaye: "Re: Bitwise operation"
- Next in thread: Jens.Toerring_at_physik.fu-berlin.de: "Re: Please help!"
- Reply: Jens.Toerring_at_physik.fu-berlin.de: "Re: Please help!"
- Reply: Alan Balmer: "Re: Please help!"
- Reply: SM Ryan: "Re: Please help!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|