src/common/mtag-buffer.h
changeset 3035 644bfc099992
child 3037 b0f12f3a75b3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/common/mtag-buffer.h	Thu Apr 24 14:52:59 2008 -0700
@@ -0,0 +1,32 @@
+#ifndef MTAG_BUFFER_H
+#define MTAG_BUFFER_H
+
+#include <stdint.h>
+
+namespace ns3 {
+
+class MtagBuffer
+{
+public:
+  MtagBuffer (uint8_t *start, uint8_t *end);
+  void TrimAtEnd (uint32_t trim);
+
+  void WriteU8 (uint8_t v);
+  void WriteU16 (uint16_t v);
+  void WriteU32 (uint32_t v);
+  void WriteU64 (uint64_t v);
+  uint8_t  ReadU8 (void);
+  uint16_t ReadU16 (void);
+  uint32_t ReadU32 (void);
+  uint64_t ReadU64 (void);
+
+  void CopyFrom (MtagBuffer o);
+private:
+  
+  uint8_t *m_current;
+  uint8_t *m_end;
+};
+
+} // namespace ns3
+
+#endif /* MTAG_BUFFER_H */