+ constructExample()
+
+ encodingExampleIP()
+
+ // convert IP from string form into Address type containing union
+ convertIP("10.10.1.1")
+ convertIP("ff80::1")
+
+ // convert IP from string form into Prefix type
+ convertIPPrefix("20.10.1.1/24")
+ convertIPPrefix("21.10.1.1")
+ convertIPPrefix("ff90::1/64")
+ convertIPPrefix("ff91::1")
+
+ // convert MAC address from string into MacAddress
+ convertToMacAddress("00:10:ab:4f:00:01")
+}
+
+func constructExample() {
+ var union ip_types.AddressUnion
+
+ // create AddressUnion with AdressUnionXXX constructors
+ union = ip_types.AddressUnionIP4(ip_types.IP4Address{192, 168, 1, 10})
+ union = ip_types.AddressUnionIP6(ip_types.IP6Address{0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x02})
+
+ // set AddressUnion with SetXXX methods
+ union.SetIP4(ip_types.IP4Address{192, 168, 1, 10})
+ union.SetIP6(ip_types.IP6Address{0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x02})