home *** CD-ROM | disk | FTP | other *** search
- /*
- * (c) Copyright 1992 by Panagiotis Tsirigotis
- * All rights reserved. The file named COPYRIGHT specifies the terms
- * and conditions for redistribution.
- */
-
- #ifndef INT_H
- #define INT_H
-
- /*
- * $Id: int.h,v 5.1 1992/10/31 23:59:07 panos Exp $
- */
-
- #include <sys/types.h>
- #include <netinet/in.h>
-
- #include "fsma.h"
- #include "pset.h"
-
- #include "server.h"
-
- struct intercept_stream
- {
- unsigned accepted_channels ;
- } ;
-
-
- struct intercept_dgram
- {
- unsigned received_packets ;
- } ;
-
-
- typedef enum { GOOD_CHANNEL, BAD_CHANNEL } channel_state_e ;
-
- struct channel
- {
- channel_state_e state ;
- struct sockaddr_in from ;
- int local_socket ;
- int remote_socket ;
- } ;
-
- typedef struct channel channel_s ;
-
- #define CHP( p ) ((struct channel *)(p))
-
- channel_s *int_lookupconn() ;
- channel_s *int_newconn() ;
-
-
- struct intercept_common
- {
- bool_int intercept ;
- int remote_socket ;
- struct sockaddr_in local_addr ;
- pset_h connections ;
- fsma_h channel_allocator ;
- struct server server ;
- } ;
-
-
- struct intercept_ops
- {
- void (*mux)() ;
- void (*exit)() ;
- } ;
-
-
- struct intercept
- {
- int socket_type ;
- struct intercept_common common ;
- void *priv ;
- struct intercept_ops *ops ;
- } ;
-
- #define INT_TYPE( p ) ((p)->socket_type)
- #define INT_SERVER( p ) (&(p)->common.server)
- #define INT_LOCALADDR( p ) (&(p)->common.local_addr)
- #define INT_REMOTE( p ) ((p)->common.remote_socket)
- #define INT_ALLOCATOR( p ) ((p)->common.channel_allocator)
- #define INT_CONNECTIONS( p ) ((p)->common.connections)
- #define INTERCEPT( p ) ((p)->common.intercept)
-
- void int_fail() ;
- int int_select() ;
- void int_exit() ;
- void int_init() ;
- channel_s *int_newconn() ;
- channel_s *int_lookupconn() ;
-
- #endif /* INT_H */
-