SELKIELogger  1.0.0
LoggerNet.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 Swansea University
3  *
4  * This file is part of the SELKIELogger suite of tools.
5  *
6  * SELKIELogger is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the Free
8  * Software Foundation, either version 3 of the License, or (at your option)
9  * any later version.
10  *
11  * SELKIELogger is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this SELKIELogger product.
18  * If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef SL_LOGGER_NET_H
22 #define SL_LOGGER_NET_H
23 
24 #include <errno.h>
25 #include <stdlib.h>
26 #include <string.h>
27 #include <unistd.h>
28 
29 #include "SELKIELoggerBase.h"
30 
32 
43 typedef struct {
44  char *sourceName;
45  uint8_t sourceNum;
46  char *addr;
47  int port;
48  int handle;
49  int minBytes;
50  int maxBytes;
51  int timeout;
52 } net_params;
53 
55 void *net_setup(void *ptargs);
56 
58 void *net_logging(void *ptargs);
59 
61 void *net_shutdown(void *ptargs);
62 
64 void *net_channels(void *ptargs);
65 
67 bool net_connect(void *ptargs);
68 
71 
74 
77 
79 #endif
bool net_parseConfig(log_thread_args_t *lta, config_section *s)
Take a configuration section and parse parameters.
Definition: LoggerNet.c:306
void * net_logging(void *ptargs)
Network source main logging loop.
Definition: LoggerNet.c:66
device_callbacks net_getCallbacks(void)
Fill out device callback functions for logging.
Definition: LoggerNet.c:236
void * net_channels(void *ptargs)
Channel map.
Definition: LoggerNet.c:263
void * net_shutdown(void *ptargs)
Network source shutdown.
Definition: LoggerNet.c:147
net_params net_getParams(void)
Fill out default MP source parameters.
Definition: LoggerNet.c:247
void * net_setup(void *ptargs)
Device thread setup.
Definition: LoggerNet.c:41
bool net_connect(void *ptargs)
Network connection helper function.
Definition: LoggerNet.c:176
Configuration file section.
Definition: LoggerConfig.h:54
Device specific function information.
Definition: Logger.h.in:72
Logging thread information.
Definition: Logger.h.in:86
Network device specific parameters.
Definition: LoggerNet.h:43
uint8_t sourceNum
Source ID for messages.
Definition: LoggerNet.h:45
char * addr
Target name.
Definition: LoggerNet.h:46
int minBytes
Minimum number of bytes to group into a message.
Definition: LoggerNet.h:49
int handle
Handle for currently opened device.
Definition: LoggerNet.h:48
char * sourceName
User defined name for this source.
Definition: LoggerNet.h:44
int maxBytes
Maximum number of bytes to group into a message.
Definition: LoggerNet.h:50
int port
Target port number.
Definition: LoggerNet.h:47
int timeout
Reconnect if no data received after this interval [s].
Definition: LoggerNet.h:51