Amazon Kinesis Webrtc C SDK
 
Loading...
Searching...
No Matches
Network.h
Go to the documentation of this file.
1/*******************************************
2HostInfo internal include file
3*******************************************/
4#ifndef __KINESIS_VIDEO_WEBRTC_CLIENT_NETWORK__
5#define __KINESIS_VIDEO_WEBRTC_CLIENT_NETWORK__
6
7#pragma once
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13#define MAX_LOCAL_NETWORK_INTERFACE_COUNT 128
14
15// string buffer size for ipv4 and ipv6. Null terminator included.
16// for ipv6: 0000:0000:0000:0000:0000:0000:0000:0000 = 39
17// for ipv4 mapped ipv6: 0000:0000:0000:0000:0000:ffff:192.168.100.228 = 45
18#define KVS_IP_ADDRESS_STRING_BUFFER_LEN 46
19
20// 000.000.000.000
21#define KVS_MAX_IPV4_ADDRESS_STRING_LEN 15
22
23#define KVS_GET_IP_ADDRESS_PORT(a) ((UINT16) getInt16((a)->port))
24
25#if defined(__MACH__)
26#define NO_SIGNAL_SOCK_OPT SO_NOSIGPIPE
27#define NO_SIGNAL_SEND 0
28#else
29#define NO_SIGNAL_SEND MSG_NOSIGNAL
30#endif
31
32// Some systems, such as Windows, do not have this value
33#ifndef EAI_SYSTEM
34#define EAI_SYSTEM -11
35#endif
36
37// Windows uses EWOULDBLOCK (WSAEWOULDBLOCK) to indicate connection attempt
38// cannot be completed immediately, whereas POSIX uses EINPROGRESS.
39#ifdef _WIN32
40#define KVS_SOCKET_IN_PROGRESS EWOULDBLOCK
41#else
42#define KVS_SOCKET_IN_PROGRESS EINPROGRESS
43#endif
44
50
62
63#if defined(HAVE_SOCKETPAIR)
69STATUS createSocketPair(INT32 (*)[2]);
70#endif
71
81
87STATUS closeSocket(INT32);
88
95STATUS socketBind(PKvsIpAddress, INT32);
96
103STATUS socketConnect(PKvsIpAddress, INT32);
104
112STATUS socketWrite(INT32, const void*, SIZE_T);
113
122
132BOOL isIpAddr(PCHAR, UINT16);
133
134STATUS getIpAddrStr(PKvsIpAddress, PCHAR, UINT32);
135
137
141INT32 getErrorCode(VOID);
142
148PCHAR getErrorString(INT32);
149
150#ifdef _WIN32
151#define POLL WSAPoll
152#else
153#define POLL poll
154#endif
155
156#ifdef __cplusplus
157}
158#endif
159#endif /* __KINESIS_VIDEO_WEBRTC_CLIENT_NETWORK__ */
KVS_IP_FAMILY_TYPE
Definition Include_i.h:99
STATUS getIpWithHostName(PCHAR, PDualKvsIpAddresses)
Definition Network.c:488
STATUS getLocalhostIpAddresses(PKvsIpAddress, PUINT32, IceSetInterfaceFilterFunc, UINT64)
Definition Network.c:7
STATUS socketBind(PKvsIpAddress, INT32)
Definition Network.c:237
INT32 getErrorCode(VOID)
Definition Network.c:700
STATUS closeSocket(INT32)
Definition Network.c:222
KVS_SOCKET_PROTOCOL
Definition Network.h:45
@ KVS_SOCKET_PROTOCOL_TCP
Definition Network.h:47
@ KVS_SOCKET_PROTOCOL_NONE
Definition Network.h:46
@ KVS_SOCKET_PROTOCOL_UDP
Definition Network.h:48
STATUS getIpAddrStr(PKvsIpAddress, PCHAR, UINT32)
Definition Network.c:632
STATUS createSocket(KVS_IP_FAMILY_TYPE, KVS_SOCKET_PROTOCOL, UINT32, PINT32)
Definition Network.c:167
STATUS socketConnect(PKvsIpAddress, INT32)
Definition Network.c:288
STATUS socketWrite(INT32, const void *, SIZE_T)
Definition Network.c:323
PCHAR getErrorString(INT32)
Definition Network.c:735
BOOL isIpAddr(PCHAR, UINT16)
Definition Network.c:337
BOOL isSameIpAddress(PKvsIpAddress, PKvsIpAddress, BOOL)
Definition Network.c:659
BOOL(* IceSetInterfaceFilterFunc)(UINT64, PCHAR)
IceSetInterfaceFilterFunc is fired when a callback function to filter network interfaces is assigned....
Definition Include.h:1098
Definition Include_i.h:113
Definition Include_i.h:105