Inital bpdu details
authorRichard Whitehouse <github@richardwhiuk.com>
Fri, 15 Apr 2011 22:48:38 +0000 (23:48 +0100)
committerRichard Whitehouse <github@richardwhiuk.com>
Fri, 15 Apr 2011 22:48:38 +0000 (23:48 +0100)
src/devices/bridge/model/bpdu-header.h [new file with mode: 0644]
src/devices/bridge/wscript

diff --git a/src/devices/bridge/model/bpdu-header.h b/src/devices/bridge/model/bpdu-header.h
new file mode 100644 (file)
index 0000000..5126ea7
--- /dev/null
@@ -0,0 +1,117 @@
+/* -*-  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: Richard Whitehouse <ns3@richardwhiuk.com>
+ */
+
+#ifndef BRIDGE_BPDU_HEADER_H
+#define BRIDGE_BPDU_HEADER_H
+
+#include "ns3/header.h"
+#include "ns3/address.h"
+#include "ns3/ipv4-address.h"
+#include <string>
+
+namespace ns3 {
+/**
+ * \ingroup bridge
+ * \brief The packet header for an Bridge Protocol Data Unit (BPDU) packet header
+ */
+
+class BpduHeader : public Header {
+
+public:
+
+       uint16_t getProtocol();
+       uint8_t getVersion();
+       uint8_t getType();
+
+       void setProtocol(uint16_t);
+       void setVersion(uint8_t);
+       void setType(uint8_t);
+
+  static TypeId GetTypeId (void);
+  virtual TypeId GetInstanceTypeId (void) const;
+  virtual void Print (std::ostream &os) const;
+  virtual uint32_t GetSerializedSize (void) const;
+  virtual void Serialize (Buffer::Iterator start) const;
+  virtual uint32_t Deserialize (Buffer::Iterator start);
+
+private;
+
+       uint16_t protocolIdentifier;
+       uint8_t versionIdentifier;
+       uint8_t bpduType;
+
+
+};
+
+/**
+ * \ingroup bridge
+ * \brief The packet header for an Configuration BPDU packet header
+ */
+
+
+class ConfigurationBpduHeader : public Header {
+
+public:
+
+  
+
+
+  static TypeId GetTypeId (void);
+  virtual TypeId GetInstanceTypeId (void) const;
+  virtual void Print (std::ostream &os) const;
+  virtual uint32_t GetSerializedSize (void) const;
+  virtual void Serialize (Buffer::Iterator start) const;
+  virtual uint32_t Deserialize (Buffer::Iterator start);
+
+};
+
+/**
+ * \ingroup bridge
+ * \brief The packet header for an Topology Change Notification BPDU packet header
+ */
+
+
+class TcnBpduHeader : public Header {
+
+public:
+
+  static TypeId GetTypeId (void);
+  virtual TypeId GetInstanceTypeId (void) const;
+  virtual void Print (std::ostream &os) const;
+  virtual uint32_t GetSerializedSize (void) const;
+  virtual void Serialize (Buffer::Iterator start) const;
+  virtual uint32_t Deserialize (Buffer::Iterator start);
+
+
+};
+
+/**
+ * \ingroup bridge
+ * \brief The packet header for an Rapid Spanning Tree BPDU packet header
+ */
+
+
+class RstBpduHeader : public Header {
+
+};
+
+
+#endif
+
index a8738f9ef0dd9277031faa87ddaefe4b05bdb39f..2cf17d14e0ce721eb12d9fca462f7b99b994a037 100644 (file)
@@ -14,6 +14,7 @@ def build(bld):
     headers = bld.new_task_gen('ns3header')
     headers.module = 'bridge'
     headers.source = [
+       'model/bpdu-header.h',
         'model/moose-bridge-port-net-device.h',
        'model/moose-bridge-net-device.h',
         'model/bridge-net-device.h',