Added gen_ipv4() and gen_ipv6() methods