+ @staticmethod
+ def create_ip_address_object(ip_addr):
+ """Create IP address object.
+
+ :param ip_addr: IPv4 or IPv6 address
+ :type ip_addr: IPv4Address or IPv6Address
+ :returns: IP address object.
+ :rtype: dict
+ """
+ return dict(
+ af=getattr(
+ AddressFamily, 'ADDRESS_IP6' if ip_addr.version == 6
+ else 'ADDRESS_IP4').value,
+ un=IPUtil.union_addr(ip_addr))
+
+ @staticmethod
+ def create_prefix_object(ip_addr, addr_len):
+ """Create prefix object.
+
+ :param ip_addr: IPv4 or IPv6 address.
+ :para, addr_len: Length of IP address.
+ :type ip_addr: IPv4Address or IPv6Address
+ :type addr_len: int
+ :returns: Prefix object.
+ :rtype: dict
+ """
+ addr = IPUtil.create_ip_address_object(ip_addr)
+
+ return dict(
+ len=int(addr_len),
+ address=addr
+ )
+