X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvpp-api%2Fpython%2Fvpp_papi%2Fmacaddress.py;h=5005fa8d92e81af4cc5fed3ae28b1fcba7f9c28f;hb=fe4827c97d375d5849aa5db863030af48069bdc2;hp=a1003812003a2c1172929cbe6ee8ab02afef4387;hpb=28eedf4e890a258a7a68b4a5414c74a8d708e7a6;p=vpp.git diff --git a/src/vpp-api/python/vpp_papi/macaddress.py b/src/vpp-api/python/vpp_papi/macaddress.py index a1003812003..5005fa8d92e 100644 --- a/src/vpp-api/python/vpp_papi/macaddress.py +++ b/src/vpp-api/python/vpp_papi/macaddress.py @@ -52,3 +52,14 @@ class MACAddress(): def __repr__(self): return '%s(%s)' % (self.__class__.__name__, self.mac_string) + + def __eq__(self, other): + if not isinstance(other, MACAddress): + return NotImplemented + return self.mac_binary == other.mac_binary + + def __ne__(self, other): + return not self == other + + def __hash__(self): + return hash(self.mac_binary)