summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/python/vpp_papi/macaddress.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/vpp-api/python/vpp_papi/macaddress.py')
-rw-r--r--src/vpp-api/python/vpp_papi/macaddress.py11
1 files changed, 11 insertions, 0 deletions
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)