Changeset 63380 in vbox for trunk/src/VBox/NetworkServices/NetLib/cpp
- Timestamp:
- Aug 12, 2016 6:34:15 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/NetworkServices/NetLib/cpp/utils.h
-
Property svn:keywords
set to
Author Date Id Revision
r62481 r63380 16 16 */ 17 17 18 #ifndef _ NETLIB_CPP_UTILS_H_19 # define _NETLIB_CPP_UTILS_H_18 #ifndef ___NETLIB_CPP_UTILS_H___ 19 #define ___NETLIB_CPP_UTILS_H___ 20 20 21 /* less operator for IPv4 addresess */ 22 static bool operator <(const RTNETADDRIPV4& a, const RTNETADDRIPV4& b) 21 #include <iprt/types.h> 22 23 /** less operator for IPv4 addresess */ 24 DECLINLINE(bool) operator <(const RTNETADDRIPV4 &lhs, const RTNETADDRIPV4 &rhs) 23 25 { 24 return (RT_N2H_U32(a.u) < RT_N2H_U32(b.u));26 return RT_N2H_U32(lhs.u) < RT_N2H_U32(rhs.u); 25 27 } 26 28 27 /* Compares MAC addresses */28 static bool operator== (const RTMAC& lhs, const RTMAC&rhs)29 /** greater operator for IPv4 addresess */ 30 DECLINLINE(bool) operator >(const RTNETADDRIPV4 &lhs, const RTNETADDRIPV4 &rhs) 29 31 { 30 return ( lhs.au16[0] == rhs.au16[0] 31 && lhs.au16[1] == rhs.au16[1] 32 && lhs.au16[2] == rhs.au16[2]); 32 return RT_N2H_U32(lhs.u) > RT_N2H_U32(rhs.u); 33 33 } 34 35 /** Compares MAC addresses */ 36 DECLINLINE(bool) operator== (const RTMAC &lhs, const RTMAC &rhs) 37 { 38 return lhs.au16[0] == rhs.au16[0] 39 && lhs.au16[1] == rhs.au16[1] 40 && lhs.au16[2] == rhs.au16[2]; 41 } 42 34 43 #endif 44 -
Property svn:keywords
set to
Note:
See TracChangeset
for help on using the changeset viewer.