diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-03-03 09:04:59 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-03-03 09:04:59 +0000 |
commit | 42730360196f1aaafaebb955c1a0a66a185e61ec (patch) | |
tree | a372aed0c06905d230ed383249028aa220417a1e /tcpsrv.h | |
parent | 9d8eb28ebd941694d8dcbc66c6e5c80cf90a206d (diff) | |
download | rsyslog-42730360196f1aaafaebb955c1a0a66a185e61ec.tar.gz rsyslog-42730360196f1aaafaebb955c1a0a66a185e61ec.tar.xz rsyslog-42730360196f1aaafaebb955c1a0a66a185e61ec.zip |
made imgssapi compile
Diffstat (limited to 'tcpsrv.h')
-rw-r--r-- | tcpsrv.h | 34 |
1 files changed, 24 insertions, 10 deletions
@@ -27,16 +27,24 @@ /* the tcpsrv object */ typedef struct tcpsrv_s { - BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */ - int *pSocksLstn; /* listen socket array for server [0] holds count */ - int iSessMax; /* max number of sessions supported */ + BEGINobjInstance; /**< Data to implement generic object - MUST be the first data element! */ + int *pSocksLstn; /**< listen socket array for server [0] holds count */ + int iSessMax; /**< max number of sessions supported */ + char *TCPLstnPort; /**< the port the listener shall listen on */ + tcps_sess_t **pSessions;/**< array of all of our sessions */ + void *pUsr; /**< a user-settable pointer (provides extensibility for "derived classes")*/ /* callbacks */ - int (*pIsPermittedHost)(struct sockaddr *addr, char *fromHostFQDN); - int (*pRcvData)(tcps_sess_t*, char*, size_t); + int (*pIsPermittedHost)(struct sockaddr *addr, char *fromHostFQDN, void*pUsrSrv, void*pUsrSess); + int (*pRcvData)(tcps_sess_t*, char*, size_t); + int* (*OpenLstnSocks)(struct tcpsrv_s*); rsRetVal (*pOnListenDeinit)(void*); - rsRetVal (*pOnSessAccept)(struct tcpsrv_s *, int fd); + rsRetVal (*OnDestruct)(void*); rsRetVal (*pOnRegularClose)(tcps_sess_t *pSess); rsRetVal (*pOnErrClose)(tcps_sess_t *pSess); + /* session specific callbacks */ + rsRetVal (*pOnSessAccept)(struct tcpsrv_s *, tcps_sess_t**, int fd); + rsRetVal (*OnSessConstructFinalize)(void*); + rsRetVal (*pOnSessDestruct)(void*); } tcpsrv_t; @@ -47,16 +55,22 @@ BEGINinterface(tcpsrv) /* name must also be changed in ENDinterface macro! */ rsRetVal (*ConstructFinalize)(tcpsrv_t __attribute__((unused)) *pThis); rsRetVal (*Destruct)(tcpsrv_t **ppThis); void (*configureTCPListen)(tcpsrv_t*, char *cOptarg); - //no longer needed? void (*configureTCPListenSessMax)(char *cOptarg); - int (*SessAccept)(tcpsrv_t *pThis, int fd); + int (*SessAccept)(tcpsrv_t *pThis, tcps_sess_t**ppSess, int fd); + int* (*create_tcp_socket)(tcpsrv_t *pThis); rsRetVal (*Run)(tcpsrv_t *pThis); /* set methods */ - rsRetVal (*SetCBIsPermittedHost)(tcpsrv_t*, int (*) (struct sockaddr *addr, char*)); + rsRetVal (*SetUsrP)(tcpsrv_t*, void*); + rsRetVal (*SetCBIsPermittedHost)(tcpsrv_t*, int (*) (struct sockaddr *addr, char*, void*, void*)); + rsRetVal (*SetCBOpenLstnSocks)(tcpsrv_t *, int* (*)(tcpsrv_t*)); rsRetVal (*SetCBRcvData)(tcpsrv_t *, int (*)(tcps_sess_t*, char*, size_t)); rsRetVal (*SetCBOnListenDeinit)(tcpsrv_t*, rsRetVal (*)(void*)); - rsRetVal (*SetCBOnSessAccept)(tcpsrv_t*, rsRetVal (*) (tcpsrv_t*,int)); + rsRetVal (*SetCBOnDestruct)(tcpsrv_t*, rsRetVal (*) (void*)); rsRetVal (*SetCBOnRegularClose)(tcpsrv_t*, rsRetVal (*) (tcps_sess_t*)); rsRetVal (*SetCBOnErrClose)(tcpsrv_t*, rsRetVal (*) (tcps_sess_t*)); + /* session specifics */ + rsRetVal (*SetCBOnSessAccept)(tcpsrv_t*, rsRetVal (*) (tcpsrv_t*, tcps_sess_t**, int)); + rsRetVal (*SetCBOnSessDestruct)(tcpsrv_t*, rsRetVal (*) (void*)); + rsRetVal (*SetCBOnSessConstructFinalize)(tcpsrv_t*, rsRetVal (*) (void*)); ENDinterface(tcpsrv) #define tcpsrvCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ |