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 Path: g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: Kim Rostgaard Christensen Newsgroups: comp.lang.ada Subject: Re: Adding offset to 'Address Date: Wed, 17 Sep 2008 11:18:20 +0200 Organization: Jacob's private Usenet server Message-ID: References: <50d60932-3553-44ce-9fde-25e9990621b7@d1g2000hsg.googlegroups.com> NNTP-Posting-Host: 1410ds1-nae.0.fullrate.dk Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: jacob-sparre.dk 1221643110 6565 90.184.228.86 (17 Sep 2008 09:18:30 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 17 Sep 2008 09:18:30 +0000 (UTC) User-Agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724) In-Reply-To: <50d60932-3553-44ce-9fde-25e9990621b7@d1g2000hsg.googlegroups.com> Xref: g2news1.google.com comp.lang.ada:2031 Date: 2008-09-17T11:18:20+02:00 List-Id: Bj�rn wrote: > On 12 Sep, 10:35, Kim Rostgaard Christensen wrote: >> Hi >> >> How does one go about setting a 'Address + (size of other record) to a >> record at runtime ? >> >> In brief, I am switching over "Frametype" in a Ethernet frame record, to >> dynamically assign the next record by type (IPv4,IPv6,ARP, etc.) >> My "datablob" is a *u_char from a imported C function. >> >> So I have: >> >> 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; >> >> Also, I am not confident that this _the_ solution, so other approaches >> are very welcome. For those curious about what it is all about, I ran a >> gnathtml on the source and made it available athttp://krc.greenpc.dk/hovedopgave/html/index.htm >> >> Regards >> Kim Rostgaard Christensen > > I was also playing around with PCAP earlier this year. I have not yet > finished what I intended to do but I got basic IP reassembly and TCP > session reconstruction to work. I uploaded the files to > http://www.mediafire.com/?1neezbx5bb1 if you want to have a peek. > However, note that this is work in progress. The application is not > finished and the quality of the code will need improvement. There are > also a lot more special cases in TCP handling that will need to be > handled. > > Regards > Bj�rn Wow, this is a very good source of inspiration, thanks - krc