add new code to build
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Tue, 09 Oct 2007 16:47:34 +0200
changeset 1937 996383a87ae3
parent 1936 61d6404e66d8
child 1938 f7e9802ea8e3
add new code to build
src/devices/wifi/capability-information.cc
src/devices/wifi/capability-information.h
src/devices/wifi/ssid.cc
src/devices/wifi/ssid.h
src/devices/wifi/status-code.cc
src/devices/wifi/status-code.h
src/devices/wifi/wscript
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/devices/wifi/capability-information.cc	Tue Oct 09 16:47:34 2007 +0200
@@ -0,0 +1,28 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2006 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 "capability-information.h"
+
+namespace ns3 {
+
+CapabilityInformation::CapabilityInformation ()
+{}
+
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/devices/wifi/capability-information.h	Tue Oct 09 16:47:34 2007 +0200
@@ -0,0 +1,35 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2006 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 CAPABILITY_INFORMATION_H
+#define CAPABILITY_INFORMATION_H
+
+#include <stdint.h>
+
+namespace ns3 {
+
+class CapabilityInformation {
+public:
+  CapabilityInformation ();
+
+};
+
+} // namespace ns3
+
+#endif /* CAPABILITY_INFORMATION_H */
--- a/src/devices/wifi/ssid.cc	Tue Oct 09 16:40:24 2007 +0200
+++ b/src/devices/wifi/ssid.cc	Tue Oct 09 16:47:34 2007 +0200
@@ -25,6 +25,7 @@
 
 Ssid::Ssid ()
 {
+  m_length = 0;
   for (uint8_t i = 0; i < 33; i++) 
     {
       m_ssid[i] = 0;
@@ -97,28 +98,4 @@
   return size;
 }
 
-void
-Ssid::Peek (uint8_t ssid[32]) const
-{
-  for (uint8_t i = 0; i < 32; i++) 
-    {
-      ssid[i] = m_ssid[i];
-    }
-}
-void 
-Ssid::Set (uint8_t ssid[32], uint32_t len)
-{
-  assert (len < 32);
-  for (uint8_t i = 0; i < len; i++) 
-    {
-      m_ssid[i] = ssid[i];
-    }
-}
-
-Ssid 
-Ssid::GetBroadcast (void)
-{
-  return Ssid ("");
-}
-
-}; // namespace ns3
+} // namespace ns3
--- a/src/devices/wifi/ssid.h	Tue Oct 09 16:40:24 2007 +0200
+++ b/src/devices/wifi/ssid.h	Tue Oct 09 16:47:34 2007 +0200
@@ -27,8 +27,9 @@
 
 class Ssid {
 public:
+  // broadcast ssid
+  Ssid ();
   /* 0-terminated string */
-  Ssid ();
   Ssid (char const *ssid);
   Ssid (char const ssid[32], uint8_t length);
 
@@ -36,15 +37,12 @@
   bool IsBroadcast (void) const;
 
   uint32_t GetLength (void) const;
-  void Peek (uint8_t[32]) const;
-  void Set (uint8_t[32], uint32_t len);
-
-  static Ssid GetBroadcast (void);
+ 
 private:
   char m_ssid[33];
   uint8_t m_length;
 };
 
-}; // namespace ns3
+} // namespace ns3
 
 #endif /* SSID_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/devices/wifi/status-code.cc	Tue Oct 09 16:47:34 2007 +0200
@@ -0,0 +1,60 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2006 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 "status-code.h"
+
+namespace ns3 {
+
+StatusCode::StatusCode ()
+{}
+void 
+StatusCode::SetSuccess (void)
+{
+  m_code = 0;
+}
+void 
+StatusCode::SetFailure (void)
+{
+  m_code = 1;
+}
+
+bool 
+StatusCode::IsSuccess (void) const
+{
+  return (m_code == 0)?true:false;
+}
+uint16_t 
+StatusCode::PeekCode (void) const
+{
+  return m_code;
+}
+void 
+StatusCode::SetCode (uint16_t code)
+{
+  m_code = code;
+}
+
+uint32_t 
+StatusCode::GetSize (void) const
+{
+  return 2;
+}
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/devices/wifi/status-code.h	Tue Oct 09 16:47:34 2007 +0200
@@ -0,0 +1,43 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2006 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 STATUS_CODE_H
+#define STATUS_CODE_H
+
+#include <stdint.h>
+
+namespace ns3 {
+
+class StatusCode {
+public:
+  StatusCode ();
+  void SetSuccess (void);
+  void SetFailure (void);
+
+  bool IsSuccess (void) const;
+  uint16_t PeekCode (void) const;
+  void SetCode (uint16_t code);
+  uint32_t GetSize (void) const;
+private:
+  uint16_t m_code;
+};
+
+} // namespace ns3
+
+#endif /* STATUS_CODE_H */
--- a/src/devices/wifi/wscript	Tue Oct 09 16:40:24 2007 +0200
+++ b/src/devices/wifi/wscript	Tue Oct 09 16:47:34 2007 +0200
@@ -25,6 +25,8 @@
         'ideal-mac-stations.cc',
         'mac-high-adhoc.cc',
         'supported-rates.cc',
+        'capability-information.cc',
+        'status-code.cc',
         ]
     headers = bld.create_obj('ns3header')
     headers.source = [