.\" ISC - networking library .\" Copyright (C) 1991-1992, 1999 by Peter Eriksson and Per Cederqvist of the .\" Lysator Academic Computer Association. .\" .\" .\" 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. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; if not, write to the Free Software .\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. .\" .\" .\" @(#)isc.3x 1.0 (Lysator) 2/3/92 .\" .TH ISC 3X "February 3, 1992" "Release 1.0" "ISC LIBRARY" .SH NAME isc_initialize, isc_shutdown, isc_listentcp, isc_unlisten, isc_opentcp, isc_openfile, isc_openfd, isc_close, isc_enable, isc_disable, isc_sessions, isc_getnextevent, isc_dispose, isc_flush, isc_write, isc_putc, isc_printf, isc_allocmsg, isc_reallocmsg, isc_freemsg, isc_mkstrmsg, isc_setmaxmsgsize, isc_setallocfn, isc_setlogfn, isc_setabortfn \- server-client subroutines .SH SYNOPSIS .LP .B "#include " .LP .nf .B IscMaster * .B " isc_initialize (IscConfig *cfg)" .PP .B void .B " isc_shutdown(IscMaster *mcb)" .PP .B int .B " isc_listentcp(IscMaster *mcb, const char *service);" .PP .B void .B " isc_unlisten(IscMaster *mcb, int listen_return_val);" .PP .B "IscSession *" .B " isc_opentcp(IscMaster *mcb, const char *host, const char *service)" .PP .B "IscSession *" .B " isc_openfile(IscMaster *mcb, const char *path, int mode)" .PP .B "IscSession *" .B " isc_openfd(IscMaster *mcb, int fd)" .PP .B "void" .B " isc_close (IscSession *scb)" .PP .B "int" .B " isc_sessions (IscMaster *mcb)" .PP .B "IscEvent *" .B " isc_getnextevent (IscMaster *mcb, long timeout)" .PP .B "void" .B " isc_dispose (IscEvent *ecb)" .PP .B "void" .B " isc_flush (IscSession *scb)" .PP .B "int" .B " isc_write (IscSession *scb, const void *buf, size_t len)" .PP .B "int" .B " isc_printf (IscSession *scb, const char *format, ...)" .PP .B "int" .B " isc_putc (int chr, IscSession *scb)" .PP .B "IscMessage *" .B " isc_allocmsg(size_t size);" .PP .B "IscMessage *" .B " isc_reallocmsg(IscMessage *msg, size_t size);" .PP .B "void" .B " isc_freemsg(IscMessage *msg);" .PP .B "IscMessage *" .B " isc_mkstrmsg(const char *str);" .PP .B "void" .B " isc_setmaxmsgsize (IscMaster *mcb, size_t size)" .PP .B "void" .B " isc_setlogfn (void (*logfnp)(const char *fmt, va_list AP))" .PP .B "void" .B " isc_setallocfn (void * (*mallocfn)(size_t size)," .B " void * (*reallocfn)(void *buf, size_t size)," .B " void (*freefn)(void *buf))" .PP .B "void" .B " isc_setabortfn (void (*abortfn)(const char *msg))" .SH TYPES .nf .B "typedef struct" .B "{" .B " int version; /* Current version is 2 */" .B " struct" .B " {" .B " int msgsize; /* -1 = use defaults */" .B " int queuedsize; /* -1 = use defaults */" .B " int dequeuelen; /* -1 = use defaults */" .B " } max;" .B " struct" .B " {" .B " unsigned inhibit_dns_lookup : 1; /* Do not map IP number -> name */" .B " unsigned late_connect : 1; /* Do non-blocking connect()s */" .B " }" .B "}" .PP .B typedef enum .B { .B " ISC_EVENT_ERROR," .B " ISC_EVENT_TIMEOUT," .B " ISC_EVENT_LOGIN," .B " ISC_EVENT_LOGOUT," .B " ISC_EVENT_MESSAGE," .B "} IscEventType;" .PP .B typedef enum .B { .B " ISC_TYPE_UNKNOWN," .B " ISC_TYPE_TCP," .B " ISC_TYPE_FILE" .B "} IscSessionType;" .PP .B "typedef enum" .B "{" .B " ISC_STATE_UNKNOWN," .B " ISC_STATE_CONNECTING," .B " ISC_STATE_RUNNING," .B " ISC_STATE_DISABLED," .B " ISC_STATE_CLOSING" .B "} IscSessionState;" .PP .B typedef struct isc_msg .B { .B " int size;" .B " int length;" .B " char *buffer;" .B } IscMessage; .PP .B typedef struct isc_mcb .B { .B " int port;" .B " int fd;" .B " int maxmsgsize;" .B " int maxqueuedsize;" .B " int maxdequeuelen;" .B " struct isc_scb *sessions;" .B } IscMaster; .PP .B typedef struct isc_scb .B { .B " struct isc_scb * prev;" .B " struct isc_scb * next;" .B " IscMaster * mcb;" .B " IscSessionType type;" .B " IscSessionState state;" .B " int fd; .B " IscMsgQueue * rd_msg_q;" .B " IscMsgQueue * wr_msg_q;" .B " char sendbuf[2048];" .B " int sendindex;" .B " union" .B " {" .B " struct" .B " {" .B " char * hostname;" .B " int rport;" .B " int lport;" .B " } tcp;" .B " struct" .B " {" .B " char * pathname;" .B " int openmode;" .B " } file;" .B " } info;" .B " time_t logintime;" .B " time_t idlesince;" .B " struct" .B " {" .B " struct" .B " {" .B " long bytes;" .B " long packets;" .B " } rx, tx;" .B " } stats;" .B "" .B " ISC_UDGTYPE * udg; /* Reserved for user defined usage */" .B "} IscSession;" .PP .B typedef struct isc_ecb .B { .B " IscEventType event;" .B " IscSession * session;" .B " IscMessage * msg;" .B } IscEvent; .SH DESCRIPTION These functions implement an interface to the TCP/IP streams facitiliy. The functions are obtained with the loader option .BR \-lisc . (More to come here...) .PP .SH DIAGNOSTICS (And here... :\-) .PP .SH BUGS Hehe... I'm sure they exists... .SH GUILTY Peter Eriksson & Per Cederqvist ISC is Copyright (c) 1991 Lysator Computer Club, Linkoping University, Sweden, in cooperation with the International Syndicate of Computation. All rights reserved.