1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     http_ConnectionIpc.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   $Rev: 24877 $
14  *---------------------------------------------------------------------------*/
15 
16 //
17 // このファイルを編集しないでください。
18 // このファイルは自動生成されます。
19 //
20 
21 #ifndef NN_HTTP___HTTP_CONNECTIONIPC_H_
22 #define NN_HTTP___HTTP_CONNECTIONIPC_H_
23 
24 #include <nn/Handle.h>
25 #include <nn/Result.h>
26 #include <nn/types.h>
27 #include <nn/http/http_Types.h>
28 #include <nn/http/http_Const.h>
29 #include <nn/http/http_Result.h>
30 
31 
32 
33 namespace nn {
34 namespace http {
35 
36     class ConnectionIpc
37     {
38     public:
39         enum Tag
40         {
41             TAG_IPC_ERROR,
42             TAG_INITIALIZE_GENERAL_SESSION,
43             TAG_CREATE_CONNECTION,
44             TAG_DESTROY_CONNECTION,
45             TAG_CANCEL_CONNECTION,
46             TAG_GET_CONNECTION_STATUS,
47             TAG_GET_CONNECTION_PROGRESS,
48             TAG_GET_CONNECTION_ERROR,
49             TAG_INITIALIZE_CONNECTION_SESSION,
50             TAG_START_CONNECTION,
51             TAG_START_CONNECTION_ASYNC,
52             TAG_READ_BODY,
53             TAG_READ_BODY_WITH_TIMEOUT,
54             TAG_SET_PROXY,
55             TAG_SET_PROXY_DEFAULT,
56             TAG_SET_BASIC_AUTHORIZATION,
57             TAG_SET_SOCKET_BUFFER_SIZE,
58             TAG_ADD_HEADER_FIELD,
59             TAG_ADD_POST_DATA_ASCII,
60             TAG_ADD_POST_DATA_BINARY,
61             TAG_ADD_POST_DATA_RAW,
62             TAG_SET_LAZY_POST_DATA_SETTING,
63             TAG_SEND_POST_DATA_ASCII,
64             TAG_SEND_POST_DATA_ASCII_WITH_TIMEOUT,
65             TAG_SEND_POST_DATA_BINARY,
66             TAG_SEND_POST_DATA_BINARY_WITH_TIMEOUT,
67             TAG_SEND_POST_DATA_RAW,
68             TAG_SEND_POST_DATA_RAW_WITH_TIMEOUT,
69             TAG_SET_POST_DATA_ENCODING,
70             TAG_NOFITY_FINISH_SEND_POST_DATA,
71             TAG_GET_HEADER_FIELD,
72             TAG_GET_HEADER_FIELD_WITH_TIMEOUT,
73             TAG_GET_HEADER_ALL,
74             TAG_GET_HEADER_ALL_WITH_TIMEOUT,
75             TAG_GET_RESULT_CODE,
76             TAG_GET_RESULT_CODE_WITH_TIMEOUT,
77             TAG_SET_ROOT_CA,
78             TAG_SET_INTERNAL_ROOT_CA,
79             TAG_SET_ROOT_CA_STORE,
80             TAG_SET_CLIENT_CERT,
81             TAG_SET_INTERNAL_CLIENT_CERT,
82             TAG_SET_CLIENT_CERT_ID,
83             TAG_GET_CONNECTION_SSL_ERROR,
84             TAG_SET_VERIFY_OPTION,
85             TAG_DISABLE_VERIFY_OPTION_FOR_DEBUG,
86             TAG_CREATE_CERT_STORE,
87             TAG_DESTROY_CERT_STORE,
88             TAG_ADD_CERT_TO_CERT_STORE,
89             TAG_ADD_INTERNAL_CERT_TO_CERT_STORE,
90             TAG_REMOVE_CERT_FROM_CERT_STORE,
91             TAG_CREATE_CLIENT_CERT,
92             TAG_CREATE_INTERNAL_CLIENT_CERT,
93             TAG_DESTROY_CLIENT_CERT,
94             TAG_SET_DEFAULT_PROXY,
95             TAG_IPC_END
96         };
97 
98     private:
99         Handle m_Session;
100 
101     public:
ConnectionIpc(Handle session)102         ConnectionIpc(Handle session) : m_Session(session) {}
103 
104     public:
105         nn::Result InitializeGeneralSession( nn::Handle hSharedMemory, size_t size );
106         nn::Result CreateConnection( const char8 url[], size_t urlLen, RequestMethod reqMethod, ConnectionHandle* handleCourier );
107         nn::Result DestroyConnection( ConnectionHandle handle );
108         nn::Result CancelConnection( ConnectionHandle handle );
109         nn::Result GetConnectionStatus( ConnectionHandle handle, Status* statusCourier );
110         nn::Result GetConnectionProgress( ConnectionHandle handle, size_t* receivedSizeCourier, size_t* contentSizeCourier );
111         nn::Result GetConnectionError( ConnectionHandle handle, ResultCode* resultCodeCourier );
112         nn::Result InitializeConnectionSession( ConnectionHandle handle );
113         nn::Result StartConnection( ConnectionHandle handle );
114         nn::Result StartConnectionAsync( ConnectionHandle handle );
115         nn::Result ReadBody( ConnectionHandle handle, u8 bodyCourier[], size_t bodyCourierLen );
116         nn::Result ReadBodyWithTimeout( ConnectionHandle handle, u8 bodyCourier[], size_t bodyCourierLen, s64 timeout );
117         nn::Result SetProxy( ConnectionHandle handle, const char8 proxyName[], size_t proxyNameLen, u16 port, const char8 userName[], size_t userNameLen, const char8 password[], size_t passwordLen );
118         nn::Result SetProxyDefault( ConnectionHandle handle );
119         nn::Result SetBasicAuthorization( ConnectionHandle handle, const char8 userName[], size_t userNameLen, const char8 password[], size_t passwordLen );
120         nn::Result SetSocketBufferSize( ConnectionHandle handle, u32 bufSize );
121         nn::Result AddHeaderField( ConnectionHandle handle, const char8 label[], size_t labelLen, const char8 value[], size_t valueLen );
122         nn::Result AddPostDataAscii( ConnectionHandle handle, const char8 label[], size_t labelLen, const char8 value[], size_t valueLen );
123         nn::Result AddPostDataBinary( ConnectionHandle handle, const char8 label[], size_t labelLen, const u8 value[], size_t valueLen );
124         nn::Result AddPostDataRaw( ConnectionHandle handle, const u8 value[], size_t valueLen );
125         nn::Result SetLazyPostDataSetting( ConnectionHandle handle, PostDataType dataType );
126         nn::Result SendPostDataAscii( ConnectionHandle handle, const char8 label[], size_t labelLen, const char8 value[], size_t valueLen );
127         nn::Result SendPostDataAsciiWithTimeout( ConnectionHandle handle, const char8 label[], size_t labelLen, const char8 value[], size_t valueLen, s64 timeout );
128         nn::Result SendPostDataBinary( ConnectionHandle handle, const char8 label[], size_t labelLen, const u8 value[], size_t valueLen );
129         nn::Result SendPostDataBinaryWithTimeout( ConnectionHandle handle, const char8 label[], size_t labelLen, const u8 value[], size_t valueLen, s64 timeout );
130         nn::Result SendPostDataRaw( ConnectionHandle handle, const u8 value[], size_t valueLen );
131         nn::Result SendPostDataRawWithTimeout( ConnectionHandle handle, const u8 value[], size_t valueLen, s64 timeout );
132         nn::Result SetPostDataEncoding( ConnectionHandle handle, EncodingType encodeType );
133         nn::Result NofityFinishSendPostData( ConnectionHandle handle );
134         nn::Result GetHeaderField( ConnectionHandle handle, const char8 label[], size_t labelLen, char8 valueCourier[], size_t valueCourierLen, u32* fieldLenCourier );
135         nn::Result GetHeaderFieldWithTimeout( ConnectionHandle handle, const char8 label[], size_t labelLen, char8 valueCourier[], size_t valueCourierLen, u32* fieldLenCourier, s64 timeout );
136         nn::Result GetHeaderAll( ConnectionHandle handle, char8 headerCourier[], size_t headerCourierLen, u32* allHeaderLenCourier );
137         nn::Result GetHeaderAllWithTimeout( ConnectionHandle handle, char8 headerCourier[], size_t headerCourierLen, u32* allHeaderLenCourier, s64 timeout );
138         nn::Result GetResultCode( ConnectionHandle handle, s32* resultCodeCourier );
139         nn::Result GetResultCodeWithTimeout( ConnectionHandle handle, s32* resultCodeCourier, s64 timeout );
140         nn::Result SetRootCA( ConnectionHandle handle, const u8 rootCaData[], size_t rootCaDataLen );
141         nn::Result SetInternalRootCA( ConnectionHandle handle, InternalCaCertId inCaCertName );
142         nn::Result SetRootCaStore( ConnectionHandle handle, CertStoreId certStoreId );
143         nn::Result SetClientCert( ConnectionHandle handle, const u8 clientCertData[], size_t clientCertDataLen, const u8 privateKeyData[], size_t privateKeyDataLen );
144         nn::Result SetInternalClientCert( ConnectionHandle handle, InternalClientCertId inClientCertName );
145         nn::Result SetClientCertId( ConnectionHandle handle, CertId clientCertId );
146         nn::Result GetConnectionSslError( ConnectionHandle handle, s32* resultCodeCourier );
147         nn::Result SetVerifyOption( ConnectionHandle handle, u32 verifyOption );
148         nn::Result DisableVerifyOptionForDebug( ConnectionHandle handle, u32 verifyOption );
149         nn::Result CreateCertStore( CertStoreId* pCertId );
150         nn::Result DestroyCertStore( CertStoreId certId );
151         nn::Result AddCertToCertStore( CertStoreId certStoreId, const u8 pCertData[], size_t certDataSize, CertId* pCertId );
152         nn::Result AddInternalCertToCertStore( CertStoreId certStoreId, InternalCaCertId inCaCertName, CertId* pCertId );
153         nn::Result RemoveCertFromCertStore( CertStoreId certStoreId, CertId certId );
154         nn::Result CreateClientCert( const u8 pCertData[], size_t certDataSize, const u8 pPrivateKeyData[], size_t privateKeyDataSize, CertId* pCertId );
155         nn::Result CreateInternalClientCert( InternalClientCertId inClientCertName, CertId* pCertId );
156         nn::Result DestroyClientCert( CertId ClientCert );
157         nn::Result SetDefaultProxy( bool isEnableProxy, ProxyAuthType authType, u16 port, const char8 hostName[], size_t hostNameLen, const char8 username[], size_t usernameLen, const char8 password[], size_t passwordLen );
158     };
159 
160 } // end of namespace http
161 } // end of namespace nn
162 
163 
164 
165 #endif  // ifndef NN_HTTP___HTTP_CONNECTIONIPC_H_
166