Value function does not work..

"Ramasivan, Ganesh" <[email protected]> Fri, 6 Aug 2004 16:20:06 -0400
Newsgroups gmane.comp.lang.ada.sockets
Message-ID <[email protected]>
Hello everyone,

I am having a problem making use of the Value function from =
sockets-naming.adb.

The following is the code segment:

   function Value (Add : String) return Address
   is
      function Convert is
         new Ada.Unchecked_Conversion (Source =3D> =
Interfaces.Unsigned_32,
                                       Target =3D> In_Addr);
      C_Add     : chars_ptr        :=3D New_String (Add);
      Converted : constant In_Addr :=3D Convert (C_Inet_Addr (C_Add));
   begin
      Free (C_Add);
      return (H1 =3D> Address_Component (Converted.S_B1),
              H2 =3D> Address_Component (Converted.S_B2),
              H3 =3D> Address_Component (Converted.S_B3),
              H4 =3D> Address_Component (Converted.S_B4));
   end Value;

I always get a result of 255.255.255.255 as the output of this routine. =
It looks like C_Inet_Addr returns 0xFFFFFFFF and I don't understand why.

I am running on Solaris 2.8.
_______________________________________________
AdaSockets mailing list
[email protected]
http://lists.rfc1149.net/mailman/listinfo/adasockets