Re: How can I translate IP to hostname in C



On Thu, May 22, 2008 at 07:30:45PM +0100, Bruce Cran wrote:
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

Ups - yes that's what I ment in my mail.
I wrote getaddrinfo, which is the other direction...

--
B.Walter <bernd@xxxxxxx> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.
_______________________________________________
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
    ... John Timony wrote: ... I am writing a c program in FreeBSD,and I can not ... translate a ip to hostname ...
    (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)
  • Re: Some people cant understand their neighbours
    ... income. ... Why would I translate another man's writing and say it's my ... own or God forbid edit his writing? ... People are _paid_ to edit or translate works all the time. ...
    (sci.lang)