--- a/src/devices/wifi/wifi-channel.h Wed Oct 24 20:43:22 2007 +0200
+++ b/src/devices/wifi/wifi-channel.h Fri Oct 26 13:14:14 2007 +0200
@@ -33,20 +33,76 @@
class PropagationLossModel;
class PropagationDelayModel;
+/**
+ * \brief A 802.11 Channel
+ *
+ * This channel subclass can be used to connect together a set of
+ * ns3::WifiNetDevice network interfaces. A WifiChannel contains
+ * a PropagationLossModel and a PropagationDelayModel which can
+ * be overriden by the WifiChannel::SetPropagationLossModel
+ * and the WifiChannel::SetPropagationDelayModel methods. By default,
+ * The PropagationDelayModel is a ns3::ConstantSpeedPropagationModel,
+ * and the PropagationLossModel is a ns3::PathLossPropagationModel.
+ */
class WifiChannel : public Channel
{
public:
+ /**
+ * arg1: the packet to receive
+ * arg2: the rx power of the packet to receive (dbm)
+ * arg3: the tx mode of the packet to receive
+ * arg4: the preamble of the packet to receive
+ */
typedef Callback<void,Packet,double,WifiMode,WifiPreamble> ReceiveCallback;
WifiChannel ();
virtual ~WifiChannel ();
+ /**
+ * \returns the number of network interfaces connected to
+ * this channel.
+ *
+ * Overriden from the NetDevice base class.
+ */
virtual uint32_t GetNDevices (void) const;
+ /**
+ * \param i index of the requested network interface.
+ * \returns the requested network interfaces connected to
+ * this channel.
+ *
+ * Overriden from the NetDevice base class.
+ * Indexes start at 0 and end at n-1.
+ */
virtual Ptr<NetDevice> GetDevice (uint32_t i) const ;
+ /**
+ * \param loss the new propagation loss model.
+ */
void SetPropationLossModel (Ptr<PropagationLossModel> loss);
+ /**
+ * \param loss the new propagation delay model.
+ */
void SetPropagationDelayModel (Ptr<PropagationDelayModel> delay);
+ /**
+ * \param device the device to add to the list of connected
+ * devices.
+ * \param callback the callback to invoke when a packet must
+ * be received.
+ *
+ * This method should not be invoked by normal users. It is
+ * currently invoked only from WifiPhy::SetChannel.
+ */
void Add (Ptr<NetDevice> device, ReceiveCallback callback);
+ /**
+ * \param sender the device from which the packet is originating.
+ * \param packet the packet to send
+ * \param txPowerDbm the tx power associated to the packet
+ * \param wifiMode the tx mode associated to the packet
+ * \param preamble the preamble associated to the packet
+ *
+ * This method should not be invoked by normal users. It is
+ * currently invoked only from WifiPhy::Send.
+ */
void Send (Ptr<NetDevice> sender, const Packet &packet, double txPowerDbm,
WifiMode wifiMode, WifiPreamble preamble) const;
--- a/src/devices/wifi/wifi-net-device.h Wed Oct 24 20:43:22 2007 +0200
+++ b/src/devices/wifi/wifi-net-device.h Fri Oct 26 13:14:14 2007 +0200
@@ -42,14 +42,34 @@
class MacHighNqsta;
class MacHighNqap;
+/**
+ * \brief the base class for 802.11 network interfaces
+ *
+ */
class WifiNetDevice : public NetDevice {
public:
virtual ~WifiNetDevice ();
+ /**
+ * \param channel the channel to connect this 802.11
+ * interface to.
+ */
void ConnectTo (Ptr<WifiChannel> channel);
+ /**
+ * \returns the Mac48Address of this 802.11 interface.
+ *
+ * This method is equivalent to NetDevice::GetAddress. The only
+ * difference is its return type.
+ */
Mac48Address GetSelfAddress (void) const;
+ /**
+ * \returns the bssid of this 802.11 interface.
+ */
virtual Mac48Address GetBssid (void) const = 0;
+ /**
+ * \returns the ssid of this 802.11 interface.
+ */
virtual Ssid GetSsid (void) const = 0;
private:
@@ -82,6 +102,12 @@
MacParameters *m_parameters;
};
+/**
+ * \brief a 802.11 adhoc network interface
+ *
+ * This network interface is a very simple pass-through
+ * from the higher layers down to the MAC DCF layer.
+ */
class AdhocWifiNetDevice : public WifiNetDevice {
public:
AdhocWifiNetDevice (Ptr<Node> node);
@@ -103,6 +129,16 @@
MacHighAdhoc *m_high;
};
+/**
+ * \brief a 802.11 STA network interface
+ *
+ * This network interface implements the MAC-level STA
+ * active probing, association, and disassociation prototols.
+ *
+ * By default, it starts a new probing phase whenever a new
+ * data packet must be sent and the STA is not yet associated
+ * to the AP.
+ */
class NqstaWifiNetDevice : public WifiNetDevice
{
public:
@@ -111,6 +147,13 @@
virtual Mac48Address GetBssid (void) const;
virtual Ssid GetSsid (void) const;
+
+ /**
+ * \param ssid the ssid we want to associate with
+ *
+ * Start a new active probing phase with the specified
+ * ssid.
+ */
void StartActiveAssociation (Ssid ssid);
protected:
virtual void DoDispose (void);
@@ -125,6 +168,14 @@
MacHighNqsta *m_high;
};
+/**
+ * \brief a 802.11 AP network interface
+ *
+ * This network interface implements the MAC-level
+ * AP-side of the beacon, probing, and, association
+ * protocols. By default, every STA which tries
+ * to associate is accepted.
+ */
class NqapWifiNetDevice : public WifiNetDevice
{
public: