Feathercoin  0.5.0
P2P Digital Currency
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Classes | Enumerations | Functions | Variables
net.h File Reference
#include <deque>
#include <boost/array.hpp>
#include <boost/foreach.hpp>
#include <openssl/rand.h>
#include <arpa/inet.h>
#include "mruset.h"
#include "limitedmap.h"
#include "netbase.h"
#include "protocol.h"
#include "addrman.h"
#include "hash.h"
#include "bloom.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

class  CNodeStats
 
class  CNetMessage
 
class  CNode
 Information about a peer. More...
 

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)
 
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 (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

int nBestHeight
 
bool fDiscover
 
uint64 nLocalServices
 
uint64 nLocalHostNonce
 
CAddrMan addrman
 
int nMaxConnections
 
std::vector< CNode * > vNodes
 
CCriticalSection cs_vNodes
 
std::map< CInv, CDataStreammapRelay
 
std::deque< std::pair< int64,
CInv > > 
vRelayExpiration
 
CCriticalSection cs_mapRelay
 
limitedmap< CInv, int64mapAlreadyAskedFor
 
std::vector< std::string > vAddedNodes
 
CCriticalSection cs_vAddedNodes
 

Enumeration Type Documentation

anonymous enum
Enumerator
LOCAL_NONE 
LOCAL_IF 
LOCAL_BIND 
LOCAL_UPNP 
LOCAL_HTTP 
LOCAL_MANUAL 
LOCAL_MAX 

Definition at line 48 of file net.h.

Function Documentation

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

Definition at line 213 of file net.cpp.

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

Definition at line 242 of file net.cpp.

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

Definition at line 419 of file net.cpp.

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

debug print

debug print

Definition at line 457 of file net.cpp.

CNode* FindNode ( const CNetAddr ip)

Definition at line 430 of file net.cpp.

CNode* FindNode ( const CService ip)

Definition at line 448 of file net.cpp.

unsigned short GetListenPort ( )

Definition at line 80 of file net.cpp.

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

Definition at line 97 of file net.cpp.

CAddress GetLocalAddress ( const CNetAddr paddrPeer = NULL)

Definition at line 122 of file net.cpp.

bool GetMyExternalIP ( CNetAddr ipRet)

Definition at line 343 of file net.cpp.

bool IsLimited ( enum Network  net)

Definition at line 256 of file net.cpp.

bool IsLimited ( const CNetAddr addr)

Definition at line 262 of file net.cpp.

bool IsLocal ( const CService addr)

check whether a given address is potentially local

Definition at line 283 of file net.cpp.

bool IsReachable ( const CNetAddr addr)

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

Definition at line 290 of file net.cpp.

void MapPort ( bool  fUseUPnP)

Definition at line 1176 of file net.cpp.

unsigned int ReceiveFloodSize ( )
inline

Definition at line 31 of file net.h.

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

Definition at line 1871 of file net.cpp.

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

Definition at line 1879 of file net.cpp.

bool SeenLocal ( const CService addr)

vote for a local address

Definition at line 268 of file net.cpp.

unsigned int SendBufferSize ( )
inline

Definition at line 32 of file net.h.

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

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

Definition at line 248 of file net.cpp.

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

Definition at line 204 of file net.cpp.

void SocketSendData ( CNode pnode)

Definition at line 707 of file net.cpp.

void StartNode ( boost::thread_group &  threadGroup)

Definition at line 1770 of file net.cpp.

bool StopNode ( )

Definition at line 1813 of file net.cpp.

Variable Documentation

CAddrMan addrman

Definition at line 53 of file net.cpp.

CCriticalSection cs_mapRelay

Definition at line 60 of file net.cpp.

CCriticalSection cs_vAddedNodes

Definition at line 70 of file net.cpp.

CCriticalSection cs_vNodes

Definition at line 57 of file net.cpp.

bool fDiscover

Definition at line 43 of file net.cpp.

limitedmap<CInv, int64> mapAlreadyAskedFor
std::map<CInv, CDataStream> mapRelay

Definition at line 58 of file net.cpp.

int nBestHeight

Definition at line 41 of file main.cpp.

uint64 nLocalHostNonce

Definition at line 51 of file net.cpp.

uint64 nLocalServices

Definition at line 44 of file net.cpp.

int nMaxConnections

Definition at line 54 of file net.cpp.

std::vector<std::string> vAddedNodes

Definition at line 69 of file net.cpp.

std::vector<CNode*> vNodes

Definition at line 56 of file net.cpp.

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

Definition at line 59 of file net.cpp.