Diffstat (limited to 'libopie2/opienet/onetutils.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opienet/onetutils.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libopie2/opienet/onetutils.cpp b/libopie2/opienet/onetutils.cpp index 08c40b4..ad0e89d 100644 --- a/libopie2/opienet/onetutils.cpp +++ b/libopie2/opienet/onetutils.cpp | |||
@@ -37,50 +37,55 @@ | |||
37 | 37 | ||
38 | #include <cstdio> | 38 | #include <cstdio> |
39 | using namespace std; | 39 | using namespace std; |
40 | 40 | ||
41 | #define IW_PRIV_TYPE_MASK 0x7000 | 41 | #define IW_PRIV_TYPE_MASK 0x7000 |
42 | #define IW_PRIV_TYPE_NONE 0x0000 | 42 | #define IW_PRIV_TYPE_NONE 0x0000 |
43 | #define IW_PRIV_TYPE_BYTE 0x1000 | 43 | #define IW_PRIV_TYPE_BYTE 0x1000 |
44 | #define IW_PRIV_TYPE_CHAR 0x2000 | 44 | #define IW_PRIV_TYPE_CHAR 0x2000 |
45 | #define IW_PRIV_TYPE_INT 0x4000 | 45 | #define IW_PRIV_TYPE_INT 0x4000 |
46 | #define IW_PRIV_TYPE_FLOAT 0x5000 | 46 | #define IW_PRIV_TYPE_FLOAT 0x5000 |
47 | #define IW_PRIV_TYPE_ADDR 0x6000 | 47 | #define IW_PRIV_TYPE_ADDR 0x6000 |
48 | #define IW_PRIV_SIZE_FIXED 0x0800 | 48 | #define IW_PRIV_SIZE_FIXED 0x0800 |
49 | #define IW_PRIV_SIZE_MASK 0x07FF | 49 | #define IW_PRIV_SIZE_MASK 0x07FF |
50 | 50 | ||
51 | /*====================================================================================== | 51 | /*====================================================================================== |
52 | * OMacAddress | 52 | * OMacAddress |
53 | *======================================================================================*/ | 53 | *======================================================================================*/ |
54 | 54 | ||
55 | // static initializer for broadcast and unknown MAC Adresses | 55 | // static initializer for broadcast and unknown MAC Adresses |
56 | const unsigned char __broadcast[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; | 56 | const unsigned char __broadcast[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; |
57 | const OMacAddress& OMacAddress::broadcast = OMacAddress( __broadcast ); | 57 | const OMacAddress& OMacAddress::broadcast = OMacAddress( __broadcast ); |
58 | const unsigned char __unknown[6] = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 }; | 58 | const unsigned char __unknown[6] = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 }; |
59 | const OMacAddress& OMacAddress::unknown = OMacAddress( __unknown ); | 59 | const OMacAddress& OMacAddress::unknown = OMacAddress( __unknown ); |
60 | 60 | ||
61 | //TODO: Incorporate Ethernet Manufacturer database here! (inline or so) | ||
62 | |||
63 | OMacAddress::OMacAddress() | ||
64 | { | ||
65 | memcpy( _bytes, __unknown, 6 ); | ||
66 | } | ||
61 | 67 | ||
62 | //TODO: Incorporate Ethernet Manufacturer database here! | ||
63 | 68 | ||
64 | OMacAddress::OMacAddress( unsigned char* p ) | 69 | OMacAddress::OMacAddress( unsigned char* p ) |
65 | { | 70 | { |
66 | memcpy( _bytes, p, 6 ); | 71 | memcpy( _bytes, p, 6 ); |
67 | } | 72 | } |
68 | 73 | ||
69 | 74 | ||
70 | OMacAddress::OMacAddress( const unsigned char* p ) | 75 | OMacAddress::OMacAddress( const unsigned char* p ) |
71 | { | 76 | { |
72 | memcpy( _bytes, p, 6 ); | 77 | memcpy( _bytes, p, 6 ); |
73 | } | 78 | } |
74 | 79 | ||
75 | 80 | ||
76 | OMacAddress::OMacAddress( struct ifreq& ifr ) | 81 | OMacAddress::OMacAddress( struct ifreq& ifr ) |
77 | { | 82 | { |
78 | memcpy( _bytes, ifr.ifr_hwaddr.sa_data, 6 ); | 83 | memcpy( _bytes, ifr.ifr_hwaddr.sa_data, 6 ); |
79 | } | 84 | } |
80 | 85 | ||
81 | 86 | ||
82 | OMacAddress::~OMacAddress() | 87 | OMacAddress::~OMacAddress() |
83 | { | 88 | { |
84 | } | 89 | } |
85 | 90 | ||
86 | 91 | ||