21 CtlPkt reqCp(CtlPkt::CLIENT_ADD_COMTREE,CtlPkt::REQUEST,0);
34 CtlPkt reqCp(CtlPkt::CLIENT_DROP_COMTREE,CtlPkt::REQUEST,0);
49 ipa_t clientIp, ipp_t clientPort,
CtlPkt& repCp) {
50 CtlPkt reqCp(CtlPkt::CLIENT_JOIN_COMTREE,CtlPkt::REQUEST,0);
52 reqCp.ip1 = clientIp; reqCp.port1 = clientPort;
66 ipa_t clientIp, ipp_t clientPort,
CtlPkt& repCp) {
67 CtlPkt reqCp(CtlPkt::CLIENT_LEAVE_COMTREE,CtlPkt::REQUEST,0);
69 reqCp.ip1 = clientIp; reqCp.port1 = clientPort;
83 CtlPkt reqCp(CtlPkt::ADD_IFACE,CtlPkt::REQUEST,0);
98 CtlPkt reqCp(CtlPkt::DROP_IFACE,CtlPkt::REQUEST,0);
113 CtlPkt reqCp(CtlPkt::MOD_IFACE,CtlPkt::REQUEST,0);
116 reqCp.rspec1 = rates;
128 CtlPkt reqCp(CtlPkt::GET_IFACE,CtlPkt::REQUEST,0);
148 ipa_t peerIp, ipp_t peerPort,
fAdr_t peerAdr,
149 uint64_t nonce,
CtlPkt& repCp) {
150 CtlPkt reqCp(CtlPkt::ADD_LINK,CtlPkt::REQUEST,0);
152 reqCp.ip1 = peerIp; reqCp.port1 = peerPort; reqCp.adr1 = peerAdr;
169 uint64_t nonce,
CtlPkt& repCp) {
170 CtlPkt reqCp(CtlPkt::ADD_LINK,CtlPkt::REQUEST,0);
184 CtlPkt reqCp(CtlPkt::DROP_LINK,CtlPkt::REQUEST,0);
185 if (link != 0) reqCp.
link = link;
186 if (peerAdr != 0) reqCp.adr1 = peerAdr;
199 CtlPkt reqCp(CtlPkt::MOD_LINK,CtlPkt::REQUEST,0);
200 reqCp.
link = link; reqCp.rspec1 = rates;
212 CtlPkt reqCp(CtlPkt::GET_LINK,CtlPkt::REQUEST,0);
227 CtlPkt reqCp(CtlPkt::GET_LINK_SET,CtlPkt::REQUEST,0);
228 reqCp.index1 = link; reqCp.
count = count;
242 CtlPkt reqCp(CtlPkt::GET_COMTREE_SET,CtlPkt::REQUEST,0);
243 reqCp.index1 = link; reqCp.
count = count;
257 CtlPkt reqCp(CtlPkt::GET_IFACE_SET,CtlPkt::REQUEST,0);
258 reqCp.index1 = iface; reqCp.
count = count;
272 CtlPkt reqCp(CtlPkt::GET_ROUTE_SET,CtlPkt::REQUEST,0);
273 reqCp.index1 = route; reqCp.
count = count;
285 CtlPkt reqCp(CtlPkt::ADD_COMTREE,CtlPkt::REQUEST,0);
298 CtlPkt reqCp(CtlPkt::DROP_COMTREE,CtlPkt::REQUEST,0);
313 int coreFlag,
CtlPkt& repCp) {
314 CtlPkt reqCp(CtlPkt::MOD_COMTREE,CtlPkt::REQUEST,0);
328 CtlPkt reqCp(CtlPkt::GET_COMTREE,CtlPkt::REQUEST,0);
343 int peerCoreFlag,
CtlPkt& repCp) {
344 CtlPkt reqCp(CtlPkt::ADD_COMTREE_LINK,CtlPkt::REQUEST,0);
361 CtlPkt reqCp(CtlPkt::ADD_COMTREE_LINK,CtlPkt::REQUEST,0);
362 reqCp.
comtree = comtree; reqCp.adr1 = peerAdr;
395 CtlPkt reqCp(CtlPkt::DROP_COMTREE_LINK,CtlPkt::REQUEST,0);
397 if (link == 0 && peerAdr == 0) {
398 logger->
log(
"CpHandler::dropLink: link, peerAdr both 0", 2);
401 if (link != 0) reqCp.
link = link;
402 else if (peerAdr != 0) reqCp.adr1 = peerAdr;
434 CtlPkt reqCp(CtlPkt::MOD_COMTREE_LINK,CtlPkt::REQUEST,0);
436 reqCp.
link = link; reqCp.rspec1 = rates;
449 CtlPkt reqCp(CtlPkt::GET_COMTREE_LINK,CtlPkt::REQUEST,0);
463 CtlPkt reqCp(CtlPkt::ADD_FILTER,CtlPkt::REQUEST,0);
475 CtlPkt reqCp(CtlPkt::DROP_FILTER,CtlPkt::REQUEST,0);
476 reqCp.index1 = filter;
490 CtlPkt reqCp(CtlPkt::MOD_FILTER,CtlPkt::REQUEST,0);
491 reqCp.index1 = filter; reqCp.
stringData.assign(filterString);
503 CtlPkt reqCp(CtlPkt::GET_FILTER,CtlPkt::REQUEST,0);
504 reqCp.index1 = filter;
518 CtlPkt reqCp(CtlPkt::GET_FILTER_SET,CtlPkt::REQUEST,0);
519 reqCp.index1 = firstFilter; reqCp.
count = count;
530 CtlPkt reqCp(CtlPkt::GET_LOGGED_PACKETS,CtlPkt::REQUEST,0);
543 CtlPkt reqCp(CtlPkt::ENABLE_PACKET_LOG,CtlPkt::REQUEST,0);
544 reqCp.index1 = (on ? 1 : 0); reqCp.
index2 = (local ? 1 : 0);
557 CtlPkt reqCp(CtlPkt::NEW_SESSION,CtlPkt::REQUEST,0);
558 reqCp.ip1 = clientIp; reqCp.rspec1 = rates;
572 CtlPkt reqCp(CtlPkt::CANCEL_SESSION,CtlPkt::REQUEST,0);
573 reqCp.adr1 = clientAdr; reqCp.adr2 =
rtrAdr;
586 CtlPkt reqCp(CtlPkt::CLIENT_CONNECT,CtlPkt::REQUEST,0);
587 reqCp.adr1 = clientAdr; reqCp.adr2 =
rtrAdr;
600 CtlPkt reqCp(CtlPkt::CLIENT_DISCONNECT,CtlPkt::REQUEST,0);
601 reqCp.adr1 = clientAdr; reqCp.adr2 =
rtrAdr;
612 CtlPkt reqCp(CtlPkt::BOOT_ROUTER,CtlPkt::REQUEST,0);
630 CtlPkt reqCp(CtlPkt::CONFIG_LEAF,CtlPkt::REQUEST,0);
631 reqCp.adr1 = leafAdr; reqCp.adr2 =
rtrAdr;
647 CtlPkt reqCp(CtlPkt::SET_LEAF_RANGE,CtlPkt::REQUEST,0);
648 reqCp.adr1 = first; reqCp.adr2 = last;
659 CtlPkt reqCp(CtlPkt::BOOT_LEAF,CtlPkt::REQUEST,0);
669 CtlPkt reqCp(CtlPkt::BOOT_COMPLETE,CtlPkt::REQUEST,0);
680 CtlPkt reqCp(CtlPkt::BOOT_ABORT,CtlPkt::REQUEST,0);
699 logger->
log(
"CpHandler::sendRequest: no packets "
700 "left in packet store\n",4,cp);
705 if (cp.
mode == CtlPkt::REQUEST) cp.
seqNum = 0;
707 int plen = cp.
pack();
709 logger->
log(
"CpHandler::sendRequest: packing error\n",4,cp);
713 if (cp.
type < CtlPkt::CLIENT_NET_SIG_SEP) {
722 if (cp.
mode != CtlPkt::REQUEST) {
748 logger->
log(
"CpHandler::sendAndWait: no packets "
749 "left in packet store\n",4,p);
755 for (
int i = 1; i < 3; i++) {
756 pktx reply =
inq->
deq(1000000000);
757 if (reply == Queue::TIMEOUT) {
761 logger->
log(
"CpHandler::sendAndWait: no "
762 "packets left in packet store\n",
776 if (repCp.mode == CtlPkt::NEG_REPLY) {
777 logger->
log(
"CpHandler::sendAndWait: negative "
778 "reply (" + repCp.errMsg +
779 ") to control packet",1,pr);
784 logger->
log(
"CpHandler::sendAndWait: no response to control packet",
800 logger->
log(
"CpHandler::sendRequest: no packets "
801 "left in packet store\n",4,cp);
806 int plen = cp.
pack();
808 logger->
log(
"CpHandler::sendRequest: packing error\n",4,cp);
812 if (cp.
type < CtlPkt::CLIENT_NET_SIG_SEP) {