ctr_Repair/trunk/ConsoleDataMigration/sources/ConsoleRestore/NinjaCommunicator.h
N2614 c50f12dec8 クライアント証明書とCA証明書の設定
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@841 385bec56-5757-e545-9c3a-d8741f4650f1
2015-03-19 01:31:51 +00:00

58 lines
1.9 KiB
C++

/*---------------------------------------------------------------------------*
Project: Horizon
File: NinjaCommunicator.h
Copyright 2009-2011 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
Company Ltd., and are protected by Federal copyright law. They may
not be disclosed to third parties or copied or duplicated in any form,
in whole or in part, without the prior written consent of Nintendo.
$Rev$
*---------------------------------------------------------------------------*/
#ifndef BGSCOMMUNICATOR_H_
#define BGSCOMMUNICATOR_H_
#include <nn.h>
#include <nn/http.h>
#include <string>
namespace ConsoleRestore
{
class NinjaCommunicator
{
public:
NinjaCommunicator();
virtual ~NinjaCommunicator();
//! @Ninjaと通信してns_uidを取得します
//! @param[in] url 接続先URL
nn::Result GetNsUid(const char* baseUrl, nn::ProgramId programId);
//! @Ninjaと通信してec_infoを取得します
nn::Result GetEcInfo(const char* baseUrl, const char* nsUid, const char* countryCode);
//! @brief 通信結果をバッファに書き込みます。
//! @param[out] buf 通信結果を書き込むバッファ
//! @param[in] size バッファサイズ
nn::Result GetBody(u8* buf, size_t size);
nn::Result GetSslError(s32* pResultCode);
nn::Result Finalize();
private:
nn::Result HttpCommunicationCore(std::string url);
void GenerateUrlForNsUid(std::string& url, nn::ProgramId programId);
void GenerateUrlForEcInfo(std::string& url, const char* nsUid, const char* countryCode);
//Connectionインスタンス
nn::http::Connection m_HttpCon;
};
} /* namespace ConsoleRestore */
#endif /* BGSCOMMUNICATOR_H_ */