CTR Pia  4.11.3
Game Communication Engine
transport_definitions.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: transport_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 
18 #include <pia/result.h>
19 #include <pia/common/common_RootObject.h>
20 #include <pia/common/common_ErrorHandler.h>
21 
22 #define NN_PIA_TRANSPORT_V3 1 // Transport for Pia 3.
23 
24 #define NN_PIA_EXPERIMENT_PROTOCOL_FILTERING 1 // n1769 Filter <tt>ProtocolMessages</tt> received from suspect stations.
25 
26 // For Pia library developers.
27 #define NN_PIA_TRANSPORT_ENABLE_DETAILED_TRACE 0
28 #define NN_PIA_EXPERIMENT_RELAY 0 // Set to <tt>1</tt> to enable the code for the relay feature.
29 #define NN_PIA_EXPERIMENT_RELIABLE_DETAIL_INFO 0 // n1769 For testing. For measuring the performance of reliable communication.
30 #define NN_PIA_FEEDBACK_USE_COMPRESSION_CRYPTO 1 // Apply both compression and encryption.
31 #if NN_PIA_EXPERIMENT_MONITORING
32 #define NN_PIA_EXPERIMENT_BANDWIDTH_ESTIMATION 0 // n1769 Turns on the bandwidth estimation feature.
33 #else
34 #define NN_PIA_EXPERIMENT_BANDWIDTH_ESTIMATION 0 // n1769 Turns off the bandwidth estimation feature.
35 #endif
36 #define NN_PIA_EXPERIMENT_SEND_DOUBLE_DUMMY 0 // n1769
37 
38 #define NN_PIA_EXPERIMENT_LATENCY_EMULATION_ERROR_HANDLING 1 // n1769 <tt>1</tt> if you are not going to ignore the error result from the transmission functions when using latency emulation.
39 
40 #define NN_PIA_EXPERIMENT_PACKET_CHECK_SOURCE_INDEX 1
41 
42 //n1589:test:off
43 #define NN_PIA_ENABLE_STATISTIC_THREAD_STREAM_BLOCK_TIME 0
44 
45 // The macro related to optimization for use by Pia library developers. For each, promise that 0 is the traditional technique.
46 #define NN_PIA_OPTIMIZE_NO_PACKET_CONTAINER 0 //n1769
47 #define NN_PIA_OPTIMIZE_USE_RESERVABLE_RINGBUF 1 //n1769
48 #define NN_PIA_OPTIMIZE_MOVE_FROM_RELIABLE_IMPROVEMENT 1 //n1769
49 #define NN_PIA_OPTIMIZE_USE_RESERVATION_IN_UNRELIABLE_PROTOCOL 1 //n1769
50 #define NN_PIA_OPTIMIZE_USE_RESERVATION_IN_RELIABLE_PROTOCOL 1 //n1769
51 
52 //n1589: The normal definitions are from here down.
53 namespace nn
54 {
55 namespace pia
56 {
57 namespace transport
58 {
59 
60 // Protocol processing executes in the order of this value.
61 // Assign a small value to protocols to execute with higher priority.
62 static const u16 PROTOCOL_TYPE_RELAY = 0x0080;
63 static const u16 PROTOCOL_TYPE_KEEP_ALIVE = 0x00c0;
64 static const u16 PROTOCOL_TYPE_STATION = 0x0100;
65 static const u16 PROTOCOL_TYPE_MESH = 0x0200;
66 static const u16 PROTOCOL_TYPE_SYNC_CLOCK = 0x0210;
67 static const u16 PROTOCOL_TYPE_NAT = 0x0400;
68 static const u16 PROTOCOL_TYPE_GATEWAY = 0x0410;
69 static const u16 PROTOCOL_TYPE_LANMATCHMAKE = 0x0420;
70 static const u16 PROTOCOL_TYPE_BANDWIDTH_CHECKER = 0x0500;
71 static const u16 PROTOCOL_TYPE_RTT = 0x0600;
72 static const u16 PROTOCOL_TYPE_SYNC_OLD = 0x1800;
73 static const u16 PROTOCOL_TYPE_SYNC = 0x1810;
74 static const u16 PROTOCOL_TYPE_UNRELIABLE = 0x2000;
75 static const u16 PROTOCOL_TYPE_ROUNDROBIN_UNRELIABLE = 0x2100;
76 static const u16 PROTOCOL_TYPE_CLONE = 0x2400;
77 static const u16 PROTOCOL_TYPE_VOICE = 0x2800;
78 static const u16 PROTOCOL_TYPE_RELIABLE = 0x3000;
79 static const u16 PROTOCOL_TYPE_RELIABLE_BROADCAST = 0x7000;
80 static const u16 PROTOCOL_TYPE_SESSION = 0x7200;
81 static const u16 PROTOCOL_TYPE_FEEDBACK = 0x8000;
82 static const u16 PROTOCOL_TYPE_RELAY_SERVICE = 0x8200;
83 }
84 }
85 } // end of namespace nn::pia::transport
86 
87 //n1589: The following header files are included for all classes in this module.
Definition: assert.h:115