I'm looking for a way to read a list of CIDR addresses and convert them into a binary strings. The input is a file with rows of actions and addresses and destinations:
ADD 192.168.20.16/28 A
FIND 255.255.255.0
REMOVE 192.168.20.16/28 A
How can I convert these addresses to binary? For example:
192.168.20.191
to 11000000.10101000.00010100.10111111
192.168.20.16/28
to 11000000.10101000.00010100.00010000
192.168.0.0/16
to 11000000.10101000.00000000.00000000