Given a stream of IP addresses, design a data structure that allows for fast lookup and CIDR block matching.