1libinn_inndcomm(3) InterNetNews Documentation libinn_inndcomm(3)
2
3
4
6 inndcomm - Routines for managing innd control commands
7
9 #include <inn/inndcomm.h>
10
11 #define SC_ADDHIST ...
12 #define SC_ALLOW ...
13 #define SC_BEGIN ...
14 #define SC_CANCEL ...
15 #define SC_CHANGEGROUP ...
16 #define SC_CHECKFILE ...
17 #define SC_DROP ...
18 #define SC_FEEDINFO ...
19 #define SC_FLUSH ...
20 #define SC_FLUSHLOGS ...
21 #define SC_GO ...
22 #define SC_HANGUP ...
23 #define SC_LOGMODE ...
24 #define SC_LOWMARK ...
25 #define SC_MODE ...
26 #define SC_NAME ...
27 #define SC_NEWGROUP ...
28 #define SC_PARAM ...
29 #define SC_PAUSE ...
30 #define SC_PERL ...
31 #define SC_PYTHON ...
32 #define SC_READERS ...
33 #define SC_REJECT ...
34 #define SC_RELOAD ...
35 #define SC_RENUMBER ...
36 #define SC_RESERVE ...
37 #define SC_RMGROUP ...
38 #define SC_SEND ...
39 #define SC_SHUTDOWN ...
40 #define SC_STATHIST ...
41 #define SC_STATUS ...
42 #define SC_SIGNAL ...
43 #define SC_THROTTLE ...
44 #define SC_TIMER ...
45 #define SC_TRACE ...
46 #define SC_XABORT ...
47 #define SC_XEXEC ...
48
49 #define MAX_REASON_LEN ...
50
51 extern int ICCopen(void);
52 extern int ICCclose(void);
53 extern void ICCsettimeout(int i);
54 extern int ICCcommand(char cmd, const char *argv[], char **replyp);
55 extern int ICCcancel(const char *msgid);
56 extern int ICCpause(const char *why);
57 extern int ICCreserve(const char *why);
58 extern int ICCgo(const char *why);
59
60 extern const char *ICCfailure;
61
63 The routines described in this manual page are part of the InterNetNews
64 library, libinn(3). They are used to send commands to a running innd
65 daemon on the local host. The letters "ICC" stand for Innd Control
66 Command.
67
68 The ICCopen function creates a Unix-domain datagram socket and binds it
69 to the server's control socket, if such sockets are supported.
70 Otherwise, it creates a named pipe for communicating with the server.
71 It returns "-1" on failure or 0 on success. This routine must be
72 called before any other routine.
73
74 The ICCclose function closes any descriptors that have been created by
75 ICCopen. It returns "-1" on failure or 0 on success.
76
77 The ICCsettimeout function can be called before any of the following
78 routines to determine how long the library should wait before giving up
79 on getting the server's reply. This is done by setting and catching a
80 SIGALRM signal(2). If the timeout is less than zero, then no reply
81 will be waited for. The SC_SHUTDOWN, SC_XABORT, and SC_XEXEC commands
82 do not get a reply either. The default, which can be obtained by
83 setting the timeout to <0>, is to wait during 2 minutes.
84
85 The ICCcommand function sends the command cmd with parameters argv to
86 the server. It returns "-1" on error. If the server replies, and
87 replyp is not NULL, it will be filled in with an allocated buffer that
88 contains the full text of the server's reply. This buffer is a string
89 in the form of "digits text" where digits is the text value of the
90 recommended exit code (usually 1, followed with text, giving the reason
91 of the failure); a 0 value indicates success. Replies longer than 64KB
92 will be truncated. The possible values of cmd are defined in the
93 inn/inndcomm.h header file, and also in the SYNOPSIS of this man page.
94 The parameters for each command are described in ctlinnd(8). This
95 routine returns "-1" on communication failure, or the exit status sent
96 by the server which will never be negative.
97
98 The ICCcancel function sends a "cancel" message to the server. Its
99 msgid argument is the Message-ID of the article that should be
100 cancelled. The return value is the same as for ICCcommand.
101
102 The ICCpause, ICCreserve, and ICCgo functions send a "pause",
103 "reserve", or "go" command to the server, respectively. If ICCreserve
104 is used, then the why value used in the ICCpause invocation must match;
105 the value used in the ICCgo invocation must always match the one used
106 in the ICCpause invocation. The return value for all three routines is
107 the same as for ICCcommand.
108
109 If any routine described above fails, the ICCfailure variable will
110 identify the system call that failed.
111
113 Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. Rewritten
114 into POD by Julien Elie.
115
117 ctlinnd(8), innd(8), libinn(3).
118
119
120
121INN 2.7.1 2022-07-10 libinn_inndcomm(3)