From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,812965ed29240012 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!attbi_s21.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Making a Inet_Addr_Type out of octects (GNAT.Sockets) References: <910108d9-03a0-4e35-86d2-572501a82906@z6g2000pre.googlegroups.com> In-Reply-To: <910108d9-03a0-4e35-86d2-572501a82906@z6g2000pre.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s21 1223410319 12.201.97.213 (Tue, 07 Oct 2008 20:11:59 GMT) NNTP-Posting-Date: Tue, 07 Oct 2008 20:11:59 GMT Organization: AT&T ASP.att.net Date: Tue, 07 Oct 2008 20:11:59 GMT Xref: g2news1.google.com comp.lang.ada:2272 Date: 2008-10-07T20:11:59+00:00 List-Id: mockturtle wrote: > > I have 4 octects (read by a received packet) which rappresent > an IP address and I want to convert them into a Inet_Addr_Type > (using GNAT.Sockets). Of course I could convert the 4 octects > into a string to be given to function Inet_Addr_Type, but it seems > a bit "convoluted" (it sounds like the joke about the mathematician's > algorithm to make a pot of hot water :-). My question is: there > is a function which allows me to do such a conversion in a > more direct way? I looked at g-sockets, searching for > "Inet_Addr_Type", but I could not find anything. I'm not aware of any way provided by the pkg other than that you outlined above. There are ways using Unchecked_Conversion and address overlays, but they are Not Recommended. -- Jeff Carter "My legs are gray, my ears are gnarled, my eyes are old and bent." Monty Python's Life of Brian 81