Skip to content

Commit e0ab128

Browse files
committed
Further clean-ups to remove obsolete MPTCP options code used for MPTCP development version.
1 parent 5e0b22e commit e0ab128

File tree

9 files changed

+9
-193
lines changed

9 files changed

+9
-193
lines changed

src/control.cc

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -223,15 +223,10 @@ bool performNetPerfMeterAddFlow(MessageReader* messageReader,
223223
strncpy((char*)&addFlowMsg->CongestionControl, flow->getTrafficSpec().CongestionControl.c_str(),
224224
std::min(sizeof(addFlowMsg->CongestionControl), flow->getTrafficSpec().CongestionControl.size()));
225225

226-
memset((char*)&addFlowMsg->PathMgr, 0, sizeof(addFlowMsg->PathMgr));
227-
strncpy((char*)&addFlowMsg->PathMgr, flow->getTrafficSpec().PathMgr.c_str(),
228-
std::min(sizeof(addFlowMsg->PathMgr), flow->getTrafficSpec().PathMgr.size()));
229-
226+
// Obsolete fields (used for Linux MPTCP development version):
227+
memset((char*)&addFlowMsg->PathMgr, 0, sizeof(addFlowMsg->PathMgr));
230228
memset((char*)&addFlowMsg->Scheduler, 0, sizeof(addFlowMsg->Scheduler));
231-
strncpy((char*)&addFlowMsg->Scheduler, flow->getTrafficSpec().Scheduler.c_str(),
232-
std::min(sizeof(addFlowMsg->Scheduler), flow->getTrafficSpec().Scheduler.size()));
233-
234-
addFlowMsg->NDiffPorts = htons(flow->getTrafficSpec().NDiffPorts);
229+
addFlowMsg->NDiffPorts = htons(0);
235230

236231
LOG_TRACE
237232
stdlog << format("<R1 sd=%d>", controlSocket) << "\n";
@@ -399,9 +394,6 @@ bool performNetPerfMeterStart(MessageReader* messageReader,
399394
fprintf(configFile, "FLOW%u_NODELAY=\"%s\"\n", flow->getFlowID(), (flow->getTrafficSpec().NoDelay == true) ? "on" : "off");
400395
fprintf(configFile, "FLOW%u_DEBUG=\"%s\"\n", flow->getFlowID(), (flow->getTrafficSpec().Debug == true) ? "on" : "off");
401396
fprintf(configFile, "FLOW%u_CC=\"%s\"\n", flow->getFlowID(), flow->getTrafficSpec().CongestionControl.c_str());
402-
fprintf(configFile, "FLOW%u_PATHMGR=\"%s\"\n", flow->getFlowID(), flow->getTrafficSpec().PathMgr.c_str());
403-
fprintf(configFile, "FLOW%u_SCHEDULER=\"%s\"\n", flow->getFlowID(), flow->getTrafficSpec().Scheduler.c_str());
404-
fprintf(configFile, "FLOW%u_NDIFFPORTS=%u\n", flow->getFlowID(), flow->getTrafficSpec().NDiffPorts);
405397
fprintf(configFile, "FLOW%u_VECTOR_ACTIVE_NODE=\"%s\"\n", flow->getFlowID(), flow->getVectorFile().getName().c_str());
406398
fprintf(configFile, "FLOW%u_VECTOR_PASSIVE_NODE=\"%s\"\n\n", flow->getFlowID(),
407399
Flow::getNodeOutputName(vectorNamePattern, "passive",
@@ -826,18 +818,6 @@ static bool handleNetPerfMeterAddFlow(MessageReader* messageR
826818
congestionControl[sizeof(addFlowMsg->CongestionControl)] = 0x00;
827819
trafficSpec.CongestionControl = std::string(congestionControl);
828820

829-
char pathMgr[sizeof(addFlowMsg->PathMgr) + 1];
830-
memcpy((char*)&pathMgr, (const char*)&addFlowMsg->PathMgr, sizeof(addFlowMsg->PathMgr));
831-
pathMgr[sizeof(addFlowMsg->PathMgr)] = 0x00;
832-
trafficSpec.PathMgr = std::string(pathMgr);
833-
834-
char scheduler[sizeof(addFlowMsg->Scheduler) + 1];
835-
memcpy((char*)&scheduler, (const char*)&addFlowMsg->Scheduler, sizeof(addFlowMsg->Scheduler));
836-
scheduler[sizeof(addFlowMsg->Scheduler)] = 0x00;
837-
trafficSpec.Scheduler = std::string(scheduler);
838-
839-
trafficSpec.NDiffPorts = ntohs(addFlowMsg->NDiffPorts);
840-
841821
Flow* flow = new Flow(ntoh64(addFlowMsg->MeasurementID), ntohl(addFlowMsg->FlowID),
842822
ntohs(addFlowMsg->StreamID), trafficSpec,
843823
controlSocket);

src/flow.cc

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -464,56 +464,6 @@ bool Flow::configureSocket(const int socketDescriptor)
464464
return false;
465465
}
466466

467-
#if 0
468-
// FIXME: OBSOLETE!
469-
if(TrafficSpec.Protocol == IPPROTO_MPTCP) {
470-
// FIXME! Add proper, platform-independent code here!
471-
#ifndef __linux__
472-
#warning MPTCP is currently only available on Linux!
473-
#else
474-
475-
const int debugOption = (TrafficSpec.Debug == true) ? 1 : 0;
476-
if (ext_setsockopt(socketDescriptor, IPPROTO_TCP, MPTCP_DEBUG_LEGACY, (const char*)&debugOption, sizeof(debugOption)) < 0) {
477-
if (ext_setsockopt(socketDescriptor, IPPROTO_TCP, MPTCP_DEBUG, (const char*)&debugOption, sizeof(debugOption)) < 0) {
478-
LOG_WARNING
479-
stdlog << format("Failed to configure debugging level %d (MPTCP_DEBUG option) on MPTCP socket %d: %s!",
480-
debugOption, socketDescriptor, strerror(errno)) << "\n";
481-
LOG_END
482-
}
483-
}
484-
485-
const int nDiffPorts = (int)TrafficSpec.NDiffPorts;
486-
if (ext_setsockopt(socketDescriptor, IPPROTO_TCP, MPTCP_NDIFFPORTS_LEGACY, (const char*)&nDiffPorts, sizeof(nDiffPorts)) < 0) {
487-
if (ext_setsockopt(socketDescriptor, IPPROTO_TCP, MPTCP_NDIFFPORTS, (const char*)&nDiffPorts, sizeof(nDiffPorts)) < 0) {
488-
LOG_WARNING
489-
stdlog << format("Failed to configure number of different ports %d (MPTCP_NDIFFPORTS option) on MPTCP socket %d: %s!",
490-
nDiffPorts, socketDescriptor, strerror(errno)) << "\n";
491-
LOG_END
492-
}
493-
}
494-
495-
const char* pathMgr = TrafficSpec.PathMgr.c_str();
496-
if (ext_setsockopt(socketDescriptor, IPPROTO_TCP, MPTCP_PATH_MANAGER_LEGACY, pathMgr, strlen(pathMgr)) < 0) {
497-
if (ext_setsockopt(socketDescriptor, IPPROTO_TCP, MPTCP_PATH_MANAGER, pathMgr, strlen(pathMgr)) < 0) {
498-
LOG_WARNING
499-
stdlog << format("Failed to configure path manager %s (MPTCP_PATH_MANAGER option) on MPTCP socket %d: %s!",
500-
pathMgr, socketDescriptor, strerror(errno)) << "\n";
501-
LOG_END
502-
}
503-
}
504-
505-
const char* scheduler = TrafficSpec.Scheduler.c_str();
506-
if (ext_setsockopt(socketDescriptor, IPPROTO_TCP, MPTCP_SCHEDULER_LEGACY, scheduler, strlen(scheduler)) < 0) {
507-
if (ext_setsockopt(socketDescriptor, IPPROTO_TCP, MPTCP_SCHEDULER, scheduler, strlen(scheduler)) < 0) {
508-
LOG_WARNING
509-
stdlog << format("Failed to configure scheduler %s (MPTCP_SCHEDULER option) on MPTCP socket %d: %s!",
510-
scheduler, socketDescriptor, strerror(errno)) << "\n";
511-
LOG_END
512-
}
513-
}
514-
#endif
515-
}
516-
#endif
517467
const char* congestionControl = TrafficSpec.CongestionControl.c_str();
518468
if(strcmp(congestionControl, "default") != 0) {
519469
if (ext_setsockopt(socketDescriptor, IPPROTO_TCP, TCP_CONGESTION, congestionControl, strlen(congestionControl)) < 0) {

src/flowtrafficspec.cc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,6 @@ void FlowTrafficSpec::print(std::ostream& os) const
135135
if( (Protocol == IPPROTO_TCP) || (Protocol == IPPROTO_MPTCP) ) {
136136
os << " - Congestion Control: " << CongestionControl << "\n";
137137
}
138-
if(Protocol == IPPROTO_MPTCP) {
139-
os << " - N. of Diff. Ports: " << NDiffPorts << "\n"
140-
<< " - Path Manager: " << PathMgr << "\n"
141-
<< " - Scheduler: " << Scheduler << "\n"
142-
<< " - Debug: "
143-
<< ((Debug == true) ? "yes" : "no") << "\n";
144-
}
145138
if(Protocol == IPPROTO_SCTP) {
146139
os << " - CMT: #" << (unsigned int)CMT << " ";
147140
switch(CMT) {
@@ -185,9 +178,6 @@ void FlowTrafficSpec::reset()
185178
NoDelay = false;
186179
BindV6Only = false;
187180
RepeatOnOff = false;
188-
NDiffPorts = 4;
189-
PathMgr = "fullmesh";
190-
Scheduler = "default";
191181
CongestionControl = "default";
192182
CMT = 0x00;
193183
CCID = 0x00;

src/flowtrafficspec.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,7 @@ class FlowTrafficSpec
8787

8888
uint8_t CMT;
8989
uint8_t CCID;
90-
91-
uint16_t NDiffPorts;
9290
std::string CongestionControl;
93-
std::string PathMgr;
94-
std::string Scheduler;
9591

9692
bool Debug;
9793
bool NoDelay;

src/netperfmeter.1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ A repetition of the list is possible with the keyword "repeat" at the end of the
207207
By default, the active side stops with an error when a transmission tails (e.g. on connection abort). This parameter turns this behaviour on or off.
208208
.It nodelay=on|off
209209
Deactivate Nagle algorithm (TCP and SCTP only; default: off).
210+
.It debug=on|off
211+
Set debug mode for flow (default: off). Note: this is for debugging and testing NetPerfMeter only; it (usually) has no function!
210212
.It v6only
211213
Use socket with IPv6 only (by setting IPV6_V6ONLY socket option).
212214
.It pathmgr=name

src/netperfmeter.bash-completion

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,8 @@ _netperfmeter()
7878
# ====== Generic value ============================================
7979
-activenodename=* | \
8080
-passivenodename=* | \
81-
-pathmgr=* | \
8281
-rcvbuf=* | \
8382
-runtime=* | \
84-
-scheduler=* | \
8583
-sndbuf=*)
8684
cur="${cur#*=}"
8785
return
@@ -130,16 +128,13 @@ ${base}description=
130128
${base}error_on_abort=
131129
${base}id=
132130
${base}maxmsgsize=
133-
${base}ndiffports=
134131
${base}nodelay=
135132
${base}onoff=
136133
${base}ordered=
137-
${base}pathmgr=
138134
${base}rcvbuf=
139135
${base}reliable=
140136
${base}rtx_timeout=
141137
${base}rtx_trials=
142-
${base}scheduler=
143138
${base}sndbuf=
144139
${base}unordered=
145140
${base}unreliable=
@@ -243,8 +238,6 @@ ${base}v6only
243238
-logcolor
244239
-logappend
245240
-logfile
246-
-pathmgr
247-
-scheduler
248241
-sndbuf
249242
-rcvbuf
250243
"

src/netperfmeter.cc

Lines changed: 1 addition & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ static sockaddr_union gLocalControlAddressArray[MAX_LOCAL_ADDRESSES];
5454

5555
static const char* gActiveNodeName = "Client";
5656
static const char* gPassiveNodeName = "Server";
57-
static const char* gPathMgr = "fullmesh";
58-
static const char* gScheduler = "default";
5957
static bool gBindV6Only = false;
6058
static int gSndBufSize = -1;
6159
static int gRcvBufSize = -1;
@@ -93,12 +91,6 @@ bool handleGlobalParameter(char* parameter)
9391
else if(strncmp(parameter, "-passivenodename=", 17) == 0) {
9492
gPassiveNodeName = (const char*)&parameter[17];
9593
}
96-
else if(strncmp(parameter, "-pathmgr=", 9) == 0) {
97-
gPathMgr = (const char*)&parameter[9];
98-
}
99-
else if(strncmp(parameter, "-scheduler=", 11) == 0) {
100-
gScheduler = (const char*)&parameter[11];
101-
}
10294
else if(strncmp(parameter, "-sndbuf=", 8) == 0) {
10395
gSndBufSize = atol((const char*)&parameter[8]);
10496
}
@@ -471,7 +463,7 @@ static const char* parseTrafficSpecOption(const char* parameters,
471463
else if(strncmp(parameters, "debug=", 6) == 0) {
472464
if(strncmp((const char*)&parameters[6], "on", 2) == 0) {
473465
trafficSpec.Debug = true;
474-
n = 6 + 2;
466+
// n = 6 + 2;
475467
}
476468
else if(strncmp((const char*)&parameters[6], "off", 3) == 0) {
477469
trafficSpec.Debug = false;
@@ -482,54 +474,6 @@ static const char* parseTrafficSpecOption(const char* parameters,
482474
exit(1);
483475
}
484476
}
485-
else if(strncmp(parameters, "ndiffports=", 11) == 0) {
486-
unsigned int nDiffPorts;
487-
int pos;
488-
if(sscanf((const char*)&parameters[11], "%u%n", &nDiffPorts, &pos) == 1) {
489-
trafficSpec.NDiffPorts = (uint16_t)nDiffPorts;
490-
n = 11 + pos;
491-
}
492-
}
493-
else if(strncmp(parameters, "pathmgr=", 8) == 0) {
494-
char pathMgr[NETPERFMETER_PATHMGR_LENGTH + 1];
495-
size_t i = 0;
496-
while(i < NETPERFMETER_PATHMGR_LENGTH) {
497-
if( (parameters[8 + i] == ':') ||
498-
(parameters[8 + i] == 0x00) ) {
499-
break;
500-
}
501-
pathMgr[i] = parameters[8 + i];
502-
i++;
503-
}
504-
pathMgr[i] = 0x00;
505-
if( (parameters[8 + i] != ':') && (parameters[8 + i] != 0x00) ) {
506-
std::cerr << "ERROR: Invalid \"pathmgr\" setting: " << (const char*)&parameters[8]
507-
<< " - name too long!\n";
508-
exit(1);
509-
}
510-
trafficSpec.PathMgr = std::string((const char*)&pathMgr);
511-
n = 8 + strlen((const char*)&pathMgr);
512-
}
513-
else if(strncmp(parameters, "scheduler=", 10) == 0) {
514-
char scheduler[NETPERFMETER_SCHEDULER_LENGTH + 1];
515-
size_t i = 0;
516-
while(i < NETPERFMETER_SCHEDULER_LENGTH) {
517-
if( (parameters[10 + i] == ':') ||
518-
(parameters[10 + i] == 0x00) ) {
519-
break;
520-
}
521-
scheduler[i] = parameters[10 + i];
522-
i++;
523-
}
524-
scheduler[i] = 0x00;
525-
if( (parameters[10 + i] != ':') && (parameters[10 + i] != 0x00) ) {
526-
std::cerr << "ERROR: Invalid \"scheduler\" setting: " << (const char*)&parameters[10]
527-
<< " - name too long!\n";
528-
exit(1);
529-
}
530-
trafficSpec.Scheduler = std::string((const char*)&scheduler);
531-
n = 10 + strlen((const char*)&scheduler);
532-
}
533477
else if(strncmp(parameters, "cc=", 3) == 0) {
534478
char congestionControl[NETPERFMETER_CC_LENGTH + 1];
535479
size_t i = 0;
@@ -1043,29 +987,6 @@ void passiveMode(int argc, char** argv, const uint16_t localPort)
1043987
LOG_END
1044988
}
1045989
else {
1046-
#if 0
1047-
// FIXME: OBSOLETE!
1048-
if (ext_setsockopt(gMPTCPSocket, IPPROTO_TCP, MPTCP_PATH_MANAGER_LEGACY, gPathMgr, strlen(gPathMgr)) < 0) {
1049-
if (ext_setsockopt(gMPTCPSocket, IPPROTO_TCP, MPTCP_PATH_MANAGER, gPathMgr, strlen(gPathMgr)) < 0) {
1050-
if(strcmp(gPathMgr, "default") != 0) {
1051-
LOG_WARNING
1052-
stdlog << format("Failed to configure path manager %s (MPTCP_PATH_MANAGER option) on MPTCP socket %d: %s!",
1053-
gPathMgr, gMPTCPSocket, strerror(errno)) << "\n";
1054-
LOG_END
1055-
}
1056-
}
1057-
}
1058-
if (ext_setsockopt(gMPTCPSocket, IPPROTO_TCP, MPTCP_SCHEDULER_LEGACY, gScheduler, strlen(gScheduler)) < 0) {
1059-
if (ext_setsockopt(gMPTCPSocket, IPPROTO_TCP, MPTCP_SCHEDULER, gScheduler, strlen(gScheduler)) < 0) {
1060-
if(strcmp(gScheduler, "default") != 0) {
1061-
LOG_WARNING
1062-
stdlog << format("Failed to configure scheduler %s (MPTCP_SCHEDULER option) on MPTCP socket %d: %s!",
1063-
gScheduler, gMPTCPSocket, strerror(errno)) << "\n";
1064-
LOG_END
1065-
}
1066-
}
1067-
}
1068-
#endif
1069990
if(setBufferSizes(gMPTCPSocket, gSndBufSize, gRcvBufSize) == false) {
1070991
LOG_FATAL
1071992
stdlog << format("Failed to configure buffer sizes on MPTCP socket %d!",

src/netperfmeterpackets.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ struct NetPerfMeterAddFlowMessage
118118
uint8_t CMT;
119119
uint8_t CCID;
120120

121-
uint16_t NDiffPorts;
122-
char PathMgr[NETPERFMETER_PATHMGR_LENGTH];
121+
uint16_t NDiffPorts; // obsolete!
122+
char PathMgr[NETPERFMETER_PATHMGR_LENGTH]; // obsolete!
123123
char CongestionControl[NETPERFMETER_CC_LENGTH];
124-
char Scheduler[NETPERFMETER_SCHEDULER_LENGTH];
124+
char Scheduler[NETPERFMETER_SCHEDULER_LENGTH]; // obsolete!
125125

126126
uint16_t OnOffEvents;
127127
NetPerfMeterOnOffEvent OnOffEvent[];

src/tools.cc

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -658,22 +658,6 @@ int bindSocket(const int sd,
658658
#else
659659
#error IPV6_V6ONLY not defined?! Please create a bug report and provide some information about your OS!
660660
#endif
661-
// FIXME! OBSOLETE!
662-
// FIXME! Add proper, platform-independent code here!
663-
// #ifndef __linux__
664-
// #warning MPTCP is currently only available on Linux!
665-
// #else
666-
// if((protocol == IPPROTO_MPTCP) || (protocol == IPPROTO_TCP)) {
667-
// const int cmtOnOff = (protocol == IPPROTO_MPTCP);
668-
// if(ext_setsockopt(sd, IPPROTO_TCP, MPTCP_ENABLED_LEGACY, &cmtOnOff, sizeof(cmtOnOff)) < 0) {
669-
// if(ext_setsockopt(sd, IPPROTO_TCP, MPTCP_ENABLED, &cmtOnOff, sizeof(cmtOnOff)) < 0) {
670-
// if(protocol == IPPROTO_MPTCP) {
671-
// return -2;
672-
// }
673-
// }
674-
// }
675-
// }
676-
// #endif
677661

678662
// ====== Bind socket ====================================================
679663
if(localAddressCount == 0) {

0 commit comments

Comments
 (0)