Date: Sun, 08 Jul 2001 07:06:10 +0900 (JST) From: Hajimu UMEMOTO <ume@mahoroba.org> To: hackers@freebsd.org, net@freebsd.org Subject: Fw: Fwd: (SIOCAIFADDR) Please help me! Message-ID: <20010708.070610.74741066.ume@mahoroba.org>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Eduardo, your mail host (200.190.143.201) seems to have no PTR RR.
[-- Attachment #2 --]
Return-Path: <ebf@cwb.fnn.net>
Received: (from uucp@localhost)
by mail.mahoroba.org (8.11.4/8.11.4/chaos) with UUCP id f67LotZ10291
for ume@mahoroba.org; Sun, 8 Jul 2001 06:50:55 +0900 (JST)
(envelope-from ebf@cwb.fnn.net)
Received: from cwb.fnn.net ([200.190.143.201])
by light.imasy.or.jp (8.11.3+3.4W/8.11.3/light) with SMTP/inet id f67Lo2B17435
for <ume@mahoroba.org>; Sun, 8 Jul 2001 06:50:05 +0900 (JST)
(envelope-from ebf@cwb.fnn.net)
Received: (qmail 78571 invoked by uid 85); 7 Jul 2001 21:56:36 -0000
Received: from ebf@cwb.fnn.net by aline.cwb.fnn.net with FutureMail-ViruScanner-Por_Eduardo_B._Fonseca-0.96 (uvscan: v4.1.40/v4145. . Clean. Processed in 0.290295 secs); 07 Jul 2001 21:56:36 -0000
Received: from unknown (HELO peugeot206.cwb.fnn.net) (200.190.143.160)
by aline.cwb.fnn.net with SMTP; 7 Jul 2001 21:56:36 -0000
Content-Type: text/plain;
charset="iso-8859-1"
From: "Eduardo B. Fonseca" <ebf@cwb.fnn.net>
Organization: A&D Solucoes Ltda.
To: Hajimu UMEMOTO <ume@mahoroba.org>
Subject: Fwd: (SIOCAIFADDR) Please help me!
Date: Sat, 7 Jul 2001 18:50:08 -0300
X-Mailer: KMail [version 1.2]
Message-Id: <01070718500804.00297@peugeot206.cwb.fnn.net>
X-MIME-Autoconverted: from quoted-printable to 8bit by mail.mahoroba.org id f67LotZ10291
Mime-Version: 1.0 (modified by Mew)
Content-Transfer-Encoding: quoted-printable (modified by Mew)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Mr. Umemoto,
Sorry to bother you. I'm trying to send this e-mail to the mailing lis=
t but =
(although I'm subscribed) It just doesn't work. Could you please, relay=
this =
to the freebsd-net and freebsd-hackers list? I can receive any e-mails =
to the =
list but I can't send. =
Thanks a lot!
Eduardo.
- ---------- Forwarded Message ----------
Subject: (SIOCAIFADDR) Please help me!
Date: Sat, 7 Jul 2001 18:37:14 -0300
From: Eduardo B. Fonseca <ebf@cwb.fnn.net>
To: freebsd-hackers@freebsd.org, hackers@freebsd.org, =
freebsd-net@freebsd.org, net@freebsd.org
Hello guys,
=A0=A0=A0=A0=A0=A0=A0=A0 Please... What's wrong with the code below? So=
metimes it works,
sometimes it doesn't. Yesterday, I've tested it and everything worked f=
ine...
Now, everytime I try to set the machine's IP address with this code, it=
does
not work... It sets a bogus IP, with a bogus netmask...
I'm stumped... I can't find documentation anywhere.
void
Interface::
AddAddressOnInterface(int sockfd, string ip, string netmsk, string broa=
daddr)
{
=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 struct =A0=A0=A0=A0=A0=A0=
=A0=A0 ifaliasreq =A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 request;
=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 bzero (&request, sizeof(=
struct ifaliasreq));
=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 strcpy(request.ifra_name=
,deviceName.c_str());
=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 request.ifra_addr.sa_fam=
ily=A0=A0=A0=A0 =3D AF_INET;
=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 inet_pton(AF_INET, ip.c_=
str(), &((struct sockaddr_in
*)&request.ifra_addr)->sin_addr);
=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 inet_pton(AF_INET, netms=
k.c_str(), &((struct sockaddr_in
*)&request.ifra_mask)->sin_addr);
=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 inet_pton(AF_INET, broad=
addr.c_str(), &((struct sockaddr_in
*)&request.ifra_broadaddr)->sin_addr);
=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 ioctl(sockfd,SIOCAIFADDR=
,&request);
}
Thanks for any help.
Regards,
Eduardo.
- -------------------------------------------------------
- -- =
Eduardo B. Fonseca
Diretor Regional Curitiba
FutureNet Telecomunica=E7=F5es e Inform=E1tica Ltda
ebf@cwb.fnn.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org
iD8DBQE7R4QQf9aI6FhScUkRAqj4AJ9R83iKO+qQlzPvEun7tIWxgc+ERgCgrOqG
wK5nfbFrAKf2IHK+A93VLl4=3D
=3DJEsw
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010708.070610.74741066.ume>
