Fabcoin Core  0.16.2
P2P Digital Currency
Classes | Macros | Enumerations | Functions | Variables
net.cpp File Reference
#include <net.h>
#include <addrman.h>
#include <chainparams.h>
#include <clientversion.h>
#include <consensus/consensus.h>
#include <crypto/common.h>
#include <crypto/sha256.h>
#include <hash.h>
#include <primitives/transaction.h>
#include <netbase.h>
#include <scheduler.h>
#include <ui_interface.h>
#include <utilstrencodings.h>
#include <fcntl.h>
#include <math.h>
Include dependency graph for net.cpp:

Go to the source code of this file.

Classes

struct  NodeEvictionCandidate
 
class  CNetCleanup
 

Macros

#define DUMP_ADDRESSES_INTERVAL   900
 
#define FEELER_SLEEP_WINDOW   1
 
#define MSG_NOSIGNAL   0
 
#define MSG_DONTWAIT   0
 
#define X(name)   stats.name = name
 

Enumerations

enum  BindFlags { BF_NONE = 0, BF_EXPLICIT = (1U << 0), BF_REPORT_ERROR = (1U << 1), BF_WHITELIST = (1U << 2) }
 Used to pass flags to the Bind() function. More...
 

Functions

unsigned short GetListenPort ()
 
bool GetLocal (CService &addr, const CNetAddr *paddrPeer)
 
CAddress GetLocalAddress (const CNetAddr *paddrPeer, ServiceFlags nLocalServices)
 
int GetnScore (const CService &addr)
 
bool IsPeerAddrLocalGood (CNode *pnode)
 
void AdvertiseLocal (CNode *pnode)
 
bool AddLocal (const CService &addr, int nScore)
 
bool AddLocal (const CNetAddr &addr, int nScore)
 
bool RemoveLocal (const CService &addr)
 
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...
 
void MapPort (bool)
 
void Discover (boost::thread_group &threadGroup)
 
int64_t PoissonNextSend (int64_t nNow, int average_interval_seconds)
 Return a timestamp in the future (in microseconds) for exponentially distributed events. More...
 

Variables

bool fDiscover = true
 
bool fListen = true
 
bool fRelayTxes = true
 
CCriticalSection cs_mapLocalHost
 
std::map< CNetAddr, LocalServiceInfomapLocalHost
 
std::string strSubVersion
 Subversion as sent to the P2P network in version messages. More...
 
limitedmap< uint256, int64_t > mapAlreadyAskedFor (MAX_INV_SZ)
 
class CNetCleanup instance_of_cnetcleanup
 

Macro Definition Documentation

#define DUMP_ADDRESSES_INTERVAL   900

Definition at line 42 of file net.cpp.

#define FEELER_SLEEP_WINDOW   1

Definition at line 45 of file net.cpp.

#define MSG_DONTWAIT   0

Definition at line 53 of file net.cpp.

#define MSG_NOSIGNAL   0

Definition at line 48 of file net.cpp.

#define X (   name)    stats.name = name

Definition at line 642 of file net.cpp.

Enumeration Type Documentation

enum BindFlags

Used to pass flags to the Bind() function.

Enumerator
BF_NONE 
BF_EXPLICIT 
BF_REPORT_ERROR 
BF_WHITELIST 

Definition at line 68 of file net.cpp.

Function Documentation

bool AddLocal ( const CService addr,
int  nScore 
)

Definition at line 205 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 231 of file net.cpp.

Here is the call graph for this function:

void AdvertiseLocal ( CNode pnode)

Definition at line 182 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Discover ( boost::thread_group &  threadGroup)

Definition at line 2160 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned short GetListenPort ( )

Definition at line 98 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 104 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

CAddress GetLocalAddress ( const CNetAddr paddrPeer,
ServiceFlags  nLocalServices 
)

Definition at line 153 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int GetnScore ( const CService addr)

Definition at line 165 of file net.cpp.

Here is the caller graph for this function:

bool IsLimited ( enum Network  net)

Definition at line 253 of file net.cpp.

Here is the caller graph for this function:

bool IsLimited ( const CNetAddr addr)

Definition at line 259 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 278 of file net.cpp.

Here is the caller graph for this function:

bool IsPeerAddrLocalGood ( CNode pnode)

Definition at line 174 of file net.cpp.

Here is the call graph for this function:

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 285 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 292 of file net.cpp.

Here is the call graph for this function:

void MapPort ( bool  )

Definition at line 1544 of file net.cpp.

Here is the caller graph for this function:

int64_t PoissonNextSend ( int64_t  nNow,
int  average_interval_seconds 
)

Return a timestamp in the future (in microseconds) for exponentially distributed events.

Definition at line 2883 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool RemoveLocal ( const CService addr)

Definition at line 236 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool SeenLocal ( const CService addr)

vote for a local address

Definition at line 265 of file net.cpp.

Here is the caller graph for this function:

void SetLimited ( enum Network  net,
bool  fLimited 
)

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

Definition at line 245 of file net.cpp.

Here is the caller graph for this function:

Variable Documentation

CCriticalSection cs_mapLocalHost

Definition at line 85 of file net.cpp.

bool fDiscover = true

Definition at line 82 of file net.cpp.

bool fListen = true

Definition at line 83 of file net.cpp.

bool fRelayTxes = true

Definition at line 84 of file net.cpp.

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

Definition at line 86 of file net.cpp.

std::string strSubVersion

Subversion as sent to the P2P network in version messages.

Definition at line 88 of file net.cpp.