Commit 1855ad84 authored by Per Cederqvist's avatar Per Cederqvist

Initial revision

parent 28b3433a
extern IscMaster *
isc_initialize(IscMasterConfig * cfg);
extern void
isc_shutdown(IscMaster * mcb);
extern int
isc_destroy(IscMaster * mcb, IscSession * scb);
extern int
isc_sessions(IscMaster * mcb);
extern IscEvent *
isc_getnextevent(IscMaster * mcb,
long timeout);
extern void
isc_dispose(IscEvent * ecb);
extern void
isc_flush(IscSession * scb);
extern int
isc_send(IscSession * scb, IscMessage * mcb);
extern int
isc_write(IscSession * scb,
const void * buffer,
size_t length);
extern int
isc_putc(int chr,
IscSession * scb);
extern int
isc_printf(IscSession * scb,
const char * format,
...);
extern int
isc_vprintf(IscSession * scb,
const char * format,
va_list AP);
extern IscMessage *
isc_allocmsg(size_t size);
extern IscMessage *
isc_reallocmsg(IscMessage * msg,
size_t size);
extern IscMessage *
isc_copymsg(IscMessage *msg);
extern void
isc_freemsg(IscMessage * msg);
extern IscMessage *
isc_mkstrmsg(const char * str);
extern IscSession *
isc_create(IscSessionConfig *cfg, IscHandler *fun);
extern int
isc_enable(IscSession *scb);
extern int
isc_disable(IscSession *scb);
extern int
isc_insert(IscMaster *mcb, IscSession *scb);
extern int
isc_remove(IscMaster *mcb, IscSession *scb);
extern IscSession *
isc_openfd(IscMaster * mcb,
int fd);
extern void
isc_close(IscSession * scb);
extern IscSession *
isc_openfile(IscMaster * mcb,
const char * pathname,
int openmode);
extern IscSession *
isc_createtcp(IscSessionConfig *cfg);
extern int
isc_bindtcp(IscSession *scb, const char *address, const char *port);
extern int
isc_connecttcp(IscSession *scb, const char *address, const char *port);
extern IscSession *
isc_opentcp(IscMaster * mcb,
const char * address,
const char * service);
extern IscSession *
isc_listentcp(IscMaster * mcb,
const char * address,
const char * service);
extern IscSession *
isc_createudp(IscSessionConfig *cfg);
extern int
isc_bindudp(IscSession *scb, const char *address, const char *port);
extern int
isc_connectudp(IscSession *scb, const char *address, const char *port);
extern IscSession *
isc_listenudp(IscMaster * mcb,
const char * address,
const char * service);
extern IscSession *
isc_openudp(IscMaster * mcb,
const char * address,
const char * service);
extern IscAddress *
isc_getladdress(IscSession *scb);
extern IscAddress *
isc_getraddress(IscSession *scb);
extern void
isc_freeaddress(IscAddress *addr);
extern IscAddress *
isc_copyaddress(IscAddress *addr);
extern char *
isc_getipnum(IscAddress *ia,
char *address,
int len);
extern char *
isc_gethostname(IscAddress *ia,
char *address,
int len);
extern int
isc_getportnum(IscAddress *ia);
extern char *
isc_getservice(IscAddress *sa,
char *buf,
int len,
IscSessionType type);
extern IscHandler *
isc_newhandler(void);
extern void
isc_freehandler(IscHandler *hcb);
extern IscHandler *
isc_copyhandler(IscHandler *hcb);
extern void
isc_pushhandler(IscSession *scb, IscHandler *hcb);
extern IscHandler *
isc_pophandler(IscSession *scb);
extern void
isc_setlogfn(void (*logfn)(const char * format, va_list AP));
extern void
isc_setallocfn(void * (*mallocfn)(size_t size),
void * (*reallocfn)(void * buf, size_t size),
void (*freefn)(void * buf));
extern void
isc_setabortfn(void (*abortfn)(const char * msg));
#define ISC_HCALLFUN1(HLIST,NAME,ARG) \
(*HLIST->old.NAME->hcb->NAME)(HLIST->old.NAME, ARG)
#define ISC_HCALLFUN2(HLIST,NAME,A1,A2) \
(*HLIST->old.NAME->hcb->NAME)(HLIST->old.NAME, A1, A2)
#define ISC_HCALLFUN3(HLIST,NAME,A1,A2,A3) \
(*HLIST->old.NAME->hcb->NAME)(HLIST->old.NAME, A1, A2, A3)
#
# Makefile - for Manual pages
#
INSTROOT=/usr/local
MANROOT=$(INSTROOT)/man
MANSECT=man3
MANDIR=$(MANROOT)/$(MANSECT)
#
FILES= isc.3x isc_initialize.3x isc_shutdown.3x isc_openfd.3x \
isc_openfile.3x isc_opentcp.3x isc_close.3x isc_listentcp.3x \
isc_unlisten.3x
#
install:
cp $(FILES) $(MANDIR)
clean:
rm -f *~ \#*\#
all:
@echo "Nothing done."
.\" @(#)XXXXXX.3x 1.0 92/02/13 Lysator
.\" Copyright (c) 1992 Peter Eriksson and Per Cederqvist of Lysator
.\"
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms are permitted provided
.\" that: (1) source distributions retain this entire copyright notice and
.\" comment, and (2) distributions including binaries display the following
.\" acknowledgement: ``This product includes software developed by
.\" Peter Eriksson and Per Cederqvist of Lysator'' in the
.\" documentation or other materials provided with the distribution and in
.\" all advertising materials mentioning features or use of this software.
.\" Neither the name of Lysator nor the names of its contributors may
.\" be used to endorse or promote products derived from this software without
.\" specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.TH XXXXXX 3X "13 February 1992" "Release 1.0" "ISC LIBRARY"
.SH NAME
XXXXXX \- close, remove and destroy an ISC session
.SH SYNOPSIS
.nf
.ft B
#include <isc.h>
.ft
.fi
.LP
.nf
.ft B
int XXXXXX(mcb, scb)
IscMaster *mcb;
IscSession *scb;
.ft R
.fi
.SH DESCRIPTION
.SH ARGUMENTS
The following arguments are passed to the function:
.TP 10
.I mcb
This argument must either point to a master control
structure or be a
.SM NULL
pointer.
.TP 10
.I scb
This argument must be pointer to a session control
structure.
.SH RETURN VALUES
This function returns:
.TP 10
0
on success,
.TP 10
\-1
on failure and sets
.B errno
to indicate the error.
.SH ERRORS
.TP 10
.SM ENOENT
The session specified did not exist in the master control block.
.SH SEE ALSO
.BR isc (3x)
.\" @(#)isc_close.3x 1.0 92/02/13 Lysator
.\" Copyright (c) 1992 Peter Eriksson and Per Cederqvist of Lysator
.\"
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms are permitted provided
.\" that: (1) source distributions retain this entire copyright notice and
.\" comment, and (2) distributions including binaries display the following
.\" acknowledgement: ``This product includes software developed by
.\" Peter Eriksson and Per Cederqvist of Lysator'' in the
.\" documentation or other materials provided with the distribution and in
.\" all advertising materials mentioning features or use of this software.
.\" Neither the name of Lysator nor the names of its contributors may
.\" be used to endorse or promote products derived from this software without
.\" specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.TH ISC_CLOSE 3X "13 February 1992" "Release 1.0" "ISC LIBRARY"
.SH NAME
isc_close \- close an ISC session
.SH SYNOPSIS
.nf
.ft B
#include <isc.h>
.ft
.fi
.LP
.nf
.ft B
void isc_close(mcb)
IscSession *scb;
.ft R
.fi
.SH DESCRIPTION
This function force the session to go into closing state.
You will receive the event
.SM ISC_EVENT_CLOSED
when all queued data has been read and/or sent. To force a close and
flush all queued data you should use the
.B isc_destroy(3x)
function directly.
.SH ARGUMENTS
The
.I scb
argument must be pointer to a session control structure.
.SH RETURN VALUES
Does not return any value.
.SH SEE ALSO
.BR isc (3x)
.\" @(#)isc_createtcp.3x 1.0 92/02/13 Lysator
.\" Copyright (c) 1992 Peter Eriksson and Per Cederqvist of Lysator
.\"
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms are permitted provided
.\" that: (1) source distributions retain this entire copyright notice and
.\" comment, and (2) distributions including binaries display the following
.\" acknowledgement: ``This product includes software developed by
.\" Peter Eriksson and Per Cederqvist of Lysator'' in the
.\" documentation or other materials provided with the distribution and in
.\" all advertising materials mentioning features or use of this software.
.\" Neither the name of Lysator nor the names of its contributors may
.\" be used to endorse or promote products derived from this software without
.\" specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.TH ISC_CREATETCP 3X "13 February 1992" "Release 1.0" "ISC LIBRARY"
.SH NAME
isc_createtcp \- create a TCP/IP session
.SH SYNOPSIS
.nf
.ft B
#include <isc.h>
.ft
.fi
.LP
.nf
.ft B
IscSession *isc_createtcp(cfg)
IscSessionConfig *scb;
.ft R
.fi
.SH DESCRIPTION
This function force the session to go into closing state.
You will receive the event
.SM ISC_EVENT_CLOSED
when all queued data has been read and/or sent. To force a close and
flush all queued data you should use the
.B isc_destroy(3x)
function directly.
.SH ARGUMENTS
The
.I scb
argument must be pointer to a session control structure.
.SH RETURN VALUES
Does not return any value.
.SH SEE ALSO
.BR isc (3x)
.\" @(#)isc_destroy.3x 1.0 92/02/13 Lysator
.\" Copyright (c) 1992 Peter Eriksson and Per Cederqvist of Lysator
.\"
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms are permitted provided
.\" that: (1) source distributions retain this entire copyright notice and
.\" comment, and (2) distributions including binaries display the following
.\" acknowledgement: ``This product includes software developed by
.\" Peter Eriksson and Per Cederqvist of Lysator'' in the
.\" documentation or other materials provided with the distribution and in
.\" all advertising materials mentioning features or use of this software.
.\" Neither the name of Lysator nor the names of its contributors may
.\" be used to endorse or promote products derived from this software without
.\" specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.TH ISC_DESTROY 3X "13 February 1992" "Release 1.0" "ISC LIBRARY"
.SH NAME
isc_destroy \- close, remove and destroy an ISC session
.SH SYNOPSIS
.nf
.ft B
#include <isc.h>
.ft
.fi
.LP
.nf
.ft B
int isc_destroy(mcb, scb)
IscMaster *mcb;
IscSession *scb;
.ft R
.fi
.SH DESCRIPTION
This function force the session to be closed, and all queued
data to be lost. It the deallocates the storage for the session
control structure. Also optionally removes the session from the
master control structure if the latter is specified.
.SH ARGUMENTS
The following arguments are passed to the function:
.TP 10
.I mcb
This argument must either point to a master control
structure or be a
.SM NULL
pointer.
.TP 10
.I scb
This argument must be pointer to a session control
structure.
.SH RETURN VALUES
This function returns:
.TP 10
0
on success,
.TP 10
\-1
on failure and sets
.B errno
to indicate the error.
.SH ERRORS
.TP 10
.SM ENOENT
The session specified did not exist in the master control block.
.SH SEE ALSO
.BR isc (3x)
.\" @(#)isc_listentcp.3x 1.0 92/02/13 Lysator
.\" Copyright (c) 1992 Peter Eriksson and Per Cederqvist of Lysator
.\"
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms are permitted provided
.\" that: (1) source distributions retain this entire copyright notice and
.\" comment, and (2) distributions including binaries display the following
.\" acknowledgement: ``This product includes software developed by
.\" Peter Eriksson and Per Cederqvist of Lysator'' in the
.\" documentation or other materials provided with the distribution and in
.\" all advertising materials mentioning features or use of this software.
.\" Neither the name of Lysator nor the names of its contributors may
.\" be used to endorse or promote products derived from this software without
.\" specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.TH ISC_LISTENTCP 3X "13 February 1992" "Release 1.0" "ISC LIBRARY"
.SH NAME
isc_listentcp \- listen on a TCP/IP port
.SH SYNOPSIS
.nf
.ft B
#include <isc.h>
.ft
.fi
.LP
.nf
.ft B
IscSession *isc_listentcp(mcb, address, service)
IscMaster *mcb;
const char *address;
const char *service;
.ft R
.fi
.SH DESCRIPTION
This function inserts a new TCP/IP
connection listening port into the master structure specified.
With this you can handle remote network connection attempts.
.SH ARGUMENTS
The following arguments are passed to the function:
.TP 10
.I mcb
This argument must point to a master control structure.
.TP 10
.I address
This argument should either point to a null terminated string
containing the local address to bind the session to, or be
.SM NULL
pointer which will bind the session to all local IP addresses.
.TP 10
.I service
This argument should point at a null terminated string containing
either a port number or a service name as specified in the
.BR /etc/services
file.
.SH RETURN VALUES.
This function returns a pointer to a session control structure
on success, else returns
.SM NULL
on failure and sets
.B errno
to indicate the error.
.SH ERRORS
(to be done)
.SH FILES
.PD 0
.TP 20
.B /etc/services
.PD
.SH SEE ALSO
.BR isc (3x)
.\" @(#)isc_openfd.3x 1.0 92/02/03 Lysator
.\" Copyright (c) 1992 Peter Eriksson and Per Cederqvist of Lysator
.\"
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms are permitted provided
.\" that: (1) source distributions retain this entire copyright notice and
.\" comment, and (2) distributions including binaries display the following
.\" acknowledgement: ``This product includes software developed by
.\" Peter Eriksson and Per Cederqvist of Lysator'' in the
.\" documentation or other materials provided with the distribution and in
.\" all advertising materials mentioning features or use of this software.
.\" Neither the name of Lysator nor the names of its contributors may
.\" be used to endorse or promote products derived from this software without
.\" specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.TH ISC_OPENFD 3X "3 February 1992" "Release 1.0" "ISC LIBRARY"
.SH NAME
isc_openfd \- associate a file descriptor with an ISC session
.SH SYNOPSIS
.nf
.ft B
#include <isc.h>
.ft
.fi
.LP
.nf
.ft B
IscSession *isc_openfd(IscMaster *mcb,
int fd)
.ft R
.fi
.SH DESCRIPTION
.IX "isc_openfd()" "" "\fLisc_openfd()\fP function"
.LP
.B isc_openfd(\|)
associates a previously opened file descriptor with a session and inserts
it into the master control structure.
.LP
The
.I mcb
argument must point to a previously allocated master structure as
returned by the
.BR isc_initialize(\|)
function call.
.LP
The
.I fd
argument must be a previously opened file descriptor.
.SH RETURN VALUES
.B isc_openfd(\|)
returns a non-\s-1NULL\s0 pointer to a
session value suitable for use with subsequent
.SM ISC
functions calls.
On failure, it returns
.SM NULL and
no memory is allocated and no connection is initiated.
.SH "SEE ALSO"
.BR isc (3x)
.BR isc_initialize (3x)
.BR isc_shutdown (3x)
.BR isc_listentcp (3x)
.BR isc_unlisten (3x)
.BR isc_opentcp (3x)
.BR isc_openfile (3x)
.BR isc_close (3x)
.BR isc_enable (3x)
.BR isc_disable (3x)
.BR isc_sessions (3x)
.BR isc_getnextevent (3x)
.BR isc_dispose (3x)
.BR isc_flush (3x)
.BR isc_write (3x)
.BR isc_putc (3x)
.BR isc_printf (3x)
.\" @(#)isc_openfile.3x 1.0 92/02/03 Lysator
.\" Copyright (c) 1992 Peter Eriksson and Per Cederqvist of Lysator
.\"
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms are permitted provided
.\" that: (1) source distributions retain this entire copyright notice and
.\" comment, and (2) distributions including binaries display the following
.\" acknowledgement: ``This product includes software developed by
.\" Peter Eriksson and Per Cederqvist of Lysator'' in the
.\" documentation or other materials provided with the distribution and in
.\" all advertising materials mentioning features or use of this software.
.\" Neither the name of Lysator nor the names of its contributors may
.\" be used to endorse or promote products derived from this software without
.\" specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.TH ISC_OPENFILE 3X "3 February 1992" "Release 1.0" "ISC LIBRARY"
.SH NAME
isc_openfile \- open a file and associate an ISC session with it
.SH SYNOPSIS
.nf
.ft B
#include <isc.h>
#include <fcntl.h>
.ft
.fi
.LP
.nf
.ft B
IscSession *isc_openfile(IscMaster *mcb,
const char *file,
int mode)
.ft R
.fi
.SH DESCRIPTION
.IX "isc_openfile()" "" "\fLisc_openfile()\fP function"
.LP
.B isc_openfile(\|)
opens a file using the specified modes and inserts the session into the
master control structure.
.LP
The
.I mcb
argument must point to a previously allocated master structure as
returned by the
.BR isc_initialize(\|)
function call.
.LP
The
.I file
argument is a null terminated string pointing at a file to be opened.
.LP
The
.I mode
argument contains the flags used for opening the file. The flags are
the sames as those used by the
.BR open (2v)
system call.
.SH RETURN VALUES
.B isc_openfile(\|)
returns a non-\s-1NULL\s0 pointer to a
session value suitable for use with subsequent
.SM ISC
functions calls.
On failure, it returns
.SM NULL and
no memory is allocated and no connection is initiated.
.SH "SEE ALSO"
.BR open (2v)
.BR isc (3x)
.BR isc_initialize (3x)
.BR isc_shutdown (3x)
.BR isc_listentcp (3x)
.BR isc_unlisten (3x)
.BR isc_opentcp (3x)
.BR isc_openfd (3x)
.BR isc_close (3x)
.BR isc_enable (3x)
.BR isc_disable (3x)
.BR isc_sessions (3x)
.BR isc_getnextevent (3x)
.BR isc_dispose (3x)
.BR isc_flush (3x)
.BR isc_write (3x)
.BR isc_putc (3x)
.BR isc_printf (3x)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment