Skip to content

Conversation

@am2rican5
Copy link
Contributor

Summary

  • Add cidr command for computing network information from CIDR notation
  • Display comprehensive network details including addresses in multiple formats (string, decimal, hex)
  • Update README with usage examples

Features

Given a CIDR like 192.168.1.100/24, the tool displays:

  • Address (input IP) in string, decimal, and dotted hex
  • Network and broadcast addresses
  • First/last usable host IPs
  • Total host count
  • Prefix length, netmask, and wildcard mask

Example

$ ut cidr 192.168.1.100/24

address           192.168.1.100
address_decimal   3232235876
address_hex       C0.A8.01.64
network           192.168.1.0
broadcast         192.168.1.255
first_host        192.168.1.1
last_host         192.168.1.254
total_hosts       254
prefix            24
netmask           255.255.255.0
netmask_hex       FF.FF.FF.00
wildcard          0.0.0.255
wildcard_hex      00.00.00.FF

Computes network information from CIDR notation including:
- Address in string, decimal, and hex formats
- Network and broadcast addresses
- First/last usable hosts and total host count
- Netmask and wildcard in string and hex formats
@ksdme
Copy link
Owner

ksdme commented Dec 26, 2025

It makes more sense to put this tool under ip cidr namespace. So something like ut ip cidr info 192.168.1.100/24. This will let us do things like cidr contains etc.

@ksdme ksdme merged commit 4cb0f0b into ksdme:main Dec 26, 2025
7 checks passed
@ksdme
Copy link
Owner

ksdme commented Dec 26, 2025

The tool should be available under ut ip cidr describe 192.168.1.100/24. Thanks for the contribution @am2rican5!

@am2rican5
Copy link
Contributor Author

Awesome, thanks! Happy to contribute to the project.

@am2rican5 am2rican5 deleted the feat/cidr-calculator-tool branch December 26, 2025 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants