Hazelnet 3.0.0
Reference implementation of the CAN Bus Security (CBS) protocol
hzl_ServerOs.h
Go to the documentation of this file.
1/*
2 * Copyright © 2020-2022, Matjaž Guštin <dev@matjaz.it>
3 * <https://matjaz.it>. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 * 3. Neither the name of nor the names of its contributors may be used to
14 * endorse or promote products derived from this software without specific
15 * prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS “AS IS”
18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
43#ifndef HZL_SERVER_OS_H_
44#define HZL_SERVER_OS_H_
45
46#ifdef __cplusplus
47extern "C"
48{
49#endif
50
51#include "hzl.h"
52#include "hzl_Server.h"
53
54#if HZL_OS_AVAILABLE
55
97 const char* fileName);
98
112HZL_API void
114
129
143HZL_API void
145
146#endif /* HZL_OS_AVAILABLE */
147
148#ifdef __cplusplus
149}
150#endif
151
152#endif /* HZL_SERVER_OS_H_ */
General public definitions used used by both the Hazelnet Server and Client.
#define HZL_API
Identifier of the public library API functions.
Definition: hzl.h:122
enum hzl_Err hzl_Err_t
Hazelnet error code, returned by all API functions.
Hazelnet Server public API.
HZL_API hzl_Err_t hzl_ServerNew(hzl_ServerCtx_t **pCtx, const char *fileName)
Allocates a new context structure on the heap and fills it with the new configuration from the file a...
HZL_API void hzl_ServerFreeMsg(hzl_CbsPduMsg_t **pMsg)
Zeros-out the message, frees it and sets the pointer to it to NULL, to avoid use-after-free and doubl...
HZL_API void hzl_ServerFree(hzl_ServerCtx_t **pCtx)
Zeros-out the context, frees it and sets the pointer to it to NULL, to avoid use-after-free and doubl...
HZL_API hzl_Err_t hzl_ServerNewMsg(hzl_CbsPduMsg_t **pMsg)
Allocates a new CAN FD message structure on the heap with enough space to hold up to 64 B of data.
Packed CBS PDU (Protocol Data Unit message) ready to be transmitted by the library user.
Definition: hzl.h:512
Configuration and status of the HazelNet Server library.
Definition: hzl_Server.h:307