Commit a855a8b8 authored by Ryan Jackson's avatar Ryan Jackson

Added EventPipe class and makefile

parent 78482b01
// EventPipe.cc
#include "lib.hh"
#include "EventPipe.hh"
using namespace std;
EventPipe::reset()
{
string command;
command = "/usr/testbed/bin/tevc -e " +
projectName + '/' + experimentName +
" now " + agentName +" MODIFY " +
"BANDWIDTH=1000 " +
"DELAY=0 " +
"PLR=0";
system(command);
}
EventPipe::resetParameter(Parameter const & newParameter)
{
string parameterName;
int parameterValue;
stringstream ss;
string valueString;
string command;
parameterValue = parameter.getValue();
switch(newParameter.getType()) {
case BANDWIDTH:
parameterString = "BANDWITH";
ss << parameterValue;
break;
case DELAY:
parameterString = "DELAY";
ss << parameterValue;
break;
case LOSS:
parameterString = "LOSS";
ss << parameterValue;
break;
}
ss >> valueString;
command = "/usr/testbed/bin/tevc -e " +
projectName + '/' + experimentName +
" now " + agentName + " MODIFY " +
parameterString + '=' + valueString;
system(command);
}
.PHONY: all clean
all: delay-agent
COMMON_OBJS += main.o
LINUX_OBJS += LinuxPipe.o
FREEBSD_OBJS += FreeBSDPipe.o
EVENT_OBJS += EventPipe.o
OBJS += $(COMMON_OBJS)
LIBS += $(COMMON_LIBS)
CXXFLAGS = -Wall
OS =? `uname -s`
ifeq ($(OS), "FreeBSD")
LIBS += $(FREEBSD_LIBS)
LDFLAGS += $(FREEBSD_LDFLAGS)
CXXFLAGS += $(FREEBSD_CXXFLAGS)
OBJS += $(FREEBSD_OBJS)
endif
ifeq ($(OS), "Linux")
LIBS += $(LINUX_LIBS)
LDFLAGS += $(LINUX_LDFLAGS)
CXXFLAGS += $(LINUX_CXXFLAGS)
OBJS += $(LINUX_OBJS)
endif
%.o: %.cc
$(CXX) $(CXXFLAGS) -c $< $@
delay-agent: $(OBJS)
$(CXX) $(LDFLAGS) -o $@ $< $(LIBS)
event-delay-agent: $(COMMON_OBJS) $(EVENT_OBJS)
$(CXX) $(LDFLAGS) -o $@ $< $(LIBS)
clean:
rm -f *.o delay-agent event-delay-agent
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment