bug 641: forgot to add files.

This commit is contained in:
Mathieu Lacage
2009-08-14 12:25:16 +02:00
parent add3b122d5
commit 202ac1ff1e
2 changed files with 94 additions and 0 deletions

51
src/devices/wifi/dcf.cc Normal file
View File

@@ -0,0 +1,51 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2005 INRIA
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
*/
#include "dcf.h"
#include "ns3/uinteger.h"
namespace ns3 {
NS_OBJECT_ENSURE_REGISTERED (Dcf);
TypeId
Dcf::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::Dcf")
.SetParent<Object> ()
.AddAttribute ("MinCw", "The minimum value of the contention window.",
UintegerValue (15),
MakeUintegerAccessor (&Dcf::SetMinCw,
&Dcf::GetMinCw),
MakeUintegerChecker<uint32_t> ())
.AddAttribute ("MaxCw", "The maximum value of the contention window.",
UintegerValue (1023),
MakeUintegerAccessor (&Dcf::SetMaxCw,
&Dcf::GetMaxCw),
MakeUintegerChecker<uint32_t> ())
.AddAttribute ("Aifsn", "The AIFSN: the default value conforms to simple DCA.",
UintegerValue (2),
MakeUintegerAccessor (&Dcf::SetAifsn,
&Dcf::GetAifsn),
MakeUintegerChecker<uint32_t> ())
;
return tid;
}
} // namespace ns3

43
src/devices/wifi/dcf.h Normal file
View File

@@ -0,0 +1,43 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2005 INRIA
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
*/
#ifndef DCF_H
#define DCF_H
#include "ns3/object.h"
namespace ns3 {
class Dcf : public Object
{
public:
static TypeId GetTypeId (void);
virtual void SetMinCw (uint32_t minCw) = 0;
virtual void SetMaxCw (uint32_t maxCw) = 0;
virtual void SetAifsn (uint32_t aifsn) = 0;
virtual uint32_t GetMinCw (void) const = 0;
virtual uint32_t GetMaxCw (void) const = 0;
virtual uint32_t GetAifsn (void) const = 0;
};
} // namespace ns3
#endif /* DCF_H */