update allocate_ipv4 to use function instead of ophandler