From 202ac1ff1efae8bf0499c46ec7e73271f3558db7 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Fri, 14 Aug 2009 12:25:16 +0200 Subject: [PATCH] bug 641: forgot to add files. --- src/devices/wifi/dcf.cc | 51 +++++++++++++++++++++++++++++++++++++++++ src/devices/wifi/dcf.h | 43 ++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 src/devices/wifi/dcf.cc create mode 100644 src/devices/wifi/dcf.h diff --git a/src/devices/wifi/dcf.cc b/src/devices/wifi/dcf.cc new file mode 100644 index 000000000..c49647ed7 --- /dev/null +++ b/src/devices/wifi/dcf.cc @@ -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 + */ +#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 () + .AddAttribute ("MinCw", "The minimum value of the contention window.", + UintegerValue (15), + MakeUintegerAccessor (&Dcf::SetMinCw, + &Dcf::GetMinCw), + MakeUintegerChecker ()) + .AddAttribute ("MaxCw", "The maximum value of the contention window.", + UintegerValue (1023), + MakeUintegerAccessor (&Dcf::SetMaxCw, + &Dcf::GetMaxCw), + MakeUintegerChecker ()) + .AddAttribute ("Aifsn", "The AIFSN: the default value conforms to simple DCA.", + UintegerValue (2), + MakeUintegerAccessor (&Dcf::SetAifsn, + &Dcf::GetAifsn), + MakeUintegerChecker ()) + ; + return tid; +} + +} // namespace ns3 diff --git a/src/devices/wifi/dcf.h b/src/devices/wifi/dcf.h new file mode 100644 index 000000000..d4fe39b36 --- /dev/null +++ b/src/devices/wifi/dcf.h @@ -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 + */ + +#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 */