1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     uds_packet.h
4   Copyright (C)2009 Nintendo Co., Ltd.  All rights reserved.
5   These coded instructions, statements, and computer programs contain
6   proprietary information of Nintendo of America Inc. and/or Nintendo
7   Company Ltd., and are protected by Federal copyright law. They may
8   not be disclosed to third parties or copied or duplicated in any form,
9   in whole or in part, without the prior written consent of Nintendo.
10   $Rev: 27700 $
11  *---------------------------------------------------------------------------
12 
13 
14 */
15 
16 /* Please see man pages for details
17 
18 */
19 
20 #ifndef LIBRARIES_UDS_CTR_UDS_IE_H_
21 #define LIBRARIES_UDS_CTR_UDS_IE_H_
22 
23 #include <nn.h>
24 
25 #include <nn/uds.h>
26 
27 namespace nn {
28 namespace uds {
29 namespace CTR {
30 namespace detail {
31 
32 const bit8 VSIE_OUI[3]       = {0x00, 0x1f, 0x32};  //
33 const size_t VSIE_SIZE_MAX   = 250;
34 
35 //Connection information included in NetworkDescription
36 const bit16 EJECT_SPECTAOTR_FLAG     = 0x0001; //
37 const bit16 DISALLOW_CONNECT_FLAG    = 0x0002; //
38 const bit16 DISALLOW_RECONNECT_FLAG  = 0x0004; //
39 const bit16 DIRECT_BROADCAST_FLAG    = 0x8000; //
40 
41 
42 /*
43 
44  */
45 enum SubType
46 {
47     NETWORK_DESCRIPTION_IE  = 21,   //
48     SPECTATOR_PACKET_IE      = 22,   //
49     SPECTATOR_ACK_IE         = 23,   //
50     NODE_INFORMATION_IE_1   = 24,   //
51     NODE_INFORMATION_IE_2   = 25    //
52 };
53 
54 /*
55 
56  */
57 struct NetworkDescriptionElement
58 {
59     //Common header
60     bit8  oui[3];           //
61     u8    subType;          //
62     u32   gameId;           //
63     u8    subId;            //
64     u8    sequenceNumber;   //
65     bit16 attribute;        //
66     u32   temporaryId;      //
67     u8    nowEntry;         //
68     u8    maxEntry;         //
69     u8    tmpEntry;         //
70     bit8  platform;         //
71     u8    securityType;     //
72     u8    reserved[10];     //
73     u8    digest[20];         //
74     u8    appDataLength;    //
75     bit8  appData[NET_DESC_APPDATA_SIZE_MAX];   //
76 };
77 
78 /*
79 
80  */
81 struct NodeInformationElement
82 {
83     //Common header
84     bit8  oui[3];           //
85     u8    subType;          //
86     bit8  payload[VSIE_SIZE_MAX];
87 };
88 
89 } // end of namespace detail
90 } // end of namespace CTR
91 } // end of namespace uds
92 } // end of namespace nn
93 
94 #endif /* LIBRARIES_UDS_CTR_UDS_IE_H_ */
95