Beispiel #1
0
 def from_of_tlv(cls, tlv):
     """Return an instance from a pyof OXM TLV."""
     ip_address = IPAddress()
     ip_address.unpack(tlv.oxm_value)
     addr_str = str(ip_address)
     value = addr_str
     if tlv.oxm_hasmask:
         value = f'{addr_str}/{bytes_to_mask(tlv.oxm_value[4:], 32)}'
     return cls(value)
Beispiel #2
0
 def from_of_tlv(cls, tlv):
     """Return an instance from a pyof OXM TLV."""
     ip_address = IPAddress()
     ip_address.unpack(tlv.oxm_value)
     ip_str = str(ip_address)
     return cls(ip_str)