Re: How can I translate IP to hostname in C



John Timony wrote:
Hi,guys

I am writing a c program in FreeBSD,and I can not
translate a ip to hostname
,i wonder if there is a function to take this job...


You could use gethostbyaddr(3), but those traditional functions have been replaced with more flexible versions such as getnameinfo(3) on newer systems. There's a good introduction to modern sockets programming at http://people.redhat.com/drepper/userapi-ipv6.html

--
Bruce Cran
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: How can I translate IP to hostname in C
    ... I am writing a c program in FreeBSD,and I can not ... translate a ip to hostname ... Modbus/TCP Ethernet I/O Baugruppen, ...
    (freebsd-hackers)
  • Re: How can I translate IP to hostname in C
    ... On Thu, 22 May 2008, John Timony wrote: ... translate a ip to hostname ... further inspiration on this but slightly different topic. ...
    (freebsd-hackers)
  • Re: Which book sounds most compelling?
    ... an impact on the world's literature reflects who writes ... I think "world literature" is more to do with English than with the ... lightness or darkness of the people writing or the quality of what is ... what is chosen to translate? ...
    (rec.arts.sf.composition)
  • Re: Some people cant understand their neighbours
    ... income. ... Why would I translate another man's writing and say it's my ... Many Europeans write in "English" which is only comprehensible if you ...
    (sci.lang)
  • Re: TaskWindow -txt &xxxxxxxx
    ... Not because I'm smart or anything, just in the course of writing my message I spent a good few minutes playing with Google Translate. ... The only real issue I have about Translate is I really *REALLY* wish it would own up to words it doesn't know and drop them in square brackets to indicate translation failure. ... However, even in Japanese words in roman characters crop up so we're back to square one - is this *really* how you write such a phrase, or is it an unknown word? ...
    (comp.sys.acorn.programmer)