dist_etherlink.cc (13766:4ecebdee8da4) dist_etherlink.cc (13784:1941dc118243)
1/*
2 * Copyright (c) 2015 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

56#include "base/trace.hh"
57#include "debug/DistEthernet.hh"
58#include "debug/DistEthernetPkt.hh"
59#include "debug/EthernetData.hh"
60#include "dev/net/dist_iface.hh"
61#include "dev/net/etherdump.hh"
62#include "dev/net/etherint.hh"
63#include "dev/net/etherlink.hh"
1/*
2 * Copyright (c) 2015 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

56#include "base/trace.hh"
57#include "debug/DistEthernet.hh"
58#include "debug/DistEthernetPkt.hh"
59#include "debug/EthernetData.hh"
60#include "dev/net/dist_iface.hh"
61#include "dev/net/etherdump.hh"
62#include "dev/net/etherint.hh"
63#include "dev/net/etherlink.hh"
64#include "dev/net/etherobject.hh"
65#include "dev/net/etherpkt.hh"
66#include "dev/net/tcp_iface.hh"
67#include "params/EtherLink.hh"
68#include "sim/core.hh"
69#include "sim/serialize.hh"
70#include "sim/system.hh"
71
72using namespace std;

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

104DistEtherLink::~DistEtherLink()
105{
106 delete txLink;
107 delete rxLink;
108 delete localIface;
109 delete distIface;
110}
111
64#include "dev/net/etherpkt.hh"
65#include "dev/net/tcp_iface.hh"
66#include "params/EtherLink.hh"
67#include "sim/core.hh"
68#include "sim/serialize.hh"
69#include "sim/system.hh"
70
71using namespace std;

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

103DistEtherLink::~DistEtherLink()
104{
105 delete txLink;
106 delete rxLink;
107 delete localIface;
108 delete distIface;
109}
110
112EtherInt*
113DistEtherLink::getEthPort(const std::string &if_name, int idx)
111Port &
112DistEtherLink::getPort(const std::string &if_name, PortID idx)
114{
113{
115 if (if_name != "int0") {
116 return nullptr;
117 } else {
118 panic_if(localIface->getPeer(), "interface already connected to");
119 }
120 return localIface;
114 if (if_name == "int0")
115 return *localIface;
116 return SimObject::getPort(if_name, idx);
121}
122
123void
124DistEtherLink::serialize(CheckpointOut &cp) const
125{
126 distIface->serializeSection(cp, "distIface");
127 txLink->serializeSection(cp, "txLink");
128 rxLink->serializeSection(cp, "rxLink");

--- 140 unchanged lines hidden ---
117}
118
119void
120DistEtherLink::serialize(CheckpointOut &cp) const
121{
122 distIface->serializeSection(cp, "distIface");
123 txLink->serializeSection(cp, "txLink");
124 rxLink->serializeSection(cp, "rxLink");

--- 140 unchanged lines hidden ---