etherpkt.cc revision 10905
19814Sandreas.hansson@arm.com/* 22292SN/A * Copyright (c) 2004-2005 The Regents of The University of Michigan 310333Smitch.hayenga@arm.com * All rights reserved. 410239Sbinhpham@cs.rutgers.edu * 57597Sminkyu.jeong@arm.com * Redistribution and use in source and binary forms, with or without 67597Sminkyu.jeong@arm.com * modification, are permitted provided that the following conditions are 77597Sminkyu.jeong@arm.com * met: redistributions of source code must retain the above copyright 87597Sminkyu.jeong@arm.com * notice, this list of conditions and the following disclaimer; 97597Sminkyu.jeong@arm.com * redistributions in binary form must reproduce the above copyright 107597Sminkyu.jeong@arm.com * notice, this list of conditions and the following disclaimer in the 117597Sminkyu.jeong@arm.com * documentation and/or other materials provided with the distribution; 127597Sminkyu.jeong@arm.com * neither the name of the copyright holders nor the names of its 137597Sminkyu.jeong@arm.com * contributors may be used to endorse or promote products derived from 147597Sminkyu.jeong@arm.com * this software without specific prior written permission. 157597Sminkyu.jeong@arm.com * 162292SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 172292SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 182292SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 192292SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 202292SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 212292SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 222292SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 232292SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 242292SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 252292SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 262292SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272292SN/A * 282292SN/A * Authors: Nathan Binkert 292292SN/A */ 302292SN/A 312292SN/A#include <iostream> 322292SN/A 332292SN/A#include "base/misc.hh" 342292SN/A#include "dev/etherpkt.hh" 352292SN/A#include "sim/serialize.hh" 362292SN/A 372292SN/Ausing namespace std; 382292SN/A 392292SN/Avoid 402292SN/AEthPacketData::serialize(const string &base, CheckpointOut &cp) const 412689Sktlim@umich.edu{ 422689Sktlim@umich.edu paramOut(cp, base + ".length", length); 432689Sktlim@umich.edu arrayParamOut(cp, base + ".data", data, length); 442292SN/A} 452292SN/A 469944Smatt.horsnell@ARM.comvoid 479944Smatt.horsnell@ARM.comEthPacketData::unserialize(const string &base, CheckpointIn &cp) 489944Smatt.horsnell@ARM.com{ 498591Sgblack@eecs.umich.edu paramIn(cp, base + ".length", length); 503326Sktlim@umich.edu if (length) 518229Snate@binkert.org arrayParamIn(cp, base + ".data", data, length); 526658Snate@binkert.org} 538887Sgeoffrey.blake@arm.com