28 #include "PacketStore.h"
31 #include "QuManager.h"
34 #include "RouterOutProc.h"
36 using namespace std::chrono;
39 using std::unique_lock;
78 bool setupAllIfaces();
80 void dump(ostream& os);
92 high_resolution_clock::time_point
tZero;
131 bool setupLeafAddresses();
134 bool setAvailRates();
135 void addLocalRoutes();
139 bool allocLeafAdr(
fAdr_t);
141 bool validLeafAdr(
fAdr_t)
const;
142 bool isFreeLeafAdr(
fAdr_t)
const;
144 uint64_t nextSeqNum();
153 int offset = leafAdr->firstOut();
154 if (offset == 0)
return 0;
155 leafAdr->swap(offset);
156 return firstLeafAdr + offset - 1;
165 inline bool Router::allocLeafAdr(
fAdr_t adr) {
166 int offset = (adr - firstLeafAdr) + 1;
167 if (!leafAdr->isOut(offset))
return false;
168 leafAdr->swap(offset);
176 inline void Router::freeLeafAdr(
fAdr_t adr) {
177 int offset = (adr - firstLeafAdr) + 1;
178 if (!leafAdr->isIn(offset))
return;
179 leafAdr->swap(offset);
188 inline bool Router::validLeafAdr(
fAdr_t adr)
const {
189 int offset = (adr - firstLeafAdr) + 1;
190 return leafAdr->isIn(offset);
198 inline bool Router::isFreeLeafAdr(
fAdr_t adr)
const {
199 int offset = (adr - firstLeafAdr) + 1;
200 return leafAdr->isOut(offset);