1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     dlp_Server.h
4 
5   Copyright (C)2009 Nintendo Co., Ltd.  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 #ifndef NN_DLP_CTR_DLP_SERVER_H_
16 #define NN_DLP_CTR_DLP_SERVER_H_
17 
18 #include <nn/dlp/CTR/dlp_Type.h>
19 
20 #ifdef __cplusplus
21 
22 namespace nn {
23 namespace dlp {
24 namespace CTR {
25 
26 /*
27 
28  */
29 class Server
30 {
31 private:
Server()32     Server() {};
~Server()33     ~Server() {};
34 
35 public:
36     /*
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47      */
48         static size_t GetBufferSize(u8 maxClientNum, size_t blockBufferSize = MIN_NETWORK_BLOCK_BUFFER_SIZE * 2, size_t blockBufferNum = MIN_NETWORK_BLOCK_BUFFER_NUM);
49 
50 
51     /*
52 
53 
54 
55 
56 
57 
58 
59 
60 
61 
62 
63 
64 
65 
66 
67 
68 
69 
70 
71 
72 
73 
74 
75 
76 
77 
78 
79 
80     */
81         static nn::Result Initialize(
82                         nn::Handle eventHandle,
83                         u8 maxClientNum,
84                         u8 childIndex,
85                         void* pBuffer,
86                         size_t bufferSize,
87                         size_t blockBufferSize = MIN_NETWORK_BLOCK_BUFFER_SIZE * 2,
88                         size_t blockBufferNum = MIN_NETWORK_BLOCK_BUFFER_NUM);
89 
90 
91     /*
92 
93 
94 
95 
96 
97     */
98         static nn::Result Finalize();
99 
100 
101     /*
102 
103 
104 
105 
106 
107 
108 
109     */
110         static nn::Result GetState(ServerState* pState);
111 
112 
113     /*
114 
115 
116 
117 
118 
119 
120 
121 
122 
123 
124 
125 
126     */
127         static nn::Result GetEventDesc(EventDesc* pEventDesc);
128 
129 
130     /*
131 
132 
133 
134 
135 
136 
137 
138 
139 
140 
141 
142      */
143         static nn::Result OpenSessions(bool isManualAccept = false, u8 channel = 0);
144 
145 
146     /*
147 
148 
149 
150 
151 
152 
153 
154 
155 
156 
157 
158 
159 
160      */
161         static nn::Result AcceptClient(u16 nodeId);
162 
163 
164     /*
165 
166 
167 
168 
169 
170 
171 
172 
173 
174 
175 
176      */
177         static nn::Result DisconnectClient(u16 nodeId);
178 
179 
180     /*
181 
182 
183 
184 
185 
186 
187 
188 
189 
190 
191 
192 
193 
194     */
195         static nn::Result StartDistribute();
196 
197 
198     /*
199 
200 
201 
202 
203 
204 
205 
206 
207 
208 
209 
210 
211 
212      */
213         static nn::Result RebootAllClients(const char passpharase[] = NULL);
214 
215 
216     /*
217 
218 
219 
220 
221 
222     */
223         static nn::Result CloseSessions();
224 
225 
226     /*
227 
228 
229 
230 
231 
232 
233 
234 
235 
236 
237     */
238         static nn::Result GetConnectingClients(u16* pNum, u16 clients[], u16 size);
239 
240 
241     /*
242 
243 
244 
245 
246 
247 
248 
249 
250 
251 
252 
253     */
254         static nn::Result  GetClientInfo(
255                                 NodeInfo*       pClientInfo,
256                                 u16             nodeId);
257 
258 
259     /*
260 
261 
262 
263 
264 
265 
266 
267 
268 
269 
270     */
271         static nn::Result  GetClientState(
272                                 ClientState*     pClientState,
273                                 u16              nodeId);
274 
275     /*
276 
277 
278 
279 
280 
281 
282 
283     */
284         static nn::Result GetLinkLevel(nn::uds::LinkLevel* pLinkLevel);
285 
286 };
287 
288 } // namespace CTR
289 } // namespace dlp
290 } // namespace nn
291 
292 
293 #endif // __cplusplus
294 #endif  // ifndef NN_DLP_CTR_DLP_SERVER_H_
295 
296