Syslog client. More...
#include <stdarg.h>
#include "syslog/syslog_client.h"
#include "syslog/syslog_client_misc.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL SYSLOG_TRACE_LEVEL |
Functions | |
error_t | syslogClientInit (SyslogClientContext *context) |
Syslog client initialization. More... | |
error_t | syslogClientBindToInterface (SyslogClientContext *context, NetInterface *interface) |
Bind the Syslog client to a particular network interface. More... | |
error_t | syslogClientConnect (SyslogClientContext *context, const IpAddr *serverIpAddr, uint16_t serverPort) |
Specify the address of the Syslog server. More... | |
error_t | syslogClientSendMessage (SyslogClientContext *context, uint_t facility, uint_t severity, const char_t *message) |
Send Syslog message. More... | |
error_t | syslogClientFormatMessage (SyslogClientContext *context, uint_t facility, uint_t severity, const char_t *format,...) |
Format Syslog message. More... | |
error_t | syslogClientClose (SyslogClientContext *context) |
Close the connection with the Syslog server. More... | |
void | syslogClientDeinit (SyslogClientContext *context) |
Release Syslog client context. More... | |
Detailed Description
Syslog client.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Description
The Syslog protocol is used to convey event notification messages. It provides a message format that allows vendor-specific extensions to be provided in a structured way. Refer to RFC 3164 for more details
- Version
- 2.4.4
Definition in file syslog_client.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL SYSLOG_TRACE_LEVEL |
Definition at line 38 of file syslog_client.c.
Function Documentation
◆ syslogClientBindToInterface()
error_t syslogClientBindToInterface | ( | SyslogClientContext * | context, |
NetInterface * | interface | ||
) |
Bind the Syslog client to a particular network interface.
- Parameters
-
[in] context Pointer to the Syslog client context [in] interface Network interface to be used
- Returns
- Error code
Definition at line 86 of file syslog_client.c.
◆ syslogClientClose()
error_t syslogClientClose | ( | SyslogClientContext * | context | ) |
Close the connection with the Syslog server.
- Parameters
-
[in] context Pointer to the Syslog client context
- Returns
- Error code
Definition at line 308 of file syslog_client.c.
◆ syslogClientConnect()
error_t syslogClientConnect | ( | SyslogClientContext * | context, |
const IpAddr * | serverIpAddr, | ||
uint16_t | serverPort | ||
) |
Specify the address of the Syslog server.
- Parameters
-
[in] context Pointer to the Syslog client context [in] serverIpAddr IP address of the Syslog server to connect to [in] serverPort UDP port number
- Returns
- Error code
Definition at line 109 of file syslog_client.c.
◆ syslogClientDeinit()
void syslogClientDeinit | ( | SyslogClientContext * | context | ) |
Release Syslog client context.
- Parameters
-
[in] context Pointer to the Syslog client context
Definition at line 331 of file syslog_client.c.
◆ syslogClientFormatMessage()
error_t syslogClientFormatMessage | ( | SyslogClientContext * | context, |
uint_t | facility, | ||
uint_t | severity, | ||
const char_t * | format, | ||
... | |||
) |
Format Syslog message.
- Parameters
-
[in] context Pointer to the Syslog client context [in] facility Facility value [in] severity Severity value [in] format NULL-terminated string that that contains a format string [in] ... Optional arguments
- Returns
- Error code
Definition at line 241 of file syslog_client.c.
◆ syslogClientInit()
error_t syslogClientInit | ( | SyslogClientContext * | context | ) |
Syslog client initialization.
- Parameters
-
[in] context Pointer to the Syslog client context
- Returns
- Error code
Definition at line 56 of file syslog_client.c.
◆ syslogClientSendMessage()
error_t syslogClientSendMessage | ( | SyslogClientContext * | context, |
uint_t | facility, | ||
uint_t | severity, | ||
const char_t * | message | ||
) |
Send Syslog message.
- Parameters
-
[in] context Pointer to the Syslog client context [in] facility Facility value [in] severity Severity value [in] message NULL-terminated string that holds the message
- Returns
- Error code
Definition at line 168 of file syslog_client.c.