etherswitch.cc (11800:54436a1784dc) | etherswitch.cc (12087:0e082672ac6b) |
---|---|
1/* 2 * Copyright (c) 2014 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 117 unchanged lines hidden (view full) --- 126} 127 128EtherSwitch::Interface::Interface(const std::string &name, 129 EtherSwitch *etherSwitch, 130 uint64_t outputBufferSize, Tick delay, 131 Tick delay_var, double rate, unsigned id) 132 : EtherInt(name), ticksPerByte(rate), switchDelay(delay), 133 delayVar(delay_var), interfaceId(id), parent(etherSwitch), | 1/* 2 * Copyright (c) 2014 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 117 unchanged lines hidden (view full) --- 126} 127 128EtherSwitch::Interface::Interface(const std::string &name, 129 EtherSwitch *etherSwitch, 130 uint64_t outputBufferSize, Tick delay, 131 Tick delay_var, double rate, unsigned id) 132 : EtherInt(name), ticksPerByte(rate), switchDelay(delay), 133 delayVar(delay_var), interfaceId(id), parent(etherSwitch), |
134 outputFifo(name + ".outputFifo", outputBufferSize), txEvent(this) | 134 outputFifo(name + ".outputFifo", outputBufferSize), 135 txEvent([this]{ transmit(); }, name) |
135{ 136} 137 138bool 139EtherSwitch::Interface::recvPacket(EthPacketPtr packet) 140{ 141 Net::EthAddr destMacAddr(packet->data); 142 Net::EthAddr srcMacAddr(&packet->data[6]); --- 214 unchanged lines hidden --- | 136{ 137} 138 139bool 140EtherSwitch::Interface::recvPacket(EthPacketPtr packet) 141{ 142 Net::EthAddr destMacAddr(packet->data); 143 Net::EthAddr srcMacAddr(&packet->data[6]); --- 214 unchanged lines hidden --- |