Git Product home page Git Product logo

aggregate6's Introduction

Build Status Requirements Status Coverage Status

aggregate6

aggregate6 will compress an unsorted list of IP prefixes (both IPv4 and IPv6).

DESCRIPTION

Takes a list of IPv6 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 superfluous because they are already included in another supplied prefix. For example, 2001:67c:208c:10::/64 would be removed if 2001:67c:208c::/48 was also supplied.

The second optimisation identifies adjacent prefixes that can be combined under a single, shorter-length prefix. For example, 2001:67c:208c::/48 and 2001:67c:208d::/48 can be combined into the single prefix 2001:67c:208c::/47.

INSTALLATION

$ pip install aggregate6

CLI USAGE

Either provide the list of IPv4 and IPv prefixes on STDIN, or give filenames containing lists of IPv6 prefixes as arguments.

$ # via STDIN
$ cat file_with_list_of_prefixes | aggregate6
   ... output ...

$ # with a filename as argument
$ aggregate6 file_with_list_of_prefixes [ ... optional_other_prefix_lists ]
   ... output ...

$ # Whitespace separated works too
$ echo 2001:67c:208c::/48 2000::/3 | aggregate6
2000::/3

$ # You can combine IPv4 and IPv6
$ echo 10.0.0.0/16 10.0.0.0/24 2000::/3 | aggregate6
10.0.0.0/16
2000::/3

$ # Or display only a specific AFI
$ echo 10.0.0.0/16 10.0.0.0/24 2000::/3 | aggregate6 -4
10.0.0.0/16

See aggregate6 -h for a full list of options.

LIBRARY USAGE

>>> import from aggregate6 import aggregate
>>> aggregate(["10.0.0.0/8", "10.0.0.0/24"])
['10.0.0.0/8']
>>>

BUGS

Please report bugs at https://github.com/job/aggregate6/issues

AUTHOR

Job Snijders [email protected]

aggregate6's People

Contributors

job avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.