00001 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ 00002 /* 00003 * This program is free software; you can redistribute it and/or modify 00004 * it under the terms of the GNU General Public License version 2 as 00005 * published by the Free Software Foundation; 00006 * 00007 * This program is distributed in the hope that it will be useful, 00008 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00009 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00010 * GNU General Public License for more details. 00011 * 00012 * You should have received a copy of the GNU General Public License 00013 * along with this program; if not, write to the Free Software 00014 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00015 * 00016 * Author: Gustavo Carneiro <gjc@inescporto.pt> 00017 */ 00018 #ifndef BRIDGE_CHANNEL_H 00019 #define BRIDGE_CHANNEL_H 00020 00021 #include "ns3/net-device.h" 00022 #include "ns3/channel.h" 00023 #include <vector> 00024 00025 namespace ns3 { 00026 00027 /** 00028 * \ingroup bridge 00029 * 00030 * \brief Virtual channel implementation for bridges (BridgeNetDevice). 00031 * 00032 * Just like BridgeNetDevice aggregates multiple NetDevices, 00033 * BridgeChannel aggregates multiple channels and make them appear as 00034 * a single channel to upper layers. 00035 */ 00036 class BridgeChannel : public Channel 00037 { 00038 public: 00039 static TypeId GetTypeId (void); 00040 BridgeChannel (); 00041 virtual ~BridgeChannel (); 00042 00043 void AddChannel (Ptr<Channel> bridgedChannel); 00044 00045 // virtual methods implementation, from Channel 00046 virtual uint32_t GetNDevices (void) const; 00047 virtual Ptr<NetDevice> GetDevice (uint32_t i) const; 00048 00049 private: 00050 std::vector< Ptr<Channel> > m_bridgedChannels; 00051 00052 }; 00053 00054 } // namespace ns3 00055 00056 #endif /* BRIDGE_CHANNEL_H */