3 * This are the definitions for the TCP based clients class.
5 * File begun on 2007-07-21 by RGerhards (extracted from syslogd.c)
7 * Copyright 2007, 2008 Rainer Gerhards and Adiscon GmbH.
9 * This file is part of rsyslog.
11 * Rsyslog is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
16 * Rsyslog is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with Rsyslog. If not, see <http://www.gnu.org/licenses/>.
24 * A copy of the GPL can be found in the file "COPYING" in this distribution.
26 #ifndef TCPCLT_H_INCLUDED
27 #define TCPCLT_H_INCLUDED 1
29 #include "tcpsyslog.h"
32 /* the tcpclt object */
33 typedef struct tcpclt_s {
34 BEGINobjInstance; /**< Data to implement generic object - MUST be the first data element! */
35 TCPFRAMINGMODE tcp_framing;
38 /* session specific callbacks */
39 rsRetVal (*initFunc)(void*);
40 rsRetVal (*sendFunc)(void*, char*, size_t);
41 rsRetVal (*prepRetryFunc)(void*);
46 BEGINinterface(tcpclt) /* name must also be changed in ENDinterface macro! */
47 rsRetVal (*Construct)(tcpclt_t **ppThis);
48 rsRetVal (*ConstructFinalize)(tcpclt_t __attribute__((unused)) *pThis);
49 rsRetVal (*Destruct)(tcpclt_t **ppThis);
50 int (*Send)(tcpclt_t *pThis, void*pData, char*msg, size_t len);
51 int (*CreateSocket)(struct addrinfo *addrDest);
53 rsRetVal (*SetSendInit)(tcpclt_t*, rsRetVal (*)(void*));
54 rsRetVal (*SetSendFrame)(tcpclt_t*, rsRetVal (*)(void*, char*, size_t));
55 rsRetVal (*SetSendPrepRetry)(tcpclt_t*, rsRetVal (*)(void*));
56 rsRetVal (*SetFraming)(tcpclt_t*, TCPFRAMINGMODE framing);
58 #define tcpcltCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */
64 /* the name of our library binary */
65 #define LM_TCPCLT_FILENAME "lmtcpclt"
67 #endif /* #ifndef TCPCLT_H_INCLUDED */