Fast conversion of IPv4 ranges into CIDR form
Timothy Rice db03541c74 Add licence | 6 سال پیش | |
---|---|---|
.gitignore | 6 سال پیش | |
LICENSE.md | 6 سال پیش | |
Makefile | 6 سال پیش | |
README.md | 6 سال پیش | |
args.h | 6 سال پیش | |
cider.c | 6 سال پیش | |
io.c | 6 سال پیش | |
io.h | 6 سال پیش | |
parse.c | 6 سال پیش | |
parse.h | 6 سال پیش |
Convert IPv4 ranges into CIDR form.
A faster and more script-friendly version of ipcalc's deaggregation function.
cider [-?hvV] [--help] [--help] [--usage] [--version] [--version] [file]
-?, --help Give this help list
-h, --help Print this help message.
--usage Give a short usage message
-v, --version Print version information.
-V, --version Print program version
If [file]
is omitted, Cider will read from stdin
.
Read from stdin:
$ cider <<< 192.168.0.128-192.168.1.255
192.168.0.128/25
192.168.1.0/24
Read from a file:
$ cat > /tmp/10.x.x.x << EOF
> 10.0.0.0-10.255.255.255
> EOF
$ cider /tmp/10.x.x.x
10.0.0.0/8
Convert all Australian ranges:
$ curl -s https://www.nirsoft.net/countryip/au.csv | awk -F, '{OFS="-"; print $1, $2}' | cider
1.40.0.0/14
1.44.0.0/16
1.120.0.0/13
1.128.0.0/11
1.178.0.0/16
1.179.0.0/17
14.2.0.0/16
14.137.0.0/17
14.137.128.0/18
... (truncated)
Other libc
s may or may not work, depending on whether they ship with their own variants of sys/socket.h
, netinet/in.h
and arpa/inet.h
.