etherpkt.cc revision 2665
11758SN/A/* 21762SN/A * Copyright (c) 2004-2005 The Regents of The University of Michigan 31758SN/A * All rights reserved. 41758SN/A * 51758SN/A * Redistribution and use in source and binary forms, with or without 61758SN/A * modification, are permitted provided that the following conditions are 71758SN/A * met: redistributions of source code must retain the above copyright 81758SN/A * notice, this list of conditions and the following disclaimer; 91758SN/A * redistributions in binary form must reproduce the above copyright 101758SN/A * notice, this list of conditions and the following disclaimer in the 111758SN/A * documentation and/or other materials provided with the distribution; 121758SN/A * neither the name of the copyright holders nor the names of its 131758SN/A * contributors may be used to endorse or promote products derived from 141758SN/A * this software without specific prior written permission. 151758SN/A * 161758SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 171758SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 181758SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 191758SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 201758SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 211758SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 221758SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 231758SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 241758SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 251758SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 261758SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272665Ssaidi@eecs.umich.edu * 282665Ssaidi@eecs.umich.edu * Authors: Nathan Binkert 292665Ssaidi@eecs.umich.edu */ 301758SN/A 312SN/A#include <iostream> 322984Sgblack@eecs.umich.edu 33732SN/A#include "base/misc.hh" 343565Sgblack@eecs.umich.edu#include "dev/etherpkt.hh" 35732SN/A#include "sim/serialize.hh" 362984Sgblack@eecs.umich.edu 373536Sgblack@eecs.umich.eduusing namespace std; 38732SN/A 39732SN/Avoid 401858SN/AEthPacketData::serialize(const string &base, ostream &os) 411717SN/A{ 422683Sktlim@umich.edu paramOut(os, base + ".length", length); 432680Sktlim@umich.edu paramOut(os, base + ".slack", slack); 44676SN/A arrayParamOut(os, base + ".data", data, length); 452710Sstever@eecs.umich.edu} 462SN/A 471858SN/Avoid 482SN/AEthPacketData::unserialize(const string &base, Checkpoint *cp, 491147SN/A const string §ion) 501147SN/A{ 512SN/A paramIn(cp, section, base + ".length", length); 522SN/A paramIn(cp, section, base + ".slack", slack); 532SN/A if (length) 542SN/A arrayParamIn(cp, section, base + ".data", data, length); 552SN/A} 562680Sktlim@umich.edu