SLikeNet 0.1.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NatTypeDetectionCommon.h
Go to the documentation of this file.
1 /*
2 * Original work: Copyright (c) 2014, Oculus VR, Inc.
3 * All rights reserved.
4 *
5 * This source code is licensed under the BSD-style license found in the
6 * RakNet License.txt file in the licenses directory of this source tree. An additional grant
7 * of patent rights can be found in the RakNet Patents.txt file in the same directory.
8 *
9 *
10 * Modified work: Copyright (c) 2017, SLikeSoft UG (haftungsbeschränkt)
11 *
12 * This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
13 * license found in the license.txt file in the root directory of this source tree.
14 */
15
20
21 #ifndef __NAT_TYPE_DETECTION_COMMON_H
22 #define __NAT_TYPE_DETECTION_COMMON_H
23
24 #include "NativeFeatureIncludes.h"
25
26 #if _RAKNET_SUPPORT_NatTypeDetectionServer==1 || _RAKNET_SUPPORT_NatTypeDetectionClient==1
27
28 #include "SocketIncludes.h"
29 #include "types.h"
30 #include "socket2.h"
31
32 namespace SLNet
33 {
34
36 enum NATTypeDetectionResult
37 {
39 NAT_TYPE_NONE,
41 NAT_TYPE_FULL_CONE,
43 NAT_TYPE_ADDRESS_RESTRICTED,
45 NAT_TYPE_PORT_RESTRICTED,
47 NAT_TYPE_SYMMETRIC,
49 NAT_TYPE_UNKNOWN,
51 NAT_TYPE_DETECTION_IN_PROGRESS,
53 NAT_TYPE_SUPPORTS_UPNP,
55 NAT_TYPE_COUNT
56 };
57
59 bool RAK_DLL_EXPORT CanConnect(NATTypeDetectionResult type1, NATTypeDetectionResult type2);
60
62 RAK_DLL_EXPORT const char * NATTypeDetectionResultToString(NATTypeDetectionResult type);
63
68 RAK_DLL_EXPORT const char * NATTypeDetectionResultToStringFriendly(NATTypeDetectionResult type);
69
71 RAK_DLL_EXPORT RakNetSocket2* CreateNonblockingBoundSocket(const char *bindAddr
72 #ifdef __native_client__
73 ,_PP_Instance_ chromeInstance
74 #endif
75 , RNS2EventHandler *eventHandler
76 );
77
79 //int NatTypeRecvFrom(char *data, RakNetSocket2* socket, SystemAddress &sender, RNS2EventHandler *eventHandler);
80 }
81
82 #endif // #if _RAKNET_SUPPORT_NatTypeDetectionServer==1 || _RAKNET_SUPPORT_NatTypeDetectionClient==1
83
84 #endif