24 if (
buffer == 0)
return false;
26 uint32_t x = ntohl(b[0]);
28 length = (x >> 16) & 0xfff;
43 if (
buffer == 0)
return false;
47 | ((
type & 0xff) << 8)
86 int flgs, comt;
string ptypString;
89 if (!Util::readInt(in,
length) ||
90 !Util::readWord(in,ptypString) ||
91 !Util::readInt(in,flgs) ||
92 !Util::readInt(in,comt) ||
105 else Util::fatal(
"Packet::getPacket: invalid packet type");
107 if (
buffer == 0)
return true;
110 for (
int i = 0; i < min(8,(
length-HDRLEN)/4); i++) {
111 if (Util::readInt(in,x)) b[(HDRLEN/4)+i] = htonl(x);
112 else b[(HDRLEN/4)+i] = 0;
127 else if (type == Forest::RTR_CTL) s =
"rtr_ctl ";
128 else if (type == Forest::VOQSTATUS) s =
"voq_status";
141 else if (s ==
"rtr_ctl") type = Forest::RTR_CTL;
142 else if (s ==
"voq_status") type = Forest::VOQSTATUS;
143 else if (s ==
"undef") type = Forest::UNDEF_PKT;
154 ss <<
"len=" << setw(3) <<
length;
164 else if (type == Forest::RTR_CTL) ss <<
"rtr_ctl ";
165 else if (type == Forest::VOQSTATUS) ss <<
"voq_status";
166 else ss <<
"--------- ";
167 ss <<
" flags=" << int(
flags);
168 ss <<
" comt=" << setw(3) <<
comtree;
173 ss << endl;
return ss.str();
177 for (
int i = 0; i < min(8,(length-HDRLEN)/4); i++) {
178 x = ntohl(b[(HDRLEN/4)+i]);