#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <errno.h>
#include <stddef.h>
Go to the source code of this file.
Defines | |
#define | XDMAPI |
#define | XDMEXP |
#define | socket_t int |
#define | closesocket close |
#define | INVALID_SOCKET -1 |
#define | WSAECONNRESET ECONNRESET |
#define | WSAGetLastError() errno |
#define | CNF_SECURE "xdasd.loggers.netstream.secure" |
#define | CNF_SERVER "xdasd.loggers.netstream.server" |
#define | CNF_PORT "xdasd.loggers.netstream.port" |
#define | XDM_DEF_SRVSTR "localhost" |
#define | XDM_DEF_PORTSTR "1468" |
Functions | |
static void | ns_disconnect (void) |
Disconnects from the server, resets global connection variables. | |
static int | ns_connect (const char *host, const char *service) |
Connects to the server. | |
static int | ns_write (const char *msg, size_t msgsz) |
Write specified message to either ssl or tcp socket. | |
XDMEXP int XDMAPI | xdm_append (const char **msgflds) |
XDM module append routine. | |
XDMEXP void XDMAPI | xdm_exit (void) |
XDM module exit routine. | |
XDMEXP int XDMAPI | xdm_init (void(*logmsg)(int level, const char *msg,...), char *(*getcnfstr)(const char *, char *, size_t *)) |
XDM module initialization routine. | |
Variables | |
static void(* | s_fplogmsg )(int level, const char *msg,...)=0 |
A pointer to the xdasd logmsg function. | |
static char *(* | s_fpgetcnfstr )(const char *, char *, size_t *)=0 |
A pointer to the xdasd get_conf_string function. | |
static socket_t | s_skt = INVALID_SOCKET |
The module static server connection socket, server and port strings. | |
static char | s_srvstr [512] |
static char | s_portstr [32] |
The netstream logger logs messages to a network socket. Server, port, and SSL configuration parameters are specified in the xdasd configuration file.
Definition in file xdm_netstream.c.