+static void inetd_connection(int what)
+{
+ COMSTACK line;
+ IOCHAN chan;
+ association *assoc;
+ char *addr;
+
+ if (!(line = cs_createbysocket(0, tcpip_type, 0, what)))
+ {
+ logf(LOG_ERRNO|LOG_FATAL, "Failed to create comstack on socket 0");
+ exit(1);
+ }
+ if (!(chan = iochan_create(cs_fileno(line), ir_session, EVENT_INPUT)))
+ {
+ logf(LOG_FATAL, "Failed to create iochan");
+ exit(1);
+ }
+ if (!(assoc = create_association(chan, line)))
+ {
+ logf(LOG_FATAL, "Failed to create association structure");
+ exit(1);
+ }
+ iochan_setdata(chan, assoc);
+ iochan_settimeout(chan, control_block.idle_timeout * 60);
+ addr = cs_addrstr(line);
+ logf(LOG_LOG, "Inetd association from %s", addr ? addr : "[UNKNOWN]");
+}
+