File: btypes.h

package info (click to toggle)
binkd 1.1a-99-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,452 kB
  • sloc: ansic: 22,949; makefile: 943; perl: 369; sh: 325
file content (167 lines) | stat: -rw-r--r-- 4,563 bytes parent folder | download | duplicates (3)
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
/*
 *  btypes.h -- defines types and structures used in binkd
 *
 *  btypes.h is a part of binkd project
 *
 *  Copyright (C) 1996-1997  Dima Maloff, 5047/13
 *
 *  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. See COPYING.
 */

#ifndef _btypes_h
#define _btypes_h

#include <sys/types.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#include <time.h>
#endif

#include "Config.h"

struct list_itemlink  { void *next; };  /* in the beginning of each item! */
struct list_linkpoint { struct list_itemlink *last; }; /* in the beginning of each list! */

#define TYPE_LIST(itemtype)  struct simplelist_##itemtype
#define DEFINE_LIST(itemtype)       \
  TYPE_LIST(itemtype)               \
  {                                 \
  struct list_linkpoint linkpoint;  \
  struct itemtype *first;           \
  }

typedef struct _FTN_DOMAIN FTN_DOMAIN;
struct _FTN_DOMAIN
{
  FTN_DOMAIN *next;
  char name[MAX_DOMAIN + 1];
  char *path;				    /* Outbound dir's path, ie
					     * "/var/spool/fido" */
  char *dir;				    /* Outbound dir's name, ie "outb" */
  int z[2];
  char *idomain;			    /* internet root-domain */
  FTN_DOMAIN *alias4;
};

typedef struct _FTN_ADDR FTN_ADDR;
struct _FTN_ADDR
{
  char domain[MAX_DOMAIN + 1];
  int z, net, node, p; /* -1==unknown or wildcard */
};

typedef struct _FTN_NODE FTN_NODE;
struct _FTN_NODE
{
  int listed;                          /* listed or added by defnode? */
  char *hosts;			       /* "host1:port1,host2:port2,*" */

  FTN_ADDR fa;
  char pwd[MAXPWDLEN + 1];
  char *pkt_pwd, *out_pwd;
  char obox_flvr;
  char *obox;
  char *ibox;
  char *pipe;
  int NR_flag;
  int ND_flag;
  int MD_flag;
  int HC_flag;
  int restrictIP;
  int NP_flag;                         /* no proxy */

  time_t hold_until;
  int busy;			       /* 0=free, 'c'=.csy, other=.bsy */
  int mail_flvr;		       /* -1=no mail, other=it's flavour */
  int files_flvr;		       /* -1=no files, other=it's flavour */
#ifdef BW_LIM
  long bw_send, bw_recv;               /* send and receive bw limits */
#endif
  int IP_afamily;
  time_t recheck;
#ifdef AF_FORCE
  int AFF_flag;                       /* 4||6 force IPv4||IPv6 for first connect () try */
#endif
};

typedef struct _FTNQ FTNQ;
struct _FTNQ
{
  FTNQ *next;
  FTNQ *prev;

  FTN_ADDR fa;
  char flvr;			       /* 'I', 'i', 'C', 'c', 'D', 'd', 'O',
				        * 'o', 'F', 'f', 'H', 'h' */
  char action;			       /* 'd'elete, 't'runcate, '\0' -- none,
				        * remove on 's'uccessful session,
				        * after 'a'ny session */
  char type;			       /* 'm' -- a mail packet (.?ut),
				        * 'l' -- a flow file (.?lo),
				        * 's' -- a ND-mode status file (.stc),
				        * '*' -- a file from .?lo (just for
				        * stats, it will never be selected for
				        * sending right from the queue, it
				        * will be send when parsing its .flo
				        * instead, now it's obsolete),
				        * other -- a file to send. */
  char path[MAXPATHLEN + 1];
  boff_t size;
  time_t time;			       /* this field seems to be used only in
				        * cmp_filebox_files(), when sorting
				        * files from a filebox before sending */

  int sent;			       /* == 1, if the file have been sent */
};

/* A file in transfer */
typedef struct _TFILE TFILE;
struct _TFILE
{
  char path[MAXPATHLEN + 1];		    /* It's name */
  char flo[MAXPATHLEN + 1];		    /* It's .?lo */
  char netname[MAX_NETNAME + 1];	    /* It's "netname" */
  char action;				    /* 'd'elete, 't'runcate, '\0' -- * *
					     * none */
  char type;
  boff_t size;
  time_t start;				    /* The transfer started at... */
  time_t time;				    /* Filetime */
  FILE *f;
  FTN_ADDR fa;
};

/* Files to kill _after_ session */
typedef struct _KILLLIST KILLLIST;
struct _KILLLIST
{
  char name[MAXPATHLEN + 1];		    /* file's name */
  char cond;				    /* after 's'uccessful session,
					     * '\0' -- in any case */
};

typedef struct _EVTQ
{
  char *path;
  struct _EVTQ *next;
  char evt_type;
} EVTQ;

/* List of files received in the current batch */
typedef struct _RCVDLIST RCVDLIST;
struct _RCVDLIST
{
  char name[MAXPATHLEN + 1];		    /* file's name */
};

enum inbcasetype { INB_SAVE,INB_UPPER,INB_LOWER,INB_MIXED };

enum dontsendemptytype { EMPTY_NO, EMPTY_ARCMAIL, EMPTY_ALL };

enum renamestyletype { RENAME_POSTFIX, RENAME_EXTENSION, RENAME_BODY };

#endif