Anoncoin  0.9.4
P2P Digital Currency
Classes | Enumerations | Functions
rpcprotocol.h File Reference
#include <list>
#include <map>
#include <stdint.h>
#include <string>
#include <boost/iostreams/concepts.hpp>
#include <boost/iostreams/stream.hpp>
#include <boost/asio.hpp>
#include <boost/asio/ssl.hpp>
#include "json/json_spirit_reader_template.h"
#include "json/json_spirit_utils.h"
#include "json/json_spirit_writer_template.h"
Include dependency graph for rpcprotocol.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  SSLIOStreamDevice< Protocol >
 

Enumerations

enum  HTTPStatusCode {
  HTTP_OK = 200, HTTP_BAD_REQUEST = 400, HTTP_UNAUTHORIZED = 401, HTTP_FORBIDDEN = 403,
  HTTP_NOT_FOUND = 404, HTTP_INTERNAL_SERVER_ERROR = 500
}
 
enum  RPCErrorCode {
  RPC_INVALID_REQUEST = -32600, RPC_METHOD_NOT_FOUND = -32601, RPC_INVALID_PARAMS = -32602, RPC_INTERNAL_ERROR = -32603,
  RPC_PARSE_ERROR = -32700, RPC_MISC_ERROR = -1, RPC_FORBIDDEN_BY_SAFE_MODE = -2, RPC_TYPE_ERROR = -3,
  RPC_INVALID_ADDRESS_OR_KEY = -5, RPC_OUT_OF_MEMORY = -7, RPC_INVALID_PARAMETER = -8, RPC_DATABASE_ERROR = -20,
  RPC_DESERIALIZATION_ERROR = -22, RPC_TRANSACTION_ERROR = -25, RPC_TRANSACTION_REJECTED = -26, RPC_TRANSACTION_ALREADY_IN_CHAIN = -27,
  RPC_CLIENT_NOT_CONNECTED = -9, RPC_CLIENT_IN_INITIAL_DOWNLOAD = -10, RPC_CLIENT_NODE_ALREADY_ADDED = -23, RPC_CLIENT_NODE_NOT_ADDED = -24,
  RPC_WALLET_ERROR = -4, RPC_WALLET_INSUFFICIENT_FUNDS = -6, RPC_WALLET_INVALID_ACCOUNT_NAME = -11, RPC_WALLET_KEYPOOL_RAN_OUT = -12,
  RPC_WALLET_UNLOCK_NEEDED = -13, RPC_WALLET_PASSPHRASE_INCORRECT = -14, RPC_WALLET_WRONG_ENC_STATE = -15, RPC_WALLET_ENCRYPTION_FAILED = -16,
  RPC_WALLET_ALREADY_UNLOCKED = -17
}
 

Functions

std::string HTTPPost (const std::string &strMsg, const std::map< std::string, std::string > &mapRequestHeaders)
 
std::string HTTPReply (int nStatus, const std::string &strMsg, bool keepalive)
 
bool ReadHTTPRequestLine (std::basic_istream< char > &stream, int &proto, std::string &http_method, std::string &http_uri)
 
int ReadHTTPStatus (std::basic_istream< char > &stream, int &proto)
 
int ReadHTTPHeaders (std::basic_istream< char > &stream, std::map< std::string, std::string > &mapHeadersRet)
 
int ReadHTTPMessage (std::basic_istream< char > &stream, std::map< std::string, std::string > &mapHeadersRet, std::string &strMessageRet, int nProto)
 
std::string JSONRPCRequest (const std::string &strMethod, const json_spirit::Array &params, const json_spirit::Value &id)
 
json_spirit::Object JSONRPCReplyObj (const json_spirit::Value &result, const json_spirit::Value &error, const json_spirit::Value &id)
 
std::string JSONRPCReply (const json_spirit::Value &result, const json_spirit::Value &error, const json_spirit::Value &id)
 
json_spirit::Object JSONRPCError (int code, const std::string &message)
 

Enumeration Type Documentation

Enumerator
HTTP_OK 
HTTP_BAD_REQUEST 
HTTP_UNAUTHORIZED 
HTTP_FORBIDDEN 
HTTP_NOT_FOUND 
HTTP_INTERNAL_SERVER_ERROR 

Definition at line 24 of file rpcprotocol.h.

Enumerator
RPC_INVALID_REQUEST 
RPC_METHOD_NOT_FOUND 
RPC_INVALID_PARAMS 
RPC_INTERNAL_ERROR 
RPC_PARSE_ERROR 
RPC_MISC_ERROR 
RPC_FORBIDDEN_BY_SAFE_MODE 
RPC_TYPE_ERROR 
RPC_INVALID_ADDRESS_OR_KEY 
RPC_OUT_OF_MEMORY 
RPC_INVALID_PARAMETER 
RPC_DATABASE_ERROR 
RPC_DESERIALIZATION_ERROR 
RPC_TRANSACTION_ERROR 
RPC_TRANSACTION_REJECTED 
RPC_TRANSACTION_ALREADY_IN_CHAIN 
RPC_CLIENT_NOT_CONNECTED 
RPC_CLIENT_IN_INITIAL_DOWNLOAD 
RPC_CLIENT_NODE_ALREADY_ADDED 
RPC_CLIENT_NODE_NOT_ADDED 
RPC_WALLET_ERROR 
RPC_WALLET_INSUFFICIENT_FUNDS 
RPC_WALLET_INVALID_ACCOUNT_NAME 
RPC_WALLET_KEYPOOL_RAN_OUT 
RPC_WALLET_UNLOCK_NEEDED 
RPC_WALLET_PASSPHRASE_INCORRECT 
RPC_WALLET_WRONG_ENC_STATE 
RPC_WALLET_ENCRYPTION_FAILED 
RPC_WALLET_ALREADY_UNLOCKED 

Definition at line 35 of file rpcprotocol.h.

Function Documentation

std::string HTTPPost ( const std::string &  strMsg,
const std::map< std::string, std::string > &  mapRequestHeaders 
)
std::string HTTPReply ( int  nStatus,
const std::string &  strMsg,
bool  keepalive 
)
json_spirit::Object JSONRPCError ( int  code,
const std::string &  message 
)
std::string JSONRPCReply ( const json_spirit::Value &  result,
const json_spirit::Value &  error,
const json_spirit::Value &  id 
)
json_spirit::Object JSONRPCReplyObj ( const json_spirit::Value &  result,
const json_spirit::Value &  error,
const json_spirit::Value &  id 
)
std::string JSONRPCRequest ( const std::string &  strMethod,
const json_spirit::Array &  params,
const json_spirit::Value &  id 
)
int ReadHTTPHeaders ( std::basic_istream< char > &  stream,
std::map< std::string, std::string > &  mapHeadersRet 
)
int ReadHTTPMessage ( std::basic_istream< char > &  stream,
std::map< std::string, std::string > &  mapHeadersRet,
std::string &  strMessageRet,
int  nProto 
)
bool ReadHTTPRequestLine ( std::basic_istream< char > &  stream,
int &  proto,
std::string &  http_method,
std::string &  http_uri 
)
int ReadHTTPStatus ( std::basic_istream< char > &  stream,
int &  proto 
)

Definition at line 165 of file rpcprotocol.cpp.

Here is the call graph for this function:

Here is the caller graph for this function: