Board: [WWIVnet] WWIV Development Subject: Re: wrangling packets... need to learn to wrangle Type-2 msg From: Rushfan #1 @513 To: Xenos #1 @60 Date: Tue Sep 10, 2024 22:58 X> i need a nudge in the right direction for grappling with reading/writing X> type-2 X> messages... maybe sample code for a stand-alone util that just reads X> from one X> sub, or posts to a sub. X> I can't find anything I wrote up about it unfortunately, but the basics of the gat stuff is the message text file (.dat) is a repeating series of: header (aka gat) text blocks The text blocks are a linked list of the next block or -1 for the last block, it's much like the FAT filesystem. msg.stored_as is the way to find that first block. You need to jump to the section and then offset. To find the section, it's basically sectiuon = msg.stored_as / GAT_NUMBER_ELEMENTS (which is 2048) offset = msg.stored_as % GAT_NUMBER_ELEMENTS So you seek to the gat section + (512 /* block size */ * offset) The start of the gat section is: section * GATSECLEN + GAT_SECTION_SIZE (all of these constants are in https://github.com/wwivbbs/wwiv/blob/main/sdk/msg api/type2_text.h). Let me know if this high level info is helpful. rushfan .