samples: pktgen: add helper functions for IP(v4/v6) CIDR parsing