Please help!

From: Fredrik Håkansson (fredrik_at_spamme.younix.se)
Date: 07/30/04


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



Relevant Pages

  • Please help!
    ... 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. ...
    (comp.unix.programmer)
  • Equivalent of Windows subgroups
    ... is there a way of making one group a member of another group ... Other than of course manually typing out the members ... it doesn't seem like linux has thing option and I'm struggling to ...
    (comp.os.linux.misc)
  • Re: Word of Wisdom
    ... I think the idea that Joseph Smith "struggled" with the Word of Wisdom ... I don't think it likely that any Nauvoo-era member of the church thought ... I don't think he was struggling with the idea - I think ... coffee grinder for every families. ...
    (soc.religion.mormon)
  • Re: looking for membership management software -- Open Source, written in Python
    ... If you need a Linux or OS X ... member chapter of a 30,000-member organization. ... comes from the national organization as an Excel spreadsheet -- ... officers or committee chairs the ability to grab subsets of data on ...
    (comp.lang.python)
  • Re: script hangs while opening a file from /proc in a thread
    ... > But this hangs on open: ... > It happens on Linux 2.6, ... By adding a 'poll' member to this struct ...
    (comp.lang.ruby)