CTR Pia  4.11.3
Game Communication Engine
inet_definitions.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: inet_definitions.h
4 
5  Copyright Nintendo. All rights reserved.
6 
7  These coded instructions, statements, and computer programs contain
8  proprietary information of Nintendo of America Inc. and/or Nintendo
9  Company Ltd., and are protected by Federal copyright law. They may
10  not be disclosed to third parties or copied or duplicated in any form,
11  in whole or in part, without the prior written consent of Nintendo.
12  *---------------------------------------------------------------------------*/
13 
14 
15 #pragma once
16 
17 #include <pia/common.h>
18 
19 //n1872: NEX version information.
20 #if NN_PIA_NEX_3
21 #include <OnlineCore/src/version/nex_version.h>
22 #else
23 #include <version/nex_version.h>
24 #endif
25 
26 #define NEX_VERSION_NUMBER(major, minor, micro) (((major) << 16) | ((minor) << 8) | ((micro) << 0))
27 #define NEX_CURRENT_VERSION_NUMBER NEX_VERSION_NUMBER(NEX_VERSION_MAJOR, NEX_VERSION_MINOR, NEX_VERSION_MICRO)
28 
29 //n1589: Performs NAT property specification on the NEX side.
30 //n1589: If disabled, the NAT check is performed when the first matchmaking is started rather than when logging in, so that no time is wasted while waiting when just logging in.
31 #if NN_PIA_NEX_3
32 #define NN_PIA_ENABLE_NEX_NAT_PROPERTY_DETECTION 0
33 #else
34 //n1589: The NEX 2 series had no feature to send NAT property statistical information, so NAT properties had to be specified when logging in with NEX. This is not a problem as long as this information can be sent with the client monitoring feature.
35 #define NN_PIA_ENABLE_NEX_NAT_PROPERTY_DETECTION 0
36 #endif
37 
38 //n1589: Incrementation of the EDM port is fixed to 1. (A value other than 1 is never encountered.)
39 #define NN_PIA_ENABLE_EDM_PORT_INCREMENT_FIX 1
40 
41 #define NN_PIA_ENABLE_NEX_NAT_PATCH 0
42 
43 //n1872: Internally use the Pia list class.
44 #define NN_PIA_ENABLE_PIA_OBJLIST 1
45 
46 //n1872: If the session host uses an EIM router and clients use an EDM, a process is executed to find the success rate of NAT traversal (starting from NEX 3.4.4).
47 #if NN_PIA_WIN
48 #define NN_PIA_ENABLE_EDM_EIM_MASTER 0
49 #else // CTR, CAFE
50 #if (NEX_CURRENT_VERSION_NUMBER >= NEX_VERSION_NUMBER(3, 4, 4))
51 #define NN_PIA_ENABLE_EDM_EIM_MASTER 1
52 #else
53 #define NN_PIA_ENABLE_EDM_EIM_MASTER 0
54 #endif // (NEX_CURRENT_VERSION_NUMBER >= NEX_VERSION_NUMBER(3,4,4))
55 #endif // NN_PIA_WIN
56 
57 //n1872: Makes responses using NEX RMC unnecessary (starting from NEX 3.0.0).
58 #if (NEX_CURRENT_VERSION_NUMBER >= NEX_VERSION_NUMBER(3, 0, 0))
59 #define NN_PIA_ENABLE_NEX_RMC_ONEWAY 1
60 #else
61 #define NN_PIA_ENABLE_NEX_RMC_ONEWAY 0
62 #endif
63 
64 #define NN_PIA_ENABLE_FEEDBACK_WITHOUT_GATEWAY 0
65 
66 //n1872: Ignores packets from the NAT server in the stream after P2P communication starts.
67 #define NN_PIA_ENABLE_IGNORE_NAT_SERVER_ADDRESS 1
68 
69 //n1872: NAT Resolves the DNS for the check server in the background.
70 #define NN_PIA_ENABLE_ASYNCRONOUS_DNS_RESOLUTION 1
71 
72 //n1872: NAT Resolves the DNS for the check server without using NEX.
73 #define NN_PIA_ENABLE_RESOLVE_NAT_CHECK_SERVER 1
74 
75 #if (NEX_CURRENT_VERSION_NUMBER >= NEX_VERSION_NUMBER(3, 6, 0))
76 #define NN_PIA_ENABLE_LOOSE_COUPLING_NEX 1
77 #else
78 #define NN_PIA_ENABLE_LOOSE_COUPLING_NEX 0
79 #endif
80 
81 #define NN_PIA_EXPERIMENT_GET_LOCAL_URL 1
82 
83 #define NN_PIA_EXPERIMENT_FORCED_HAIR_PIN 0
84 
85 //n1872: Handles the situation when a different port is mapped with EIM.
86 #define NN_PIA_EXPERIMENT_EIM_DIFFERENT_PORT_MAPPING 1
87 
88 #define NN_PIA_EXPERIMENT_EDM_CHECK_TARGET_LOCATION_EXPIRED 0
89 
90 #define NN_PIA_EXPERIMENT_EDM_PORT_SPRAY 1
91 
92 #define NN_PIA_EXPERIMENT_RETRY_NAT_TRAVERSAL 1
93 
94 #define NN_PIA_EXPERIMENT_CHECK_PROBE_RECEIVED 1
95 
96 #define NN_PIA_EXPERIMENT_CONFIRM_PROBE_ADDRESS 0
97 
98 #if (NEX_CURRENT_VERSION_NUMBER >= NEX_VERSION_NUMBER(3, 8, 0))
99 //n1589: Adds support for the <tt>nex::NgsFacade</tt> interface.
100 #define NN_PIA_ENABLE_NGS_BRIDGE 1
101 #define NN_PIA_ENABLE_MATCHMAKE_SESSION_PASSWORD_ENABLED 1
102 #define NN_PIA_EXPERIMENT_LAST_GID_OPTION 1
103 #else
104 #define NN_PIA_ENABLE_NGS_BRIDGE 0
105 #define NN_PIA_ENABLE_MATCHMAKE_SESSION_PASSWORD_ENABLED 0
106 #define NN_PIA_EXPERIMENT_LAST_GID_OPTION 0
107 #endif
108 
109 #define NN_PIA_EXPERIMENT_CHECK_JOINED_UNKNOWN_SESSION 0
110 
111 //n1589: The normal definitions are from here down.
112 namespace nn
113 {
114 namespace pia
115 {
116 namespace inet
117 {
118 
119 #if NN_PIA_ENABLE_EACH_NAT_TRAVERSAL_TIMEOUT
120 const s32 NAT_TRAVERSAL_TIMEOUT_DEFAULT = (5 * 1000);
121 const s32 NAT_TRAVERSAL_TIMEOUT_EDM_EXTENSION = 1500;
122 #else
123 const s32 NAT_TRAVERSAL_TIMEOUT_DEFAULT = (8 * 1000);
124 const s32 NAT_TRAVERSAL_TIMEOUT_EDM_EXTENSION = 1500;
125 #endif
126 
127 const u32 NEX_INFINITE = 0xFFFFFFFF;
128 const u32 NEX_CONNECTION_ID_INVALID = 0;
129 
130 //n1589: Used in place of <tt>nn::nex::ConnectionID</tt>.
131 typedef u32 ServerConnectionId;
132 
133 const u16 FEEDBACK_DESTINATION_PORT = 50034;
134 }
135 }
136 } // end of namespace nn::pia::inet
137 
138 //n1589: The following header files are included for all classes in this module.
139 #include <pia/common/common_InetAddress.h>
140 #include <pia/common/common_StationAddress.h>
141 #include <pia/transport/transport_Protocol.h>
142 #include <pia/transport/transport_StationLocation.h>
143 #include <pia/transport/transport_StationLocationContainer.h>
144 #include <pia/transport/transport_StationConnectionInfo.h>
145 #include <pia/inet/inet_Api.h>
Definition: assert.h:115