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,e2be1c8e99a1c994 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.buerger.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Adding offset to 'Address Date: Fri, 19 Sep 2008 01:09:53 -0500 Organization: Jacob's private Usenet server Message-ID: References: NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1221804602 21017 69.95.181.76 (19 Sep 2008 06:10:02 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 19 Sep 2008 06:10:02 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 Xref: g2news2.google.com comp.lang.ada:7768 Date: 2008-09-19T01:09:53-05:00 List-Id: "Kim Rostgaard Christensen" wrote in message news:gaqhs6$690$1@jacob-sparre.dk... > tmoran@acm.org wrote: >>> Raw_Bytes : access Unsigned_Char >>> for Ethernet_Header'Address use Raw_Bytes.all'Address; >>> >>> and additionally need something like: >>> for IP_Packet'Address use Raw_Bytes.all'Address + Ethernet_Header'Size; >> >> It's not clear to me exactly what problem you are trying to get past. > > The problem was basically to perform arithmethics on system addresses No, that's a (bad) solution to some problem, not a problem by itself. The problem seems to be how to access the data bytes without accessing the header, and Tom suggests a good solution for that. (We use versions of it in Claw.) IMHO, the use of Address in Ada 95 or newer code (other than to specify raw, absolute machine addresses) is never necessary and represents bad programming. I see it fairly often here, and it makes me ill. I much prefer general access types and possibly Unchecked_Conversions, because you lose much less strong typing that way (and the code is better without the need for heroic efforts on the part of the compiler). Randy. Randy.