Fidonet Portal






From: Rob Swindell (1:103/705)
To: All
Date: Sat, 13.02.21 15:13
"Packet Type 2 Compatible Formats" (Ex FSP-1040)
Re: "Packet Type 2 Compatible Formats" (Ex FSP-1040)
By: Maurice Kinal to Rob Swindell on Sat Feb 13 2021 09:07 pm

> -={ 2021-02-13 21:07:20.634530056+00:00 }=-
>
> Hey Rob!
>
> RS> The month field being discussed here is from the packet header,
> RS> which is binary (not a string of text).
>
> And exactly where was it called from?

Huh?

> I am guessing localtime(Wink which explains the resulting 0-11 reported.

It's not uncommon for January to represented as a 0. This allows for logical
indexing into an array of strings (where "Jan" or "January" would be the first,
or 0th, item in the array). This design is not specific to the C runtime
localtime(Wink function:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects
/Date/getMonth

> Same can be said for other sources of
> localtime(Wink such as perl, python, etc. They are all based on time.h.
>
> Where is your software getting the date and time from?

It depends on the context, but usually from time(Wink. When SBBSecho exports to
FTN "packed messages", it uses localtime(Wink to convert the stored time_t to a
struct tm and then I use sprintf to format into the standard DateTime field
syntax.

#define TM_YEAR(yy) ((yy)%100)
time_t tt = msg.hdr.when_written.time;
struct tm* tm;
if((tm = localtime(&tt)Wink != NULL)
sprintf(hdr.time,"%02u %3.3s %02u %02u:%02u:%02u"
,tm->tm_mday,mon[tm->tm_mon],TM_YEAR(tm->tm_year)
,tm->tm_hour,tm->tm_min,tm->tm_sec);

> RS> The date field you're referring to is in a "packed message"
> RS> header. The *year* field of the packet header is already 16-bits,
> RS> so can already accomodate years up to 65535.
>
> Understood but I was just using that as an example that the two digit year
> used in packed message header didn't need to be a two digit year which is
> contained in the string output for the DateTime field. In other words the
> format was bogus given that fact and could eaily be the cause of the poorly
> designed and deployed fts-4008 aka TZUTC.

You could sum up the vast majority of FidoNet in those two words: "poorly
designed". I guess we shouldn't really have expected more from technology
developed by amateurs. There was plenty of higher quality "prior art" available
at the time to learn or copy from, but those earlier Fido-pioneers thought they
were the first ones to invent this particular kind of wheel.
--- SBBSecho 3.12-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)

ABOUT

This forum contains echomail areas hosted on Nightmare BBS You can browse local echomail areas, italian fidonet areas and a selection of international fidonet areas, reading messages posted by users in Nightmare BBS or even other BBSs all over the world. You can find file areas too (functional to fidonet technology). You can browse echomail areas and download files with no registration, but if you want to write messages in echomail areas, or use fidonet netmail (private messages with fidomet technology), you have to register. Only a minimal set of data is required, functional to echomail and netmail usage (name, password, email); a registration and login with facebook is provided too, to allow easy registration. If you won't follow rules (each echomail areas has its own, regularly posted in the echomail), your account may be suspended;

CONTACT