author | Gustavo J. A. M. Carneiro <gjc@inescporto.pt> |
Mon, 07 Jul 2008 12:18:05 +0100 | |
changeset 3448 | 0bd851bb1225 |
parent 3444 | a6d76b454df4 |
child 3449 | c3dcecc4825a |
permissions | -rw-r--r-- |
3439
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
2 |
/* |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
3 |
* This program is free software; you can redistribute it and/or modify |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
4 |
* it under the terms of the GNU General Public License version 2 as |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
5 |
* published by the Free Software Foundation; |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
6 |
* |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
7 |
* This program is distributed in the hope that it will be useful, |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
8 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
9 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
10 |
* GNU General Public License for more details. |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
11 |
* |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
12 |
* You should have received a copy of the GNU General Public License |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
13 |
* along with this program; if not, write to the Free Software |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
14 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
15 |
* |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
16 |
* Author: Gustavo Carneiro <gjc@inescporto.pt> |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
17 |
*/ |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
18 |
#ifndef BRIDGE_NET_DEVICE_H |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
19 |
#define BRIDGE_NET_DEVICE_H |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
20 |
|
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
21 |
#include "ns3/net-device.h" |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
22 |
#include "ns3/mac48-address.h" |
3444
a6d76b454df4
Add the 'learning' part of the Learning Bridge, with option to disable it and revert to dummy mode (hub-like).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3443
diff
changeset
|
23 |
#include "ns3/nstime.h" |
3439
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
24 |
#include <stdint.h> |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
25 |
#include <string> |
3444
a6d76b454df4
Add the 'learning' part of the Learning Bridge, with option to disable it and revert to dummy mode (hub-like).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3443
diff
changeset
|
26 |
#include <map> |
3439
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
27 |
|
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
28 |
namespace ns3 { |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
29 |
|
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
30 |
class Node; |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
31 |
|
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
32 |
/** |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
33 |
* \ingroup netdevice |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
34 |
* |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
35 |
* \brief bridge net device for bridge things and testing |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
36 |
*/ |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
37 |
class BridgeNetDevice : public NetDevice |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
38 |
{ |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
39 |
public: |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
40 |
static TypeId GetTypeId (void); |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
41 |
BridgeNetDevice (); |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
42 |
|
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
43 |
void AddBridgePort (Ptr<NetDevice> bridgePort); |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
44 |
|
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
45 |
// inherited from NetDevice base class. |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
46 |
virtual void SetName(const std::string name); |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
47 |
virtual std::string GetName(void) const; |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
48 |
virtual void SetIfIndex(const uint32_t index); |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
49 |
virtual uint32_t GetIfIndex(void) const; |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
50 |
virtual Ptr<Channel> GetChannel (void) const; |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
51 |
virtual Address GetAddress (void) const; |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
52 |
virtual bool SetMtu (const uint16_t mtu); |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
53 |
virtual uint16_t GetMtu (void) const; |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
54 |
virtual bool IsLinkUp (void) const; |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
55 |
virtual void SetLinkChangeCallback (Callback<void> callback); |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
56 |
virtual bool IsBroadcast (void) const; |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
57 |
virtual Address GetBroadcast (void) const; |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
58 |
virtual bool IsMulticast (void) const; |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
59 |
virtual Address GetMulticast (void) const; |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
60 |
virtual Address MakeMulticastAddress (Ipv4Address multicastGroup) const; |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
61 |
virtual bool IsPointToPoint (void) const; |
3443
9bb81eb18fed
Use NetDevice::SendFrom where appropriate, in order to preserve source address of bridged mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3439
diff
changeset
|
62 |
virtual bool Send (Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber); |
9bb81eb18fed
Use NetDevice::SendFrom where appropriate, in order to preserve source address of bridged mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3439
diff
changeset
|
63 |
virtual bool SendFrom (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber); |
3439
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
64 |
virtual Ptr<Node> GetNode (void) const; |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
65 |
virtual void SetNode (Ptr<Node> node); |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
66 |
virtual bool NeedsArp (void) const; |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
67 |
virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb); |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
68 |
|
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
69 |
protected: |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
70 |
virtual void DoDispose (void); |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
71 |
|
3448
0bd851bb1225
Simplify promiscuous mode API: NetDevices always operate in promiscuous mode, normal receive callbacks receive extra destination address and packet type.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3444
diff
changeset
|
72 |
void ReceiveFromDevice (Ptr<NetDevice> device, Ptr<Packet> packet, uint16_t protocol, |
0bd851bb1225
Simplify promiscuous mode API: NetDevices always operate in promiscuous mode, normal receive callbacks receive extra destination address and packet type.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3444
diff
changeset
|
73 |
Address const &source, Address const &destination, PacketType packetType); |
3444
a6d76b454df4
Add the 'learning' part of the Learning Bridge, with option to disable it and revert to dummy mode (hub-like).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3443
diff
changeset
|
74 |
void ForwardUnicast (Ptr<NetDevice> incomingPort, Ptr<Packet> packet, |
a6d76b454df4
Add the 'learning' part of the Learning Bridge, with option to disable it and revert to dummy mode (hub-like).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3443
diff
changeset
|
75 |
uint16_t protocol, Mac48Address src, Mac48Address dst); |
a6d76b454df4
Add the 'learning' part of the Learning Bridge, with option to disable it and revert to dummy mode (hub-like).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3443
diff
changeset
|
76 |
void ForwardBroadcast (Ptr<NetDevice> incomingPort, Ptr<Packet> packet, |
a6d76b454df4
Add the 'learning' part of the Learning Bridge, with option to disable it and revert to dummy mode (hub-like).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3443
diff
changeset
|
77 |
uint16_t protocol, Mac48Address src, Mac48Address dst); |
a6d76b454df4
Add the 'learning' part of the Learning Bridge, with option to disable it and revert to dummy mode (hub-like).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3443
diff
changeset
|
78 |
void Learn (Mac48Address source, Ptr<NetDevice> port); |
a6d76b454df4
Add the 'learning' part of the Learning Bridge, with option to disable it and revert to dummy mode (hub-like).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3443
diff
changeset
|
79 |
Ptr<NetDevice> GetLearnedState (Mac48Address source); |
3439
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
80 |
|
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
81 |
private: |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
82 |
NetDevice::ReceiveCallback m_rxCallback; |
3444
a6d76b454df4
Add the 'learning' part of the Learning Bridge, with option to disable it and revert to dummy mode (hub-like).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3443
diff
changeset
|
83 |
|
a6d76b454df4
Add the 'learning' part of the Learning Bridge, with option to disable it and revert to dummy mode (hub-like).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3443
diff
changeset
|
84 |
Mac48Address m_address; |
a6d76b454df4
Add the 'learning' part of the Learning Bridge, with option to disable it and revert to dummy mode (hub-like).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3443
diff
changeset
|
85 |
Time m_expirationTime; // time it takes for learned MAC state to expire |
a6d76b454df4
Add the 'learning' part of the Learning Bridge, with option to disable it and revert to dummy mode (hub-like).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3443
diff
changeset
|
86 |
struct LearnedState |
a6d76b454df4
Add the 'learning' part of the Learning Bridge, with option to disable it and revert to dummy mode (hub-like).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3443
diff
changeset
|
87 |
{ |
a6d76b454df4
Add the 'learning' part of the Learning Bridge, with option to disable it and revert to dummy mode (hub-like).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3443
diff
changeset
|
88 |
Ptr<NetDevice> associatedPort; |
a6d76b454df4
Add the 'learning' part of the Learning Bridge, with option to disable it and revert to dummy mode (hub-like).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3443
diff
changeset
|
89 |
Time expirationTime; |
a6d76b454df4
Add the 'learning' part of the Learning Bridge, with option to disable it and revert to dummy mode (hub-like).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3443
diff
changeset
|
90 |
}; |
a6d76b454df4
Add the 'learning' part of the Learning Bridge, with option to disable it and revert to dummy mode (hub-like).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3443
diff
changeset
|
91 |
std::map<Mac48Address, LearnedState> m_learnState; |
3439
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
92 |
Ptr<Node> m_node; |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
93 |
std::string m_name; |
3444
a6d76b454df4
Add the 'learning' part of the Learning Bridge, with option to disable it and revert to dummy mode (hub-like).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3443
diff
changeset
|
94 |
std::vector< Ptr<NetDevice> > m_ports; |
3439
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
95 |
uint32_t m_ifIndex; |
3444
a6d76b454df4
Add the 'learning' part of the Learning Bridge, with option to disable it and revert to dummy mode (hub-like).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3443
diff
changeset
|
96 |
uint16_t m_mtu; |
a6d76b454df4
Add the 'learning' part of the Learning Bridge, with option to disable it and revert to dummy mode (hub-like).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3443
diff
changeset
|
97 |
bool m_enableLearning; |
3439
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
98 |
}; |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
99 |
|
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
100 |
} // namespace ns3 |
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
101 |
|
a64d1da0d6bf
Start of a BridgeNetDevice; for now does not yet do the 'learning' part, and does not preserve the source address of mac frames.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
102 |
#endif /* BRIDGE_NET_DEVICE_H */ |