May 26, 2018
Optimise a list of route prefixes to help make nice short filters
Takes a list of prefixes in conventional format on stdin, and performs two optimisations to attempt to reduce the length of the prefix list.
The first optimisation is to remove any supplied prefixes which are supurfluous because they are already included in another supplied prefix. For example, 126.96.36.199/24 would be removed if 188.8.131.52/17 was also supplied.
The second optimisation identifies adjacent prefixes that can be combined under a single, shorter-length prefix. For example, 184.108.40.206/24 and 220.127.116.11/24 can be combined into the single prefix 18.104.22.168/23.