summaryrefslogtreecommitdiffstats
path: root/tcpsrv.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-05-22 17:06:52 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-05-22 17:06:52 +0200
commitaba90e82484118f3568ec51c01de5ba845da589a (patch)
treedee21fce32d09af5ab80ccbad8c51772e7645dd8 /tcpsrv.h
parent2aca3c2d33dd1a19daf44168e90a5f64bd4095b0 (diff)
downloadrsyslog-aba90e82484118f3568ec51c01de5ba845da589a.tar.gz
rsyslog-aba90e82484118f3568ec51c01de5ba845da589a.tar.xz
rsyslog-aba90e82484118f3568ec51c01de5ba845da589a.zip
added capability to run multiple tcp listeners (on different ports)
Well, actually this and a lot of related things. I improved the testbench so that the new capabilities are automatically tested and also did some general cleanup. The current multiple tcp listener solution will probably receive some further cleanup, too, but looks quite OK so far. I also reviewed the way tcpsrv et all work, in preparation of using this code for imdiag. I need to document the findings, especially as the code is rather complicated "thanks" to the combination of plain tcp and gssapi transport modes.
Diffstat (limited to 'tcpsrv.h')
-rw-r--r--tcpsrv.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/tcpsrv.h b/tcpsrv.h
index e5ecb865..0f7dd6c6 100644
--- a/tcpsrv.h
+++ b/tcpsrv.h
@@ -32,6 +32,15 @@ typedef enum ETCPsyslogFramingAnomaly {
frame_CiscoIOS = 2
} eTCPsyslogFramingAnomaly;
+
+/* list of tcp listen ports */
+struct tcpLstnPortList_s {
+ uchar *pszPort; /**< the ports the listener shall listen on */
+ uchar *pszInputName; /**< value to be used as input name */
+ tcpsrv_t *pSrv; /**< pointer to higher-level server instance */
+ tcpLstnPortList_t *pNext; /**< next port or NULL */
+};
+
#define TCPSRV_NO_ADDTL_DELIMITER -1 /* specifies that no additional delimiter is to be used in TCP framing */
/* the tcpsrv object */
@@ -44,8 +53,9 @@ struct tcpsrv_s {
permittedPeers_t *pPermPeers;/**< driver's permitted peers */
int iLstnMax; /**< max nbr of listeners currently supported */
netstrm_t **ppLstn; /**< our netstream listners */
+ tcpLstnPortList_t **ppLstnPort; /**< pointer to relevant listen port description */
int iSessMax; /**< max number of sessions supported */
- char *TCPLstnPort; /**< the port the listener shall listen on */
+ tcpLstnPortList_t *pLstnPorts; /**< head pointer for listen ports */
int addtlFrameDelim; /**< additional frame delimiter for plain TCP syslog framing (e.g. to handle NetScreen) */
tcps_sess_t **pSessions;/**< array of all of our sessions */
void *pUsr; /**< a user-settable pointer (provides extensibility for "derived classes")*/
@@ -70,8 +80,8 @@ BEGINinterface(tcpsrv) /* name must also be changed in ENDinterface macro! */
rsRetVal (*Construct)(tcpsrv_t **ppThis);
rsRetVal (*ConstructFinalize)(tcpsrv_t __attribute__((unused)) *pThis);
rsRetVal (*Destruct)(tcpsrv_t **ppThis);
- void (*configureTCPListen)(tcpsrv_t*, char *cOptarg);
- rsRetVal (*SessAccept)(tcpsrv_t *pThis, tcps_sess_t **ppSess, netstrm_t *pStrm);
+ rsRetVal (*configureTCPListen)(tcpsrv_t*, uchar *pszPort);
+ //rsRetVal (*SessAccept)(tcpsrv_t *pThis, tcpLstnPortList_t*, tcps_sess_t **ppSess, netstrm_t *pStrm);
rsRetVal (*create_tcp_socket)(tcpsrv_t *pThis);
rsRetVal (*Run)(tcpsrv_t *pThis);
/* set methods */