- boost::array<unsigned char,6> result;
- u_int64_t ether=ethernet_address_;
- for (int i = 0; i < 6; i++)
- {
- result[i] = (unsigned char) (ether && 0xff);
- ether >>= 8;
- }
- return result;
-}
-
-bool NetworkAddress::operator<(const NetworkAddress &right) const
-{
- if (network_address_type_!=right.network_address_type_)
- AnytunError::throwErr() << "NetworkAddress::operator<() address types don't match";
- if (network_address_type_==ipv4)
- {
- return (ipv4_address_ < right.ipv4_address_);
- } else if (network_address_type_==ipv6) {
- return (ipv6_address_ < right.ipv6_address_);
- } else if (network_address_type_==ethernet) {
- return (ethernet_address_ < right.ethernet_address_);
- } else {
- //TODO
- }
- return false;
+ boost::array<unsigned char,6> result;
+ uint64_t ether=ethernet_address_;
+ for(int i = 0; i < 6; i++) {
+ result[i] = (unsigned char)(ether && 0xff);
+ ether >>= 8;
+ }
+ return result;
+}
+
+bool NetworkAddress::operator<(const NetworkAddress& right) const
+{
+ if(network_address_type_!=right.network_address_type_) {
+ AnytunError::throwErr() << "NetworkAddress::operator<() address types don't match";
+ }
+ if(network_address_type_==ipv4) {
+ return (ipv4_address_ < right.ipv4_address_);
+ } else if(network_address_type_==ipv6) {
+ return (ipv6_address_ < right.ipv6_address_);
+ } else if(network_address_type_==ethernet) {
+ return (ethernet_address_ < right.ethernet_address_);
+ } else {
+ //TODO
+ }
+ return false;