new address types

This commit is contained in:
Mathieu Lacage committed 2007-07-26 14:03:41 +02:00
1 parent e63402a9c6
commit 75abf6fea9
9 files changed
+422 -2

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
#ifndef ADDRESS_H
#define ADDRESS_H
#include <stdint.h>
#include <ostream>
namespace ns3 {
class Address
{
public:
Address (uint8_t type, const uint8_t *buffer, uint8_t len);
Address (const Address & address);
Address &operator = (const Address &address);
uint8_t GetLength (void) const;
void CopyTo (uint8_t *buffer) const;
uint8_t GetType (void) const;
static uint8_t Register (void);
private:
friend bool operator == (const Address &a, const Address &b);
friend bool operator < (const Address &a, const Address &b);
friend std::ostream& operator<< (std::ostream& os, const Address & address);
Address ();
enum {
MAX_SIZE = 14
};
uint8_t m_type;
uint8_t m_len;
uint8_t m_data[MAX_SIZE];
};
bool operator == (const Address &a, const Address &b);
bool operator != (const Address &a, const Address &b);
bool operator < (const Address &a, const Address &b);
std::ostream& operator<< (std::ostream& os, const Address & address);
} // namespace ns3
#endif /* ADDRESS_H */