diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-04-18 18:29:02 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-04-18 18:29:02 +0200 |
commit | 2069ab114e2aac9c243aff72042912cac7ef6126 (patch) | |
tree | 19bd5df7fb640b754ec6b91954d0153ed0f2eac5 /runtime/nsd_ptcp.c | |
parent | 032b9c1f64691e868b14e6d271ebfc2d093b0c66 (diff) | |
download | rsyslog-2069ab114e2aac9c243aff72042912cac7ef6126.tar.gz rsyslog-2069ab114e2aac9c243aff72042912cac7ef6126.tar.xz rsyslog-2069ab114e2aac9c243aff72042912cac7ef6126.zip |
first working TLS-enabled plain TCP sender
implemented a first working version of a TLS-enabled plain TCP
sender (but, of course, the implementation is insecure as it is)
Diffstat (limited to 'runtime/nsd_ptcp.c')
-rw-r--r-- | runtime/nsd_ptcp.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/runtime/nsd_ptcp.c b/runtime/nsd_ptcp.c index 6f7dd04d..c9df8f8c 100644 --- a/runtime/nsd_ptcp.c +++ b/runtime/nsd_ptcp.c @@ -87,6 +87,26 @@ CODESTARTobjDestruct(nsd_ptcp) ENDobjDestruct(nsd_ptcp) +/* Provide access to the underlying OS socket. This is primarily + * useful for other drivers (like nsd_gtls) who utilize ourselfs + * for some of their functionality. -- rgerhards, 2008-04-18 + * TODO: what about the server socket structure? + */ +static rsRetVal +GetSock(nsd_t *pNsd, int *pSock) +{ + nsd_ptcp_t *pThis = (nsd_ptcp_t*) pNsd; + DEFiRet; + + ISOBJ_TYPE_assert((pThis), nsd_ptcp); + assert(pSock != NULL); + + *pSock = pThis->sock; + + RETiRet; +} + + /* abort a connection. This is meant to be called immediately * before the Destruct call. -- rgerhards, 2008-03-24 */ @@ -519,6 +539,7 @@ CODESTARTobjQueryInterface(nsd_ptcp) pIf->Construct = (rsRetVal(*)(nsd_t**)) nsd_ptcpConstruct; pIf->Destruct = (rsRetVal(*)(nsd_t**)) nsd_ptcpDestruct; pIf->Abort = Abort; + pIf->GetSock = GetSock; pIf->LstnInit = LstnInit; pIf->AcceptConnReq = AcceptConnReq; pIf->Rcv = Rcv; |