23 using namespace TTEthernetModel;
45 if (msg->arrivedOn(
"in"))
47 EtherFrame *frame = (EtherFrame*) msg;
49 int i = msg->findPar(
"received");
54 par = &msg->addPar(
"received");
55 par->setLongValue(((
TTEScheduler*)getParentModule()->getParentModule()->getSubmodule(
"tteScheduler"))->getTicks());
57 i = msg->findPar(
"received_total");
61 par = &msg->addPar(
"received_total");
62 par->setLongValue(((
TTEScheduler*)getParentModule()->getParentModule()->getSubmodule(
"tteScheduler"))->getTotalTicks());
65 i = msg->findPar(
"received_port");
69 par = &msg->addPar(
"received_port");
70 par->setLongValue(getParentModule()->getIndex());
75 std::map<uint16_t, std::list<Incoming *> >::iterator incomingList =
incomings.find(
getCTID(frame));
79 for (std::list<Incoming*>::iterator incoming = incomingList->second.begin(); incoming
80 != incomingList->second.end(); incoming++)
82 sendDirect(frame->dup(), (*incoming)->gate(
"in"));
91 bubble(
"No matching buffer configured");
92 getDisplayString().setTagArg(
"i2", 0,
"status/excl3");
93 getDisplayString().setTagArg(
"tt", 0,
"WARNING: Input configuration problem - No matching buffer configured");
94 getParentModule()->getDisplayString().setTagArg(
"i2", 0,
"status/excl3");
95 getParentModule()->getDisplayString().setTagArg(
"tt", 0,
"WARNING: Input configuration problem - No matching buffer configured");
96 getParentModule()->getParentModule()->getDisplayString().setTagArg(
"i2", 0,
"status/excl3");
97 getParentModule()->getParentModule()->getDisplayString().setTagArg(
"tt", 0,
"WARNING: Input configuration problem - No matching buffer configured");
110 address.setAddress(frame->getArrivalGate()->getPathStartGate()->getOwnerModule()->par(
"address"));
111 if(frame->getDest().equals(address)){
123 ctMask = (uint32_t)par(
"ct_mask").longValue();
124 ctMarker = (uint32_t)par(
"ct_marker").longValue();
129 std::string incomingsString = par(
"incomings").stdstringValue();
130 std::vector<std::string> incomingPaths;
131 split(incomingsString,
',',incomingPaths);
132 for(std::vector<std::string>::iterator incomingPath = incomingPaths.begin();
133 incomingPath!=incomingPaths.end();incomingPath++){
134 cModule* module = simulation.getModuleByPath((*incomingPath).c_str());
138 Buffer *buffer =
dynamic_cast<Buffer*
> (incoming->gate(
"out")->getPathEndGate()->getOwner());
139 if(buffer && buffer->hasPar(
"ct_id")){
140 incomings[buffer->par(
"ct_id").longValue()].push_back(incoming);
146 ev<<
"Configuration problem: Module "<<(*incomingPath)<<
" could not be resolved or is no Incoming CTC Module, or module is not connected to a buffer!"<<endl;
147 getDisplayString().setTagArg(
"i2", 0,
"status/excl3");
148 getDisplayString().setTagArg(
"tt", 0,
"WARNING: Configuration Problem Input Buffers!");
156 unsigned char macBytes[6];
157 frame->getDest().getAddressBytes(macBytes);
159 if ((((macBytes[0] << 24) | (macBytes[1] << 16) | (macBytes[2] << 8) | (macBytes[3])) &
ctMask) == (
ctMarker
170 unsigned char macBytes[6];
171 frame->getDest().getAddressBytes(macBytes);
172 return (macBytes[4] << 8) | macBytes[5];