Anoncoin  0.9.4
P2P Digital Currency
Classes | Macros | Functions | Variables
net.cpp File Reference
#include "net.h"
#include "addrman.h"
#include "clientversion.h"
#include "chainparams.h"
#include "core.h"
#include "ui_interface.h"
#include <fcntl.h>
#include <boost/filesystem.hpp>
Include dependency graph for net.cpp:

Go to the source code of this file.

Classes

class  CNetCleanup
 

Macros

#define DUMP_ADDRESSES_INTERVAL   900
 
#define X(name)   stats.name = name
 

Functions

bool OpenNetworkConnection (const CAddress &addrConnect, CSemaphoreGrant *grantOutbound=NULL, const char *strDest=NULL, bool fOneShot=false)
 
CNodeSignalsGetNodeSignals ()
 
void AddOneShot (string strDest)
 
unsigned short GetListenPort ()
 
bool GetLocal (CService &addr, const CNetAddr *paddrPeer)
 
CAddress GetLocalAddress (const CNetAddr *paddrPeer)
 
bool RecvLine (SOCKET hSocket, string &strLine)
 
void SetReachable (enum Network net, bool fFlag)
 
bool AddLocal (const CService &addr, int nScore)
 
bool AddLocal (const CNetAddr &addr, int nScore)
 
void SetLimited (enum Network net, bool fLimited)
 Make a particular network entirely off-limits (no automatic connects to it) More...
 
bool IsLimited (enum Network net)
 
bool IsLimited (const CNetAddr &addr)
 
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 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...
 
bool GetMyExternalIP2 (const CService &addrConnect, const char *pszGet, const char *pszKeyword, CNetAddr &ipRet)
 
bool GetMyExternalIP (CNetAddr &ipRet)
 
void ThreadGetMyExternalIP ()
 
void AddressCurrentlyConnected (const CService &addr)
 
CNodeFindNode (const CNetAddr &ip)
 
CNodeFindNode (std::string addrName)
 
CNodeFindNode (const CService &addr)
 
CNodeConnectNode (CAddress addrConnect, const char *pszDest)
 
void SocketSendData (CNode *pnode)
 
void ThreadSocketHandler ()
 Main Thread that handling socket's & their housekeeping... More...
 
void MapPort (bool)
 
void ThreadDNSAddressSeed ()
 Process DNS seed data from chainparams. More...
 
void DumpAddresses ()
 
void ThreadOpenConnections ()
 
void ThreadOpenAddedConnections ()
 
void ThreadMessageHandler ()
 
bool BindListenPort (const CService &addrBind, string &strError)
 
void StartNode (boost::thread_group &threadGroup)
 
bool StopNode ()
 
void RelayTransaction (const CTransaction &tx, const uint256 &hash)
 
void RelayTransaction (const CTransaction &tx, const uint256 &hash, const CDataStream &ss)
 

Variables

bool fDiscover = true
 Specific functions we need to implement I2P functionality. More...
 
CCriticalSection cs_mapLocalHost
 
map< CNetAddr, LocalServiceInfomapLocalHost
 
uint64_t nLocalHostNonce = 0
 
CAddrMan addrman
 
int nMaxConnections = 125
 
bool fAddressesInitialized = false
 
uint64_t nLocalServices = NODE_NETWORK | NODE_BLOOM
 
vector< CNode * > vNodes
 
CCriticalSection cs_vNodes
 
map< CInv, CDataStreammapRelay
 
deque< pair< int64_t, CInv > > vRelayExpiration
 
CCriticalSection cs_mapRelay
 
limitedmap< CInv, int64_t > mapAlreadyAskedFor (MAX_INV_SZ)
 
CCriticalSection cs_vOneShots
 
set< CNetAddrsetservAddNodeAddresses
 
CCriticalSection cs_setservAddNodeAddresses
 
vector< std::string > vAddedNodes
 
CCriticalSection cs_vAddedNodes
 
NodeId nLastNodeId = 0
 
CCriticalSection cs_nLastNodeId
 
class CNetCleanup instance_of_cnetcleanup
 

Macro Definition Documentation

#define DUMP_ADDRESSES_INTERVAL   900

Definition at line 35 of file net.cpp.

#define X (   name)    stats.name = name

Definition at line 595 of file net.cpp.

Function Documentation

bool AddLocal ( const CService addr,
int  nScore 
)

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 
)

Definition at line 256 of file net.cpp.

Here is the call graph for this function:

void AddOneShot ( string  strDest)

Definition at line 99 of file net.cpp.

Here is the caller graph for this function:

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 addrBind,
string &  strError 
)

Definition at line 1767 of file net.cpp.

Here is the call graph for this function:

CNode* ConnectNode ( CAddress  addrConnect,
const char *  pszDest 
)

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:

void DumpAddresses ( )

Definition at line 1421 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 ( std::string  addrName)

Definition at line 439 of file net.cpp.

CNode* FindNode ( const CService addr)

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 
)

Definition at line 111 of file net.cpp.

Here is the caller graph for this function:

CAddress GetLocalAddress ( const CNetAddr paddrPeer)

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:

bool GetMyExternalIP2 ( const CService addrConnect,
const char *  pszGet,
const char *  pszKeyword,
CNetAddr ipRet 
)

Definition at line 317 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  )

Definition at line 1327 of file net.cpp.

Here is the caller graph for this function:

bool OpenNetworkConnection ( const CAddress addrConnect,
CSemaphoreGrant grantOutbound = NULL,
const char *  strDest = NULL,
bool  fOneShot = false 
)

Definition at line 1631 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool RecvLine ( SOCKET  hSocket,
string &  strLine 
)

Definition at line 149 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 
)

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.

void SetLimited ( enum Network  net,
bool  fLimited 
)

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 
)

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:

void ThreadDNSAddressSeed ( )

Process DNS seed data from chainparams.

Definition at line 1337 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ThreadGetMyExternalIP ( )

Definition at line 403 of file net.cpp.

Here is the call graph for this function:

void ThreadMessageHandler ( )

Definition at line 1694 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ThreadOpenAddedConnections ( )

Definition at line 1558 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ThreadOpenConnections ( )

Definition at line 1450 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ThreadSocketHandler ( )

Main Thread that handling socket's & their housekeeping...

Definition at line 810 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_setservAddNodeAddresses

Definition at line 85 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.

CCriticalSection cs_vOneShots

Definition at line 82 of file net.cpp.

bool fAddressesInitialized = false

Definition at line 63 of file net.cpp.

bool fDiscover = true

Specific functions we need to implement I2P functionality.

Definition at line 52 of file net.cpp.

class CNetCleanup instance_of_cnetcleanup
limitedmap<CInv, int64_t> mapAlreadyAskedFor(MAX_INV_SZ)
map<CNetAddr, LocalServiceInfo> mapLocalHost

Definition at line 54 of file net.cpp.

map<CInv, CDataStream> mapRelay

Definition at line 76 of file net.cpp.

NodeId nLastNodeId = 0

Definition at line 90 of file net.cpp.

uint64_t nLocalHostNonce = 0

Definition at line 59 of file net.cpp.

uint64_t nLocalServices = NODE_NETWORK | NODE_BLOOM

Definition at line 71 of file net.cpp.

int nMaxConnections = 125

Definition at line 62 of file net.cpp.

set<CNetAddr> setservAddNodeAddresses

Definition at line 84 of file net.cpp.

vector<std::string> vAddedNodes

Definition at line 87 of file net.cpp.

vector<CNode*> vNodes

Definition at line 74 of file net.cpp.

deque<pair<int64_t, CInv> > vRelayExpiration

Definition at line 77 of file net.cpp.