API参考
载入中...
搜索中...
未找到
sal_net.h
1/*
2 * This file is part of the openHiTLS project.
3 *
4 * openHiTLS is licensed under the Mulan PSL v2.
5 * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 * You may obtain a copy of Mulan PSL v2 at:
7 *
8 * http://license.coscl.org.cn/MulanPSL2
9 *
10 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
11 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
12 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
13 * See the Mulan PSL v2 for more details.
14 */
15
16#ifndef SAL_NET_H
17#define SAL_NET_H
18
19#include "hitls_build.h"
20#ifdef HITLS_BSL_SAL_NET
21
22#include <stdint.h>
23#include <fcntl.h>
24#ifdef HITLS_BSL_SAL_LINUX
25#include <arpa/inet.h>
26#include <netinet/tcp.h>
27#endif
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33int32_t SAL_Write(int32_t fd, const void *buf, uint32_t len, int32_t *err);
34
35int32_t SAL_Read(int32_t fd, void *buf, uint32_t len, int32_t *err);
36
37int32_t SAL_Sendto(int32_t sock, const void *buf, size_t len, int32_t flags, void *address, int32_t addrLen,
38 int32_t *err);
39
40int32_t SAL_Recvfrom(int32_t sock, void *buf, size_t len, int32_t flags, void *address, int32_t *addrLen,
41 int32_t *err);
42
43int32_t SAL_SockAddrNew(BSL_SAL_SockAddr *sockAddr);
44int32_t SAL_SockAddrGetFamily(const BSL_SAL_SockAddr sockAddr);
45void SAL_SockAddrFree(BSL_SAL_SockAddr sockAddr);
46uint32_t SAL_SockAddrSize(const BSL_SAL_SockAddr sockAddr);
47void SAL_SockAddrCopy(BSL_SAL_SockAddr dst, BSL_SAL_SockAddr src);
48
49
50#ifdef __cplusplus
51}
52#endif /* __cplusplus */
53
54#endif /* HITLS_BSL_SAL_NET */
55
56#endif // SAL_NET_H