Switch.cc (11036:3de670f298b1) Switch.cc (11049:dfb0aa3f0649)
1/*
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
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;

--- 170 unchanged lines hidden (view full) ---

179{
180 // FIXME printing
181 out << "[Switch]";
182}
183
184bool
185Switch::functionalRead(Packet *pkt)
186{
1/*
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
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;

--- 170 unchanged lines hidden (view full) ---

179{
180 // FIXME printing
181 out << "[Switch]";
182}
183
184bool
185Switch::functionalRead(Packet *pkt)
186{
187 // Access the buffers in the switch for performing a functional read
188 for (unsigned int i = 0; i < m_port_buffers.size(); ++i) {
189 if (m_port_buffers[i]->functionalRead(pkt)) {
190 return true;
191 }
192 }
187 return false;
188}
189
190uint32_t
191Switch::functionalWrite(Packet *pkt)
192{
193 // Access the buffers in the switch for performing a functional write
194 uint32_t num_functional_writes = 0;
195 for (unsigned int i = 0; i < m_port_buffers.size(); ++i) {
196 num_functional_writes += m_port_buffers[i]->functionalWrite(pkt);
197 }
198 return num_functional_writes;
199}
200
201Switch *
202SwitchParams::create()
203{
204 return new Switch(this);
205}
193 return false;
194}
195
196uint32_t
197Switch::functionalWrite(Packet *pkt)
198{
199 // Access the buffers in the switch for performing a functional write
200 uint32_t num_functional_writes = 0;
201 for (unsigned int i = 0; i < m_port_buffers.size(); ++i) {
202 num_functional_writes += m_port_buffers[i]->functionalWrite(pkt);
203 }
204 return num_functional_writes;
205}
206
207Switch *
208SwitchParams::create()
209{
210 return new Switch(this);
211}