Dogecoin Core  1.14.2
P2P Digital Currency
Classes | Typedefs | Enumerations | Functions | Variables
net.h File Reference
#include "addrdb.h"
#include "addrman.h"
#include "alert.h"
#include "amount.h"
#include "bloom.h"
#include "compat.h"
#include "hash.h"
#include "limitedmap.h"
#include "netaddress.h"
#include "protocol.h"
#include "random.h"
#include "streams.h"
#include "sync.h"
#include "uint256.h"
#include "threadinterrupt.h"
#include <atomic>
#include <deque>
#include <stdint.h>
#include <thread>
#include <memory>
#include <condition_variable>
#include <arpa/inet.h>
#include <boost/filesystem/path.hpp>
#include <boost/foreach.hpp>
#include <boost/signals2/signal.hpp>
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  AddedNodeInfo
 
struct  CSerializedNetMsg
 
class  CConnman
 
struct  CConnman::Options
 
struct  CConnman::ListenSocket
 
struct  CombinerAll
 
struct  CNodeSignals
 
struct  LocalServiceInfo
 
class  CNodeStats
 
class  CNetMessage
 
class  CNode
 Information about a peer. More...
 

Typedefs

typedef int64_t NodeId
 
typedef std::map< std::string, uint64_t > mapMsgCmdSize
 

Enumerations

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

Functions

void Discover (boost::thread_group &threadGroup)
 
void MapPort (bool fUseUPnP)
 
unsigned short GetListenPort ()
 
bool BindListenPort (const CService &bindAddr, std::string &strError, bool fWhitelisted=false)
 
CNodeSignalsGetNodeSignals ()
 
bool IsPeerAddrLocalGood (CNode *pnode)
 
void AdvertiseLocal (CNode *pnode)
 
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 RemoveLocal (const CService &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 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...
 
CAddress GetLocalAddress (const CNetAddr *paddrPeer, ServiceFlags nLocalServices)
 
int64_t PoissonNextSend (int64_t nNow, int average_interval_seconds)
 Return a timestamp in the future (in microseconds) for exponentially distributed events. More...
 

Variables

std::unique_ptr< CConnmang_connman
 
bool fDiscover
 
bool fListen
 
bool fRelayTxes
 
limitedmap< uint256, int64_t > mapAlreadyAskedFor
 
std::string strSubVersion
 Subversion as sent to the P2P network in version messages. More...
 
CCriticalSection cs_mapLocalHost
 
std::map< CNetAddr, LocalServiceInfomapLocalHost
 

Typedef Documentation

◆ mapMsgCmdSize

typedef std::map<std::string, uint64_t> mapMsgCmdSize

Definition at line 485 of file net.h.

◆ NodeId

typedef int64_t NodeId

Definition at line 96 of file net.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
LOCAL_NONE 
LOCAL_IF 
LOCAL_BIND 
LOCAL_UPNP 
LOCAL_MANUAL 
LOCAL_MAX 

Definition at line 442 of file net.h.

Function Documentation

◆ AddLocal() [1/2]

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

Definition at line 222 of file net.cpp.

Here is the call graph for this function:

◆ AddLocal() [2/2]

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

Definition at line 196 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AdvertiseLocal()

void AdvertiseLocal ( CNode pnode)

Definition at line 173 of file net.cpp.

Here is the call graph for this function:

◆ BindListenPort()

bool BindListenPort ( const CService bindAddr,
std::string &  strError,
bool  fWhitelisted = false 
)

◆ Discover()

void Discover ( boost::thread_group &  threadGroup)

Definition at line 2122 of file net.cpp.

Here is the call graph for this function:

◆ GetListenPort()

unsigned short GetListenPort ( )

Definition at line 89 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetLocal()

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

Definition at line 95 of file net.cpp.

Here is the caller graph for this function:

◆ GetLocalAddress()

CAddress GetLocalAddress ( const CNetAddr paddrPeer,
ServiceFlags  nLocalServices 
)

Definition at line 144 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNodeSignals()

CNodeSignals& GetNodeSignals ( )

Definition at line 81 of file net.cpp.

Here is the caller graph for this function:

◆ IsLimited() [1/2]

bool IsLimited ( const CNetAddr addr)

Definition at line 250 of file net.cpp.

Here is the call graph for this function:

◆ IsLimited() [2/2]

bool IsLimited ( enum Network  net)

Definition at line 244 of file net.cpp.

Here is the caller graph for this function:

◆ IsLocal()

bool IsLocal ( const CService addr)

check whether a given address is potentially local

Definition at line 269 of file net.cpp.

Here is the caller graph for this function:

◆ IsPeerAddrLocalGood()

bool IsPeerAddrLocalGood ( CNode pnode)

Definition at line 165 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsReachable() [1/2]

bool IsReachable ( const CNetAddr addr)

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

Definition at line 283 of file net.cpp.

Here is the call graph for this function:

◆ IsReachable() [2/2]

bool IsReachable ( enum Network  net)

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

Definition at line 276 of file net.cpp.

Here is the caller graph for this function:

◆ MapPort()

void MapPort ( bool  fUseUPnP)

Definition at line 1532 of file net.cpp.

Here is the caller graph for this function:

◆ PoissonNextSend()

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemoveLocal()

bool RemoveLocal ( const CService addr)

Definition at line 227 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SeenLocal()

bool SeenLocal ( const CService addr)

vote for a local address

Definition at line 256 of file net.cpp.

◆ SetLimited()

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

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

Definition at line 236 of file net.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ cs_mapLocalHost

CCriticalSection cs_mapLocalHost
extern

Definition at line 72 of file net.cpp.

◆ fDiscover

bool fDiscover
extern

Definition at line 69 of file net.cpp.

◆ fListen

bool fListen
extern

Definition at line 70 of file net.cpp.

◆ fRelayTxes

bool fRelayTxes
extern

Definition at line 71 of file net.cpp.

◆ g_connman

std::unique_ptr<CConnman> g_connman
extern

Definition at line 75 of file init.cpp.

◆ mapAlreadyAskedFor

limitedmap<uint256, int64_t> mapAlreadyAskedFor
extern

◆ mapLocalHost

std::map<CNetAddr, LocalServiceInfo> mapLocalHost
extern

Definition at line 73 of file net.cpp.

◆ strSubVersion

std::string strSubVersion
extern

Subversion as sent to the P2P network in version messages.

Definition at line 75 of file net.cpp.