CTR Pia  4.11.3
Game Communication Engine
local_LocalJoinSessionSetting.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: local_LocalJoinSessionSetting.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/session/session_JoinSessionSetting.h>
18 #include <pia/local/local_LocalSessionTypes.h>
19 
20 #include <pia/common/common_SignatureSetting.h>
21 
22 namespace nn
23 {
24 namespace pia
25 {
26 namespace local
27 {
28 
29 /*!
30 @brief Base class that manages the settings for the <tt>JoinSession</tt> function with a <tt>LocalNetwork</tt> object.
31 
32 @details This class is never instantiated by an application.
33 Use a class that inherits this class.
34 
35 @see nn::pia::local::UdsJoinSessionSetting
36 
37 @date 2014-05-28 Renamed the <tt>GetSessionId</tt> function to <tt>GetSessionId</tt>.
38 @date 2014-04-30 Added the <tt>GetSessionId</tt> function.
39 @date 2014-03-03 Initial version.
40 */
42 {
43 public:
44 /*!
45 @cond PRIVATE
46 @brief Destroys the object.
47 */
48  virtual ~LocalJoinSessionSetting();
49  //! @endcond
50 
51 /*!
52 @cond PRIVATE
53 */
54  virtual const char* GetPassphrase() const = 0;
55  //! @endcond
56 
57 /*!
58 @cond PRIVATE
59 */
60  size_t GetPassphraseSize() const
61  {
62  return m_PassphraseSize;
63  }
64  //! @endcond
65 
66  virtual nn::Result SetPassphrase(const char* pPassphrase, size_t passphraseSize) = 0;
67 
68 /*!
69 @cond PRIVATE
70 */
71  const char* GetSignatureKeyData() const
72  {
73  return m_SignatureKeyData;
74  }
75  //! @endcond
76 
77 /*!
78 @cond PRIVATE
79 */
80  size_t GetSignatureKeyDataSize() const
81  {
82  return m_SignatureKeyDataSize;
83  }
84  //! @endcond
85 
86 /*!
87 @cond PRIVATE
88 */
89  virtual u32 GetSessionId() const;
90  //! @endcond
91 
92 /*!
93 @brief Sets the session key and its size.
94 
95 @details Set the session key size to no more than <tt>@ref common::SignatureSetting::SIGNATURE_KEY_DATA_SIZE_MAX</tt>.
96 
97 @param[in] pSignatureKeyData The session key.
98 @param[in] signatureKeyDataSize The size of the session key.
99 
100 @return Returns a <tt>Result</tt> value for which the <tt>IsSuccess</tt> function returns <tt>true</tt> if execution succeeds.
101 
102 @retval ResultInvalidArgument Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
103 */
104  nn::Result SetSignatureKey(const char* pSignatureKeyData, size_t signatureKeyDataSize);
105 
106 protected:
107  size_t m_PassphraseSize;
109  size_t m_SignatureKeyDataSize;
110 
111 /*!
112 @cond PRIVATE
113 @brief Instantiates an object.
114 */
116  //! @endcond
117 
118 private:
119  // The copy constructor is sealed.
121 
122  // The assignment operator is sealed.
124 };
125 }
126 }
127 } // end of namespace nn::pia::local
nn::Result SetSignatureKey(const char *pSignatureKeyData, size_t signatureKeyDataSize)
Sets the session key and its size.
Definition: assert.h:115
static const u32 SIGNATURE_KEY_DATA_SIZE_MAX
Maximum number of bytes for the key data used for the signature.
Definition: common_SignatureSetting.h:36
Base class that manages settings specific to session joining.
Definition: session_JoinSessionSetting.h:39
Base class that manages the settings for the JoinSession function with a LocalNetwork object...
Definition: local_LocalJoinSessionSetting.h:41