1 /* Definitions for the nssel IO waiter.
2  *
3  * Copyright 2008-2012 Adiscon GmbH.
4  *
5  * This file is part of the rsyslog runtime library.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *       http://www.apache.org/licenses/LICENSE-2.0
12  *       -or-
13  *       see COPYING.ASL20 in the source distribution
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 #ifndef INCLUDED_NSSEL_H
23 #define INCLUDED_NSSEL_H
24 
25 #include "netstrms.h"
26 
27 /* the nssel object */
28 struct nssel_s {
29 	BEGINobjInstance;	/* Data to implement generic object - MUST be the first data element! */
30 	nsd_t *pDrvrData;	/**< the driver's data elements */
31 	uchar *pBaseDrvrName;	/**< nsd base driver name to use, or NULL if system default */
32 	uchar *pDrvrName;	/**< full base driver name (set when driver is loaded) */
33 	nsdsel_if_t Drvr;	/**< our stream driver */
34 };
35 
36 
37 /* interface */
38 BEGINinterface(nssel) /* name must also be changed in ENDinterface macro! */
39 	rsRetVal (*Construct)(nssel_t **ppThis);
40 	rsRetVal (*ConstructFinalize)(nssel_t *pThis);
41 	rsRetVal (*Destruct)(nssel_t **ppThis);
42 	rsRetVal (*Add)(nssel_t *pThis, netstrm_t *pStrm, nsdsel_waitOp_t waitOp);
43 	rsRetVal (*Wait)(nssel_t *pThis, int *pNumReady);
44 	rsRetVal (*IsReady)(nssel_t *pThis, netstrm_t *pStrm, nsdsel_waitOp_t waitOp, int *pbIsReady,
45 		int *piNumReady);
46 	/* v2 - 2013-09-17 by rgerhards */
47 	rsRetVal (*SetDrvrName)(nssel_t *pThis, uchar *name);
48 ENDinterface(nssel)
49 #define nsselCURR_IF_VERSION 2 /* increment whenever you change the interface structure! */
50 
51 /* prototypes */
52 PROTOTYPEObj(nssel);
53 
54 /* the name of our library binary */
55 #define LM_NSSEL_FILENAME LM_NETSTRMS_FILENAME
56 
57 #endif /* #ifndef INCLUDED_NSSEL_H */
58