libinn_inndcomm(3)

πŸ’– libinn_inndcomm β€” the "sending vibes to innd" page πŸ’–

okay so bestie, you're looking at libinn_inndcomm, one of the pages in the InterNetNews Documentation collection. yes it's a whole library situation and yes it's iconic. πŸŽ€


✨ NAME ✨

inndcomm β€” the routines that let you boss innd around with control commands πŸ‘‘

<divider>


🌸 SYNOPSIS 🌸

#include <inn/inndcomm.h>

#define SC_ADDHIST ...
#define SC_ALLOW ...
#define SC_BEGIN ...
#define SC_CANCEL ...
#define SC_CHANGEGROUP ...
#define SC_CHECKFILE ...
#define SC_DROP ...
#define SC_FEEDINFO ...
#define SC_FLUSH ...
#define SC_FLUSHLOGS ...
#define SC_GO ...
#define SC_HANGUP ...
#define SC_LOGMODE ...
#define SC_LOWMARK ...
#define SC_MODE ...
#define SC_NAME ...
#define SC_NEWGROUP ...
#define SC_PARAM ...
#define SC_PAUSE ...
#define SC_PERL ...
#define SC_PYTHON ...
#define SC_READERS ...
#define SC_REJECT ...
#define SC_RELOAD ...
#define SC_RENUMBER ...
#define SC_RESERVE ...
#define SC_RMGROUP ...
#define SC_SEND ...
#define SC_SHUTDOWN ...
#define SC_STATHIST ...
#define SC_STATUS ...
#define SC_SIGNAL ...
#define SC_THROTTLE ...
#define SC_TIMER ...
#define SC_TRACE ...
#define SC_XABORT ...
#define SC_XEXEC ...

#define MAX_REASON_LEN ...

extern int ICCopen(void);
extern int ICCclose(void);
extern void ICCsettimeout(int i);
extern int ICCcommand(char cmd, const char *argv[], char **replyp);
extern int ICCcancel(const char *msgid);
extern int ICCpause(const char *why);
extern int ICCreserve(const char *why);
extern int ICCgo(const char *why);

extern const char *ICCfailure;

like, that's the whole cast of characters right there πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so these routines are part of the InterNetNews library, libinn(3), and honestly? they're giving backstage-pass energy. their whole job is sending commands to a running innd daemon on the local host. and the letters "ICC"? they stand for Innd Control Command, iykyk. ✨


πŸ’œ ICCopen

this one creates a Unix-domain datagram socket and binds it to the server's control socket β€” if such sockets are supported. otherwise? it creates a named pipe to talk to the server instead. no biggie, it adapts. 🌈

it returns -1 on failure or 0 on success.

bestie, listen: this routine must be called before any other routine. like, it's the vibe check you have to pass first. no skipping. πŸ™ˆ

πŸŽ€ ICCclose

closes any descriptors that got created by ICCopen. returns -1 on failure or 0 on success. clean exit, we love to see it. πŸ’…

⭐ ICCsettimeout

you can call this before any of the following routines to decide how long the library should wait before giving up on getting the server's reply. it does this by setting and catching a SIGALRM signal(2). 😭

  • if the timeout is less than zero, then no reply will be waited for.
  • the SC_SHUTDOWN, SC_XABORT, and SC_XEXEC commands don't get a reply either.
  • the default β€” which you can get by setting the timeout to <0> β€” is to wait during 2 minutes. ⏳

πŸ”₯ ICCcommand

sends the command cmd with parameters argv to the server. it returns -1 on error.

if the server replies, and replyp is not NULL, it gets filled in with an allocated buffer containing the full text of the server's reply. that buffer is a string in the form of digits text, where digits is the text value of the recommended exit code (usually 1, followed with text, giving the reason of the failure); a 0 value indicates success. 🫢

heads up: replies longer than 64KB will be truncated. tragic but true. πŸ’€

the possible values of cmd are defined in the inn/inndcomm.h header file, and also up there in the SYNOPSIS. the parameters for each command are described in ctlinnd(8).

this routine returns -1 on communication failure, or the exit status sent by the server β€” which will never be negative. slay. ✨

🧚 ICCcancel

sends a "cancel" message to the server. its msgid argument is the Message-ID of the article that should be cancelled. return value is the same as for ICCcommand. πŸ—‘οΈ

🌸 ICCpause, ICCreserve, and ICCgo

these three send a "pause", "reserve", or "go" command to the server, respectively.

okay so here's the tea on the pairing rules β˜•:

  • if ICCreserve is used, then the why value used in the ICCpause invocation must match.
  • the value used in the ICCgo invocation must always match the one used in the ICCpause invocation.

like, they're matching outfits. you can't mix and match. πŸ‘―β€β™€οΈ

the return value for all three routines is the same as for ICCcommand.


πŸ’€ when things go wrong

if any routine described above fails, the ICCfailure variable will identify the system call that failed. so at least you get to know who ghosted you. 😭


πŸ‘‘ HISTORY πŸ‘‘

Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. Rewritten into POD by Julien Elie. legends, both of them. 🫢


🌈 SEE ALSO 🌈


and that's the whole page bestie!! go forth and send some control commands πŸ’–βœ¨

πŸ“ this has been INN 2.7.4, dated 2022-07-10, from the libinn_inndcomm(3) corner of the universe. mwah πŸ’‹
πŸ“¦ where this page comes from
  • arch rolling: inn 2.7.4-4 Β· ISC
  • epel 10: inn-devel 2.7.4-5.el10_3 Β· ISC AND BSD-3-Clause AND BSD-4-Clause AND FSFAP AND (GPL-1.0-or-later OR Artistic-1.0-Perl) AND GPL-3.0-or-later WITH Bison-exception-2.2 AND LicenseRef-Fedora-Public-Domain AND MIT AND NTP
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms