Commit dc9291c3 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(isc_msgqueue): Forward declaration removed.

(isc_session_cfg): Ditto.
(isc_scb_entry): Ditto.
(struct isc_scb): Moved a lot of fields to struct isc_scb_internal
	in intern.h.
(struct isc_mcb): Moved to intern.h.
(isc_getoopsource): New function.
parent 1cbe056a
......@@ -36,6 +36,47 @@
#define ISC_DEFAULT_MAX_OPEN_RETRIES 10
#define ISC_DEFAULT_MAX_BACKLOG 50
/*
** The Master Control Block
*/
struct isc_mcb
{
struct isc_session_cfg * scfg;
struct isc_scb_entry * sessions;
oop_source * event_source;
};
/*
** The Client Control Block
*/
struct isc_scb_internal
{
struct isc_scb pub;
int nlinks; /* FIXME (bug 1071): Get rid of this field. */
enum isc_session_state state;
struct isc_msgqueue *wr_msg_q;
struct isc_session_cfg * cfg;
/* Cheap transmit buffer */
/* Should be dynamically allocated - into an struct isc_msg */
char sendbuf[2048];
int sendindex;
isc_accept_callback *accept_cb;
isc_write_error_cb *write_err_cb;
oop_call_fd *data_available_callback;
void *data_available_user;
int data_available_registered;
int write_cb_registered;
};
/*
** Generic message type
*/
......@@ -98,7 +139,7 @@ struct isc_scb_entry
struct isc_scb_entry * prev;
struct isc_scb_entry * next;
struct isc_scb * scb;
struct isc_scb_internal * scb;
};
/* isc_abort.c */
......@@ -140,31 +181,32 @@ isc_popqueue(struct isc_msgqueue *queue);
extern void
isc_oflush(struct isc_scb * scb);
isc_oflush(struct isc_scb_internal * scb);
/* isc_session.c */
extern struct isc_scb *
extern struct isc_scb_internal *
isc_create(struct isc_mcb *mcb,
struct isc_session_cfg *cfg,
enum isc_session_state initial_state);
extern int
isc_insert(struct isc_mcb *mcb, struct isc_scb *scb);
isc_insert(struct isc_mcb *mcb, struct isc_scb_internal *scb);
extern int
isc_remove(struct isc_mcb *mcb, struct isc_scb *scb);
isc_remove(struct isc_mcb *mcb, struct isc_scb_internal *scb);
/* isc_tcp.c */
extern struct isc_scb *
extern struct isc_scb_internal *
isc_createtcp(struct isc_mcb *mcb,
struct isc_session_cfg *cfg,
int fd,
enum isc_session_state initial_state);
extern int
isc_bindtcp(struct isc_scb *scb, const char *address, const char *port);
isc_bindtcp(struct isc_scb_internal *scb,
const char *address, const char *port);
/* isc_message.c. */
/*
......@@ -195,13 +237,13 @@ extern int
isc_relocate_fd(int fd, int limit);
extern void
isc_check_read_callback(struct isc_scb *session);
isc_check_read_callback(struct isc_scb_internal *session);
extern void
isc_cancel_read_callback(struct isc_scb *session);
isc_cancel_read_callback(struct isc_scb_internal *session);
extern void
isc_cancel_write_callback(struct isc_scb *session);
isc_cancel_write_callback(struct isc_scb_internal *session);
#define ISC_XNEW(var) (var = isc_malloc(sizeof(*var)))
......
......@@ -37,9 +37,6 @@
#endif
/* Forward declarations. */
struct isc_msgqueue;
struct isc_session_cfg;
struct isc_scb_entry;
struct isc_mcb;
struct isc_scb;
......@@ -75,50 +72,18 @@ enum isc_session_state
union isc_address;
struct isc_scb
{
int nlinks;
enum isc_session_state state;
int fd;
struct isc_msgqueue *wr_msg_q;
struct isc_session_cfg * cfg;
union isc_address *raddr;
union isc_address *laddr;
/* Cheap transmit buffer */
/* Should be dynamically allocated - into an struct isc_msg */
char sendbuf[2048];
int sendindex;
ISC_UDGTYPE * udg; /* User defined garbage :-) */
struct isc_mcb *master;
isc_accept_callback *accept_cb;
isc_write_error_cb *write_err_cb;
oop_call_fd *data_available_callback;
void *data_available_user;
int data_available_registered;
int write_cb_registered;
};
/*
** The Master Control Block
*/
struct isc_mcb
{
struct isc_session_cfg * scfg;
struct isc_scb_entry * sessions;
oop_source * event_source;
};
/*
** Setup a set of functions to handle memory allocation
*/
......@@ -275,4 +240,7 @@ isc_gethostname(union isc_address *ia,
extern int
isc_getportnum(union isc_address *ia);
extern oop_source *
isc_getoopsource(struct isc_scb *scb);
#endif /* __ISC_H__ */
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