chiark / gitweb /
merge
[inn-innduct.git] / include / inndcomm.h
1 /*  $Revision: 6786 $
2 **
3 **  Here be values used for communicating with the server once it is
4 **  running.
5 */
6
7 #ifdef __cplusplus
8 extern "C" {
9 #endif /* __cplusplus */
10
11 /* The header for the ICC protocol is a one-byte protocol version followed
12    by a 2 byte messages length*/
13 #define HEADER_SIZE (sizeof (ICC_PROTOCOLTYPE) + sizeof (ICC_MSGLENTYPE))
14
15 typedef unsigned short ICC_MSGLENTYPE;  /* Length code to prefix commands to
16                                         ** the server. */
17 typedef char ICC_PROTOCOLTYPE ;
18
19 /* Values for the protocol version field of the message. 8 bits wide. */
20 #define ICC_PROTOCOL_1 'a'
21
22
23
24 #define SC_SEP          '\001'
25 #define SC_MAXFIELDS    6
26
27 #define SC_ADDHIST      'a'
28 #define SC_ALLOW        'D'
29 #define SC_BEGIN        'b'
30 #define SC_CANCEL       'c'
31 #define SC_CHANGEGROUP  'u'
32 #define SC_CHECKFILE    'd'
33 #define SC_DROP         'e'
34 #define SC_FEEDINFO     'F'
35 #define SC_FILTER       'T'
36 #define SC_FLUSH        'f'
37 #define SC_FLUSHLOGS    'g'
38 #define SC_GO           'h'
39 #define SC_HANGUP       'i'
40 #define SC_LOGMODE      'E'
41 #define SC_LOWMARK      'L'
42 #define SC_MODE         's'
43 #define SC_NAME         'j'
44 #define SC_NEWGROUP     'k'
45 #define SC_PARAM        'l'
46 #define SC_PAUSE        'm'
47 #define SC_PERL         'P'
48 #define SC_PYTHON       'Y'
49 #define SC_READERS      'v'
50 #define SC_REJECT       'C'
51 #define SC_RELOAD       'o'
52 #define SC_RENUMBER     'n'
53 #define SC_RESERVE      'z'
54 #define SC_RMGROUP      'p'
55 #define SC_SEND         'A'
56 #define SC_SHUTDOWN     'q'
57 #define SC_STATHIST     'H'
58 #define SC_STATUS       'S'
59 #define SC_SIGNAL       'B'
60 #define SC_THROTTLE     'r'
61 #define SC_TIMER        'Z'
62 #define SC_TRACE        'w'
63 #define SC_XABORT       'x'
64 #define SC_XEXEC        'y'
65
66     /* Yes, we don't want anyone to use this. */
67 #define SC_FIRSTFREE    G
68
69 #define MAX_REASON_LEN  80
70
71
72 extern void             ICCsettimeout(int i);
73 extern int              ICCopen(void);
74 extern int              ICCclose(void);
75 extern int              ICCcommand(char cmd, const char *argv[], char **replyp);
76 extern int              ICCcancel(const char *msgid);
77 extern int              ICCgo(const char *why);
78 extern int              ICCpause(const char *why);
79 extern int              ICCreserve(const char *why);
80
81 extern const char       *ICCfailure;
82
83 /* Use a read or recv call to read a descriptor. */
84 #ifdef HAVE_UNIX_DOMAIN_SOCKETS
85 # define RECVorREAD(fd, p, s)   recv((fd), (p), (s), 0)
86 #else
87 # define RECVorREAD(fd, p, s)   read((fd), (p), (s))
88 #endif
89
90 #ifdef __cplusplus
91 }
92 #endif /* __cplusplus */