Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Mar 2000 00:01:34 -0500 (EST)
From:      Robert Watson <robert@cyrus.watson.org>
To:        Mourad Lakhdar <992C396651@stud.alakhawayn.ma>
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Re: need help
Message-ID:  <Pine.NEB.3.96L.1000318235906.1270F-100000@fledge.watson.org>
In-Reply-To: <Pine.SOL.3.96.1000319033001.12506B-100000@stud.alakhawayn.ma>

next in thread | previous in thread | raw e-mail | index | archive | help

You would probably benefit from using the online programmers'
documentation available via the man pages.

	% man inet_addr

Should tell you everything you need to know.  You may want to address
further questions to freebsd-questions@freebsd.org.  For reference, it
suggests:

SYNOPSIS
     #include <sys/types.h>
     #include <sys/socket.h>
     #include <netinet/in.h>
     #include <arpa/inet.h>


On Sun, 19 Mar 2000, Mourad Lakhdar wrote:

> 	thank you:
> 
> 
> but when i did that , i got a n "undefined inet_addr reference " error , i
> guess  that i have to include another header , but which one?
> 
> best regards, 
> 
> On Sat, 18 Mar 2000, Robert Watson wrote:
> 
> > 
> > Try
> > 
> > 	ip.ip_dst.s_addr = inet_addr("10.10.11.240");
> > 
> > inet_addr() returns addresses in network byte order so no further work is
> > required.  There's also ascii2addr -- with the advent of IPv6, I'm not
> > sure what the approved mechanism is.  But for IPv4, which is what you
> > seem to be interested in, inet_addr() is the easiest path.
> > 
> > On Sun, 19 Mar 2000, Mourad Lakhdar wrote:
> > 
> > > 
> > > 		hi everybody:
> > > 
> > > i need to insert a new ip address in the ip stucture , but i don't know
> > > how to do ; there is the problem :
> > > 
> > > 	i have for exemple an ip address of : 10.10.11.240
> > > 
> > > 	i'm seekinf if there is a function such that i can insert this ip
> > > address in the field : 
> > > 		ip->ip_dst.s_addr
> > > 
> > > where ip is : struct ip* ip;
> > > 
> > > 
> > > 
> > > 
> > > 
> > > To Unsubscribe: send mail to majordomo@FreeBSD.org
> > > with "unsubscribe freebsd-hackers" in the body of the message
> > > 
> > 
> > 
> >   Robert N M Watson 
> > 
> > robert@fledge.watson.org              http://www.watson.org/~robert/
> > PGP key fingerprint: AF B5 5F FF A6 4A 79 37  ED 5F 55 E9 58 04 6A B1
> > TIS Labs at Network Associates, Safeport Network Services
> > 
> > 
> 
> 


  Robert N M Watson 

robert@fledge.watson.org              http://www.watson.org/~robert/
PGP key fingerprint: AF B5 5F FF A6 4A 79 37  ED 5F 55 E9 58 04 6A B1
TIS Labs at Network Associates, Safeport Network Services



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1000318235906.1270F-100000>