-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpipbase.h
258 lines (216 loc) · 9.18 KB
/
pipbase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
// LoraBBS Version 2.41 Free Edition
// Copyright (C) 1987-98 Marco Maccaferri
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
/* PipBase.H: this file contains all data structure definition and
notes on how to manage them. All PipBase-compatible programs have to
refer to these informations */
/* data alignment is on bytes */
/* int (and uint) are 16 bits integers, LSB first */
#pragma pack(1)
#define PIPVERSION 1
#define PIPSUBVERSION 00
#define BUFSIZE 512
#define PRODUCT 0xAD
/* something about file names and location:
In your main directory there is the file NODEINFO.CFG, that holds all
general informations: it's an unique record of type NODEINFO.
In another directory (well, it may be the same of NodeInfo.Cfg), the
so-called pipbase directory, there are:
ORIGINS.PIP: a file containing 256 char[60] null-terminated strings: your
origins. (*)
BASEDESC.PIP: a file of records of the type AREASTRUCT, containing the area
definitions. (*)
DESTPTR.PIP: a file of DESTPTR type records. (*)
LASTREAD.PIP: a file of 8 or more tables of <cfg.model> integers each.
First 8 records are for the sysops indicated in NODEINFO.CFG;
following entries can be used for BBS users. (*)
MPTRxxxx.PIP, where xxxx is an hexadecimal number: a file of records of type
MSGPTR, indexing area xxxx. (*)
MPKTxxxx.PIP, where xxxx is an hexadecimal number: a file of packed
messages, each formed by a MSGPKTHDR record and five
null-terminated strings; the file is terminated by a double
null (that, with the terminator of the last string, forms a
three-zeroes sequence); it contains area xxxx texts;
the five null'terminated strings are the to, from, subj,
date and text fields of the standard FTS-0001 packets. (*)
FRIENDND.PIP: a file of FRIENDND type records, each of whom has an entry in
the forward_to bitmap of BASEDESC.PIP.
Notice that not all forward_to entries has to be assigned to a
record: a point does not need a large FRIENDND!
ROUTE.PIP: a file of ROUTE records, containing informations on how to
route netmail
Only files marked with an (*) are the pipbase standard. Other files are used
by PipBase.Exe and PipSetup, but you may change them (and, if possible, inform
the authors of these changes).
*/
typedef unsigned short uint;
typedef struct /* structure of the message headers in MPKTxxxx.PIP files */
{ uint pktype; /* 2= not compressed; 10=compressed with PIP */
uint fromnode, tonode, fromnet, tonet; /* for netmail */
uint attribute; /* bit 0=private as for SeaDog,
1=crash as for SeaDog,
2=received as for SeaDog,
3=sent as for SeaDog,
4=fileattach as for SeaDog,
5=in transit as for SeaDog,
6=from us(1)/to us(0) (pipbase only),
7=kill/sent as for SeaDog,
8=local as for SeaDog,
9=hold as for SeaDog,
10=locked,
11=filerequest as for SeaDog,
15=fileupdaterequest as for SeaDog */
/* when echomail, bit 3=1 means "processed"; */
/* bits 10,12,13,14 are unused, and they will be..... */
uint point; /* FMPT for inbound messages, TOPT for outbound messages */
} MSGPKTHDR;
#define SET_PKT_PRIV 1
#define SET_PKT_CRASH 2
#define SET_PKT_RCVD 4
#define SET_PKT_SENT 8
#define SET_PKT_ATTACH 16
#define SET_PKT_TRANSIT 32
#define SET_PKT_FROMUS 64
#define SET_PKT_KILL 128
#define SET_PKT_LOCAL 256
#define SET_PKT_HOLD 512
#define SET_PKT_LOCK 1024
#define SET_PKT_REQUEST 2048
#define SET_PKT_UPDATE 32768U
#define RESET_PKT_PRIV 0xfffe
#define RESET_PKT_CRASH 0xfffd
#define RESET_PKT_RCVD 0xfffb
#define RESET_PKT_SENT 0xfff7
#define RESET_PKT_ATTACH 0xffef
#define RESET_PKT_TRANSIT 0xffdf
#define RESET_PKT_FROMUS 0xffbf
#define RESET_PKT_KILL 0xff7f
#define RESET_PKT_LOCAL 0xfeff
#define RESET_PKT_HOLD 0xfdff
#define RESET_PKT_LOCK 0xfbff
#define RESET_PKT_REQUEST 0xf7ff
#define RESET_PKT_UPDATE 0x7fff
#define SEADOG_MASK 0x8a97
typedef struct /* structure of each record in MPTRxxxx.PIP files */
{ long pos; /* pointer to MPKTxxxx.PIP */
uint prev, next; /* pointers to other records in MPTRxxxx */
uint status; /* bit 0=deleted 1=received 2=sent */
/* 3=fromus(1)/tous(0) 4=Locked (Undeletable) */
} MSGPTR;
#define SET_MPTR_DEL 1
#define SET_MPTR_RCVD 2
#define SET_MPTR_SENT 4
#define SET_MPTR_FROMUS 8
#define SET_MPTR_LOCK 16
#define RESET_MPTR_DEL 0xfffe
#define RESET_MPTR_RECV 0xfffd
#define RESET_MPTR_SENT 0xfffb
#define RESET_MPTR_FROMUS 0xfff7
#define RESET_MPTR_LOCK 0xfffef
typedef struct /* structure of each record in DESTPTR.PIP */
{ char to[36]; /* addressee name */
uint area, msg; /* pointers to MPTRarea.PIP records */
long next; /* to speed up search (in future) */
} DESTPTR;
#define FRI_SET_PIPMAIL 1
#define FRI_RESET_PIPMAIL 0xfffe
#define FRI_SET_ACTIVE 2
#define FRI_RESET_ACTIVE 0xfffd
#define FRI_SET_DEL 4
#define FRI_RESET_DEL 0xfffb
#define FRI_SET_HOLD 8
#define FRI_RESET_HOLD 0xfff7
typedef struct {
unsigned short
orig_node, /* originating node */
dest_node, /* destination node */
year, /* 1990 - nnnn */
month, /* month -1 */
day,
hour,
minute,
second,
rate, /* unused */
ver, /* 2 */
orig_net, /* originating net */
dest_net; /* destination net */
unsigned char
product, /* product code */
rev_lev, /* revision level */
password[8];
unsigned short
qm_orig_zone, /* QMail orig.zone */
qm_dest_zone, /* QMail dest.zone */
wm_orig_point, /* Wmail orig.point */
wm_dest_point; /* Wmail dest.point */
unsigned char
TRASH[4]; /* junk[4] */
unsigned short
orig_zone, /* originating zone */
dest_zone, /* destination zone */
orig_point, /* originating point */
dest_point; /* destination point */
unsigned long
pr_data;
} MAILPKT;
typedef struct {
char fromwho[36], towho[36], subj[72], date[20];
uint times,
destnode, orignode,
cost,
orignet, destnet,
destzone, origzone,
destpoint, origpoint,
reply, attr, nextreply;
} FIDOMSG;
// static char *mname[12]={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
typedef struct /* structure of each record in ROUTE.PIP */
{
unsigned char mode; /* see table below */
uint zone, net, node, point;
unsigned short via; /* pointer to a friend node */
} ROUTE;
/* mode can be one of following values:
0: route all exported matrix via the specified friend
(zone,net,node and point fields are ignored)
1: route all the specified zone via the friend
(net,node and point fields are ignored)
2: route all the specified net via the friend
(node and point fields are ignored)
3: route all the hub via the friend
(last two digits of the node field and the point field are ignored)
4: route the node and all his points via the friend
(point field is ignored)
5: route that point via that friend
If not specified:
- a point routes all his mail via his boss
- a boss routes all his mail via his hub (we maded the asumption that
the hub of BBS xxx/yyzz has always node number xxx/yy00) or directly
to his points.
- a hub (or a node without a hub) routes all his mail via the network
coordinator, or sends it directly to his subnodes
- a host routes all his mail via the other network coordinators, or
via the hubs if they're defined, or via a zonegate, or to his
subnodes
- all mail for points is always routed via their boss
- all mail for defined friends is sent directly
*/
#define ROUTE_ALL 0
#define ROUTE_ZONE 1
#define ROUTE_NET 2
#define ROUTE_HUB 3
#define ROUTE_NODE 4
#define ROUTE_POINT 5