Jul 20, 2023

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, would be removed if was also supplied.

The second optimisation identifies adjacent prefixes that can be combined under a single, shorter-length prefix. For example, and can be combined into the single prefix

Checkout these related ports: