Anoncoin  0.9.4
P2P Digital Currency
Classes | Typedefs | Enumerations | Functions | Variables
net.h File Reference
#include "bloom.h"
#include "compat.h"
#include "hash.h"
#include "limitedmap.h"
#include "mruset.h"
#include "netbase.h"
#include "protocol.h"
#include "sync.h"
#include "uint256.h"
#include "util.h"
#include <deque>
#include <stdint.h>
#include <arpa/inet.h>
#include <boost/foreach.hpp>
#include <boost/signals2/signal.hpp>
#include <openssl/rand.h>
Include dependency graph for net.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CNodeSignals
 
struct  LocalServiceInfo
 
class  CNodeStats
 
class  CNetMessage
 
class  CNode
 Information about a peer. More...
 
class  CAddrDB
 Access to the (IP) address database (peers.dat) More...
 

Typedefs

typedef int NodeId
 

Enumerations

enum  {
  LOCAL_NONE, LOCAL_IF, LOCAL_BIND, LOCAL_UPNP,
  LOCAL_HTTP, LOCAL_MANUAL, LOCAL_MAX
}
 

Functions

unsigned int ReceiveFloodSize ()
 
unsigned int SendBufferSize ()
 
void AddOneShot (std::string strDest)
 
bool RecvLine (SOCKET hSocket, std::string &strLine)
 
bool GetMyExternalIP (CNetAddr &ipRet)
 
void AddressCurrentlyConnected (const CService &addr)
 
CNodeFindNode (const CNetAddr &ip)
 
CNodeFindNode (const CService &ip)
 
CNodeConnectNode (CAddress addrConnect, const char *strDest=NULL)
 
void MapPort (bool fUseUPnP)
 
unsigned short GetListenPort ()
 
bool BindListenPort (const CService &bindAddr, std::string &strError=REF(std::string()))
 
void StartNode (boost::thread_group &threadGroup)
 
bool StopNode ()
 
void SocketSendData (CNode *pnode)
 
CNodeSignalsGetNodeSignals ()
 
void SetLimited (enum Network net, bool fLimited=true)
 Make a particular network entirely off-limits (no automatic connects to it) More...
 
bool IsLimited (enum Network net)
 
bool IsLimited (const CNetAddr &addr)
 
bool AddLocal (const CService &addr, int nScore=LOCAL_NONE)
 
bool AddLocal (const CNetAddr &addr, int nScore=LOCAL_NONE)
 
bool SeenLocal (const CService &addr)
 vote for a local address More...
 
bool IsLocal (const CService &addr)
 check whether a given address is potentially local More...
 
bool GetLocal (CService &addr, const CNetAddr *paddrPeer=NULL)
 
bool IsReachable (enum Network net)
 check whether a given network is one we can probably connect to More...
 
bool IsReachable (const CNetAddr &addr)
 check whether a given address is in a network we can probably connect to More...
 
void SetReachable (enum Network net, bool fFlag=true)
 
CAddress GetLocalAddress (const CNetAddr *paddrPeer=NULL)
 
void RelayTransaction (const CTransaction &tx, const uint256 &hash)
 
void RelayTransaction (const CTransaction &tx, const uint256 &hash, const CDataStream &ss)
 

Variables

bool fDiscover
 Specific functions we need to implement I2P functionality. More...
 
uint64_t nLocalServices
 
uint64_t nLocalHostNonce
 
CAddrMan addrman
 
int nMaxConnections
 
std::vector< CNode * > vNodes
 
CCriticalSection cs_vNodes
 
std::map< CInv, CDataStreammapRelay
 
std::deque< std::pair< int64_t, CInv > > vRelayExpiration
 
CCriticalSection cs_mapRelay
 
limitedmap< CInv, int64_t > mapAlreadyAskedFor
 
std::vector< std::string > vAddedNodes
 
CCriticalSection cs_vAddedNodes
 
NodeId nLastNodeId
 
CCriticalSection cs_nLastNodeId
 
CCriticalSection cs_mapLocalHost
 
map< CNetAddr, LocalServiceInfomapLocalHost
 

Typedef Documentation

typedef int NodeId

Definition at line 75 of file net.h.

Enumeration Type Documentation

anonymous enum
Enumerator
LOCAL_NONE 
LOCAL_IF 
LOCAL_BIND 
LOCAL_UPNP 
LOCAL_HTTP 
LOCAL_MANUAL 
LOCAL_MAX 

Definition at line 91 of file net.h.

Function Documentation

bool AddLocal ( const CService addr,
int  nScore = LOCAL_NONE 
)

Definition at line 227 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool AddLocal ( const CNetAddr addr,
int  nScore = LOCAL_NONE 
)

Definition at line 256 of file net.cpp.

Here is the call graph for this function:

void AddOneShot ( std::string  strDest)
void AddressCurrentlyConnected ( const CService addr)

Definition at line 417 of file net.cpp.

Here is the call graph for this function:

bool BindListenPort ( const CService bindAddr,
std::string &  strError = REF(std::string()) 
)
CNode* ConnectNode ( CAddress  addrConnect,
const char *  strDest = NULL 
)

debug print

Definition at line 457 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

CNode* FindNode ( const CNetAddr ip)

Definition at line 430 of file net.cpp.

Here is the caller graph for this function:

CNode* FindNode ( const CService ip)

Definition at line 448 of file net.cpp.

unsigned short GetListenPort ( )

Definition at line 105 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool GetLocal ( CService addr,
const CNetAddr paddrPeer = NULL 
)

Definition at line 111 of file net.cpp.

Here is the caller graph for this function:

CAddress GetLocalAddress ( const CNetAddr paddrPeer = NULL)

Definition at line 136 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool GetMyExternalIP ( CNetAddr ipRet)

Definition at line 363 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

CNodeSignals& GetNodeSignals ( )

Definition at line 97 of file net.cpp.

Here is the caller graph for this function:

bool IsLimited ( enum Network  net)

Definition at line 270 of file net.cpp.

Here is the caller graph for this function:

bool IsLimited ( const CNetAddr addr)

Definition at line 276 of file net.cpp.

Here is the call graph for this function:

bool IsLocal ( const CService addr)

check whether a given address is potentially local

Definition at line 297 of file net.cpp.

Here is the caller graph for this function:

bool IsReachable ( enum Network  net)

check whether a given network is one we can probably connect to

Definition at line 304 of file net.cpp.

Here is the caller graph for this function:

bool IsReachable ( const CNetAddr addr)

check whether a given address is in a network we can probably connect to

Definition at line 311 of file net.cpp.

Here is the call graph for this function:

void MapPort ( bool  fUseUPnP)

Definition at line 1327 of file net.cpp.

Here is the caller graph for this function:

unsigned int ReceiveFloodSize ( )
inline

Definition at line 54 of file net.h.

Here is the call graph for this function:

Here is the caller graph for this function:

bool RecvLine ( SOCKET  hSocket,
std::string &  strLine 
)
void RelayTransaction ( const CTransaction tx,
const uint256 hash 
)

Definition at line 2106 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RelayTransaction ( const CTransaction tx,
const uint256 hash,
const CDataStream ss 
)

Definition at line 2114 of file net.cpp.

Here is the call graph for this function:

bool SeenLocal ( const CService addr)

vote for a local address

Definition at line 282 of file net.cpp.

unsigned int SendBufferSize ( )
inline

Definition at line 55 of file net.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void SetLimited ( enum Network  net,
bool  fLimited = true 
)

Make a particular network entirely off-limits (no automatic connects to it)

Definition at line 262 of file net.cpp.

Here is the caller graph for this function:

void SetReachable ( enum Network  net,
bool  fFlag = true 
)

Definition at line 218 of file net.cpp.

Here is the caller graph for this function:

void SocketSendData ( CNode pnode)

Definition at line 713 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void StartNode ( boost::thread_group &  threadGroup)

Definition at line 1989 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool StopNode ( )

Definition at line 2044 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

CAddrMan addrman

Definition at line 61 of file net.cpp.

CCriticalSection cs_mapLocalHost

Definition at line 53 of file net.cpp.

CCriticalSection cs_mapRelay

Definition at line 78 of file net.cpp.

CCriticalSection cs_nLastNodeId

Definition at line 91 of file net.cpp.

CCriticalSection cs_vAddedNodes

Definition at line 88 of file net.cpp.

CCriticalSection cs_vNodes

Definition at line 75 of file net.cpp.

bool fDiscover

Specific functions we need to implement I2P functionality.

Definition at line 52 of file net.cpp.

limitedmap<CInv, int64_t> mapAlreadyAskedFor
map<CNetAddr, LocalServiceInfo> mapLocalHost

Definition at line 54 of file net.cpp.

std::map<CInv, CDataStream> mapRelay

Definition at line 76 of file net.cpp.

NodeId nLastNodeId

Definition at line 90 of file net.cpp.

uint64_t nLocalHostNonce

Definition at line 59 of file net.cpp.

uint64_t nLocalServices

Definition at line 71 of file net.cpp.

int nMaxConnections

Definition at line 62 of file net.cpp.

std::vector<std::string> vAddedNodes

Definition at line 87 of file net.cpp.

std::vector<CNode*> vNodes

Definition at line 74 of file net.cpp.

std::deque<std::pair<int64_t, CInv> > vRelayExpiration

Definition at line 77 of file net.cpp.