etherpkt.cc revision 572
19814Sandreas.hansson@arm.com/* 22292SN/A * Copyright (c) 2004 The Regents of The University of Michigan 312216Snikos.nikoleris@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 292292SN/A#include <iostream> 302292SN/A 312292SN/A#include "dev/etherpkt.hh" 322292SN/A#include "sim/serialize.hh" 332292SN/A 342292SN/Ausing namespace std; 352292SN/A 362292SN/Avoid 372292SN/AEtherPacket::serialize(ostream &os) 382292SN/A{ 392292SN/A SERIALIZE_SCALAR(length); 402292SN/A SERIALIZE_ARRAY(data, length); 412689Sktlim@umich.edu} 422689Sktlim@umich.edu 432689Sktlim@umich.eduvoid 442292SN/AEtherPacket::unserialize(Checkpoint *cp, const std::string §ion) 452292SN/A{ 469944Smatt.horsnell@ARM.com UNSERIALIZE_SCALAR(length); 479944Smatt.horsnell@ARM.com data = new uint8_t[length]; 489944Smatt.horsnell@ARM.com UNSERIALIZE_ARRAY(data, length); 498591Sgblack@eecs.umich.edu} 503326Sktlim@umich.edu 518229Snate@binkert.org