| 1 |
/* Definitions for the stream-based netstrm sworking class. |
| 2 |
* |
| 3 |
* Copyright 2007-2026 Rainer Gerhards and Adiscon GmbH. |
| 4 |
* |
| 5 |
* This file is part of the rsyslog runtime library. |
| 6 |
* |
| 7 |
* The rsyslog runtime library is free software: you can redistribute it and/or modify |
| 8 |
* it under the terms of the GNU Lesser General Public License as published by |
| 9 |
* the Free Software Foundation, either version 3 of the License, or |
| 10 |
* (at your option) any later version. |
| 11 |
* |
| 12 |
* The rsyslog runtime library is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
* GNU Lesser General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU Lesser General Public License |
| 18 |
* along with the rsyslog runtime library. If not, see <http://www.gnu.org/licenses/>. |
| 19 |
* |
| 20 |
* A copy of the GPL can be found in the file "COPYING" in this distribution. |
| 21 |
* A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution. |
| 22 |
*/ |
| 23 |
|
| 24 |
#ifndef INCLUDED_NETSTRMS_H |
| 25 |
#define INCLUDED_NETSTRMS_H |
| 26 |
|
| 27 |
#include "nsd.h" /* we need our driver interface to be defined */ |
| 28 |
|
| 29 |
/* the netstrms object */ |
| 30 |
struct netstrms_s { |
| 31 |
BEGINobjInstance |
| 32 |
; /* Data to implement generic object - MUST be the first data element! */ |
| 33 |
uchar *pBaseDrvrName; /**< nsd base driver name to use, or NULL if system default */ |
| 34 |
uchar *pDrvrName; /**< full base driver name (set when driver is loaded) */ |
| 35 |
int iDrvrMode; /**< current default driver mode */ |
| 36 |
uchar *pszDrvrAuthMode; /**< current driver authentication mode */ |
| 37 |
int DrvrChkExtendedKeyUsage; /**< if true, verify extended key usage in certs */ |
| 38 |
int DrvrPrioritizeSan; /**< if true, perform stricter checking of names in certs */ |
| 39 |
int DrvrVerifyDepth; /**< Verify Depth for certificate chains */ |
| 40 |
int DrvrTlsRevocationCheck; /**< Enable TLS revocation checking (OCSP/CRL) */ |
| 41 |
uchar *pszDrvrPermitExpiredCerts; |
| 42 |
const uchar *pszDrvrCAFile; |
| 43 |
const uchar *pszDrvrCRLFile; |
| 44 |
const uchar *pszDrvrKeyFile; |
| 45 |
const uchar *pszDrvrCertFile; |
| 46 |
uchar *gnutlsPriorityString; /**< priorityString for connection */ |
| 47 |
uchar *remoteSNI; /**< Remote SNI to use instead of the server hostname */ |
| 48 |
int iSynBacklog; /**< socket layer syn backlog for listen() */ |
| 49 |
permittedPeers_t *pPermPeers; /**< current driver's permitted peers */ |
| 50 |
rsRetVal (*fLstnInitDrvr)(netstrm_t *); /**< "late" driver-specific lstn init function NULL if none */ |
| 51 |
|
| 52 |
nsd_if_t Drvr; /**< our stream driver */ |
| 53 |
}; |
| 54 |
|
| 55 |
|
| 56 |
/* interface */ |
| 57 |
BEGINinterface(netstrms) /* name must also be changed in ENDinterface macro! */ |
| 58 |
rsRetVal (*Construct)(netstrms_t **ppThis); |
| 59 |
rsRetVal (*ConstructFinalize)(netstrms_t *pThis); |
| 60 |
rsRetVal (*Destruct)(netstrms_t **ppThis); |
| 61 |
rsRetVal (*CreateStrm)(netstrms_t *pThis, netstrm_t **ppStrm); |
| 62 |
rsRetVal (*SetDrvrName)(netstrms_t *pThis, uchar *pszName); |
| 63 |
rsRetVal (*SetDrvrMode)(netstrms_t *pThis, int iMode); |
| 64 |
rsRetVal (*SetDrvrAuthMode)(netstrms_t *pThis, uchar *); |
| 65 |
rsRetVal (*SetDrvrPermitExpiredCerts)(netstrms_t *pThis, uchar *); |
| 66 |
rsRetVal (*SetDrvrPermPeers)(netstrms_t *pThis, permittedPeers_t *); |
| 67 |
int (*GetDrvrMode)(netstrms_t *pThis); |
| 68 |
uchar *(*GetDrvrAuthMode)(netstrms_t *pThis); |
| 69 |
uchar *(*GetDrvrPermitExpiredCerts)(netstrms_t *pThis); |
| 70 |
permittedPeers_t *(*GetDrvrPermPeers)(netstrms_t *pThis); |
| 71 |
rsRetVal (*SetDrvrGnutlsPriorityString)(netstrms_t *pThis, uchar *); |
| 72 |
uchar *(*GetDrvrGnutlsPriorityString)(netstrms_t *pThis); |
| 73 |
rsRetVal (*SetDrvrCheckExtendedKeyUsage)(netstrms_t *pThis, int ChkExtendedKeyUsage); |
| 74 |
int (*GetDrvrCheckExtendedKeyUsage)(netstrms_t *pThis); |
| 75 |
rsRetVal (*SetDrvrPrioritizeSAN)(netstrms_t *pThis, int prioritizeSan); |
| 76 |
int (*GetDrvrPrioritizeSAN)(netstrms_t *pThis); |
| 77 |
rsRetVal (*SetDrvrTlsVerifyDepth)(netstrms_t *pThis, int verifyDepth); |
| 78 |
rsRetVal (*SetDrvrTlsRevocationCheck)(netstrms_t *pThis, int enabled); |
| 79 |
int (*GetDrvrTlsVerifyDepth)(netstrms_t *pThis); |
| 80 |
int (*GetDrvrTlsRevocationCheck)(netstrms_t *pThis); |
| 81 |
rsRetVal (*SetDrvrRemoteSNI)(netstrms_t *pThis, uchar *); |
| 82 |
uchar *(*GetDrvrRemoteSNI)(netstrms_t *pThis); |
| 83 |
/* v2 */ |
| 84 |
rsRetVal (*SetDrvrTlsCAFile)(netstrms_t *pThis, const uchar *); |
| 85 |
const uchar *(*GetDrvrTlsCAFile)(netstrms_t *pThis); |
| 86 |
rsRetVal (*SetDrvrTlsKeyFile)(netstrms_t *pThis, const uchar *); |
| 87 |
const uchar *(*GetDrvrTlsKeyFile)(netstrms_t *pThis); |
| 88 |
rsRetVal (*SetDrvrTlsCertFile)(netstrms_t *pThis, const uchar *); |
| 89 |
const uchar *(*GetDrvrTlsCertFile)(netstrms_t *pThis); |
| 90 |
/* v3 */ |
| 91 |
rsRetVal (*SetDrvrTlsCRLFile)(netstrms_t *pThis, const uchar *); |
| 92 |
const uchar *(*GetDrvrTlsCRLFile)(netstrms_t *pThis); |
| 93 |
|
| 94 |
/* v4 */ |
| 95 |
rsRetVal (*SetSynBacklog)(netstrms_t *pThis, const int); |
| 96 |
|
| 97 |
ENDinterface(netstrms) |
| 98 |
#define netstrmsCURR_IF_VERSION 5 /* increment whenever you change the interface structure! */ |
| 99 |
|
| 100 |
/* prototypes */ |
| 101 |
PROTOTYPEObjFull(netstrms); |
| 102 |
|
| 103 |
/* the name of our library binary */ |
| 104 |
#define LM_NETSTRMS_FILENAME "lmnetstrms" |
| 105 |
|
| 106 |
#endif /* #ifndef INCLUDED_NETSTRMS_H */ |