NAME

catnet - TCP/IP network I/O handler

DESCRIPTION

The catnet I/O handler provides a standard environment for the implementation of TCP/IP proxy filters. The typedef CATSOCK maps to the file descriptor used for socket programming in the different environments, that is, typedef int CATSOCK on UNIX and typedef SOCKET CATSOCK on Windows NT.

This module is divided into two groups of functions: catnet_* and catsock_*. catnet are truly TCP/IP-specific functions, while catsock are functions that handle data events for multiple sessions. The reason they are grouped with the TCP/IP functions is that they operate only on sessions where the client and server descriptors are TCP/IP channels. The purpose of this limitation is to make the code portable to as many platforms as possible.

FUNCTION OVERVIEW

catnet_accept
Accept an incoming connection on a listening socket in a session, and create a new session with the new socket.

catnet_connect
Create a connection to the specified destination and map the given fd_ids to that channel.

catnet_getfd
Retrieve the ``real'' sockets from the CAT symbolic socket names.

catnet_getnetinfo
Retrieve network information, such as hostnames and ports, for a given socket.

catnet_iohandler
Return the I/O handler for TCP/IP. The I/O handler is installed by calling cat_installiohandler().

catnet_listen
Set the CAT_CLIENT_RFD descriptor of a session to a listening state, listening for connections to a port.

catnet_listener
Block and wait for connections to all the ports specified in the argument.

catnet_setfd
Register a socket descriptor with the I/O handler, to be used as one or more of the I/O channels for a session.

catnet_settimeout
Set the network idle timeout for connections in a session.

catsock_add
Add a session to be handled by the framework. The framework will listen on any sockets registered as listening sockets for the session.

catsock_disablefds
Disable a file descriptor. The framework will not shuffle any data that is available on a disabled fd.

catsock_enablefds
Start shuffling data on a given file descriptor.

catsock_run
Run the sessions.

catsock_modes
Return the modes that may be used when running a session with catsock_run, after adding the session using catsock_add.

catsock_fromstring
Parse a string representing an open socket passed between processes. catd uses the string representation of an open socket when starting Agents.

catsock_parent
Register a callback function to be called by the framework when data is available from the parent, catd.

SEE ALSO

cat

catnet_accept, catnet_connect, catnet_getfd, catnet_getnetinfo, catsock_parent catnet_iohandler, catnet_listen, catnet_listener, catnet_setfd, catnet_settimeout, catsock_add, catsock_disablefds, catsock_enablefds, catsock_run, catsock_modes, catsock_fromstring