etherint.hh (13770:ca0cf0ef7051) | etherint.hh (13782:9f6654f478e2) |
---|---|
1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 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; --- 46 unchanged lines hidden (view full) --- 55 public: 56 EtherInt(const std::string &name, int idx=InvalidPortID) 57 : Port(name, idx), portName(name), peer(NULL) {} 58 virtual ~EtherInt() {} 59 60 /** Return port name (for DPRINTF). */ 61 const std::string &name() const { return portName; } 62 | 1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 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; --- 46 unchanged lines hidden (view full) --- 55 public: 56 EtherInt(const std::string &name, int idx=InvalidPortID) 57 : Port(name, idx), portName(name), peer(NULL) {} 58 virtual ~EtherInt() {} 59 60 /** Return port name (for DPRINTF). */ 61 const std::string &name() const { return portName; } 62 |
63 void bind(Port &peer) override; 64 void unbind() override; 65 |
|
63 void setPeer(EtherInt *p); 64 EtherInt* getPeer() { return peer; } 65 66 void recvDone() { peer->sendDone(); } 67 virtual void sendDone() = 0; 68 69 bool sendPacket(EthPacketPtr packet) 70 { return peer ? peer->recvPacket(packet) : true; } 71 virtual bool recvPacket(EthPacketPtr packet) = 0; 72 73 bool askBusy() {return peer->isBusy(); } 74 virtual bool isBusy() { return false; } 75}; 76 77#endif // __DEV_NET_ETHERINT_HH__ | 66 void setPeer(EtherInt *p); 67 EtherInt* getPeer() { return peer; } 68 69 void recvDone() { peer->sendDone(); } 70 virtual void sendDone() = 0; 71 72 bool sendPacket(EthPacketPtr packet) 73 { return peer ? peer->recvPacket(packet) : true; } 74 virtual bool recvPacket(EthPacketPtr packet) = 0; 75 76 bool askBusy() {return peer->isBusy(); } 77 virtual bool isBusy() { return false; } 78}; 79 80#endif // __DEV_NET_ETHERINT_HH__ |