43 string toString()
const;
44 friend ostream& operator<<(ostream& out,
const Entry& a) {
45 return out << a.toString();
54 bool valid(
int)
const;
62 int lookup(ipa_t, ipp_t)
const;
63 int lookup(uint64_t)
const;
70 int addEntry(
int,ipa_t,ipp_t,uint64_t);
75 bool connect(
int lnk, ipa_t peerIp, ipp_t peerPort);
83 char*
pack(
int,
char*)
const;
90 HashMap<uint64_t,Entry,Hash::u64> *
map;
95 uint64_t
hashkey(ipa_t, ipp_t)
const;
99 LinkTable::Entry::Entry() {
105 LinkTable::Entry::Entry(
const Entry& e) {
107 peerIp = e.peerIp; peerPort = e.peerPort;
108 peerType = e.peerType; peerAdr = e.peerAdr;
109 isConnected = e.isConnected; nonce = e.nonce;
110 rates = e.rates; availRates = e.availRates;
113 string LinkTable::Entry::toString()
const {
115 ss << setw(6) << iface <<
" ";
117 <<
":" << setw(5) << left << peerPort <<
" ";
118 ss << setw(10) << left << Forest::nodeType2string(peerType);
120 ss <<
" " << rates.toString();
121 ss <<
" " << availRates.toString();
154 return (((uint64_t) ipa) << 32) | ((uint64_t) ipp);
173 return map->find(nonce);
191 return map->getValue(lnk);