← 返回 Skills 市场
Cidr Calc
作者
Omar Hernandez
· GitHub ↗
· v1.0.0
· MIT-0
144
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install cidr-calc
功能描述
Calculate subnet information from CIDR notation. Use when the user asks to calculate a subnet, find the network address, broadcast address, host range, subne...
使用说明 (SKILL.md)
CIDR Calculator
Given an IP address in CIDR notation, compute all subnet parameters: network address, broadcast, host range, subnet mask, wildcard mask, host counts, IP class, and binary representation.
Input
- A CIDR notation string in the format
A.B.C.D/N(e.g.192.168.1.0/24)
Output
A structured result with these fields:
- CIDR Notation (normalized)
- Network Address
- Broadcast Address
- Subnet Mask
- Wildcard Mask
- First Usable Host
- Last Usable Host
- Total Hosts (2^(32-N))
- Usable Hosts
- IP Class (A / B / C / D Multicast / E Reserved)
- Network Type (Private / Public)
- Binary Representation of the IP
Instructions
- Validate the input. It must match
\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2}. Each octet must be 0–255. Prefix must be 0–32. - Compute values using standard subnet math:
maskNum = (0xFFFFFFFF \x3C\x3C (32 - prefix)) >>> 0wildcardNum = ~maskNum >>> 0networkNum = (ipNum & maskNum) >>> 0broadcastNum = (networkNum | wildcardNum) >>> 0totalHosts = 2^(32 - prefix)usableHosts: if prefix == 32 → 1; if prefix == 31 → 2; elsetotalHosts - 2
- Determine IP class from first octet:
- 1–126 → A; 128–191 → B; 192–223 → C; 224–239 → D (Multicast); 240–255 → E (Reserved); 127 → Loopback
- Determine private vs public:
- Private: 10.x.x.x, 172.16–31.x.x, 192.168.x.x, 127.x.x.x (loopback)
- Compute binary as four 8-bit groups joined by dots.
- Present results in a clear labeled format.
Quick CIDR reference
| CIDR | Subnet Mask | Total Hosts |
|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 |
| /16 | 255.255.0.0 | 65,536 |
| /20 | 255.255.240.0 | 4,096 |
| /22 | 255.255.252.0 | 1,024 |
| /24 | 255.255.255.0 | 256 |
| /28 | 255.255.255.240 | 16 |
| /30 | 255.255.255.252 | 4 |
| /32 | 255.255.255.255 | 1 |
Options
- Input is always a single CIDR string; no additional options.
Examples
Input: 192.168.1.0/24
Output:
CIDR Notation: 192.168.1.0/24
Network Address: 192.168.1.0
Broadcast: 192.168.1.255
Subnet Mask: 255.255.255.0
Wildcard Mask: 0.0.0.255
First Host: 192.168.1.1
Last Host: 192.168.1.254
Total Hosts: 256
Usable Hosts: 254
IP Class: C
Network Type: Private
Binary: 11000000.10101000.00000001.00000000
Input: 10.0.0.0/8
Output:
CIDR Notation: 10.0.0.0/8
Network Address: 10.0.0.0
Broadcast: 10.255.255.255
Subnet Mask: 255.0.0.0
Wildcard Mask: 0.255.255.255
First Host: 10.0.0.1
Last Host: 10.255.255.254
Total Hosts: 16,777,216
Usable Hosts: 16,777,214
IP Class: A
Network Type: Private
Binary: 00001010.00000000.00000000.00000000
Error Handling
- If the input is not valid CIDR notation, say so and provide the expected format (
A.B.C.D/N). - If an octet exceeds 255 or the prefix exceeds 32, explain the validation error.
- If the user provides an IP without a prefix (e.g.
192.168.1.1), ask for the prefix length or assume /32.
安全使用建议
This appears safe and coherent for computing subnet details. You can install it without exposing credentials or installing extra software. Before relying on it for critical tasks, test its outputs on edge cases (e.g., 0.0.0.0, 255.255.255.255, /31, /32) and note the documented mistake treating 127.x.x.x as a private network (it is loopback). If you need authoritative behavior for unusual prefixes, verify against a trusted networking tool or library.
功能分析
Type: OpenClaw Skill
Name: cidr-calc
Version: 1.0.0
The skill bundle provides instructions for an AI agent to perform standard CIDR subnet calculations, including network/broadcast addresses and host ranges. The logic in SKILL.md is purely mathematical and descriptive, with no evidence of data exfiltration, malicious execution, or prompt injection attacks.
能力评估
Purpose & Capability
Name and description match the SKILL.md instructions: the skill only describes validating CIDR input and computing subnet parameters. It does not request unrelated binaries, environment variables, or installs.
Instruction Scope
Instructions stay within the expected scope (validation, subnet math, class and private/public determination, binary output). One minor correctness issue: the SKILL.md lists 127.x.x.x as Private — 127.0.0.0/8 is loopback/host-local, not a private RFC1918 network. Also check edge cases (0.0.0.0, 255.255.255.255, /31 and /32 semantics) if you rely on this for production use.
Install Mechanism
No install spec and no code files — instruction-only skill. Nothing will be written to disk or downloaded during install.
Credentials
Requires no environment variables, credentials, or config paths — the declared requirements are minimal and appropriate for a local calculation utility.
Persistence & Privilege
always is false and the skill does not request persistent or elevated platform privileges. Autonomous invocation is allowed by default but not combined with any sensitive access.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install cidr-calc - 安装完成后,直接呼叫该 Skill 的名称或使用
/cidr-calc触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of cidr-calc: Calculate subnet details from CIDR notation.
- Computes network address, broadcast address, host range, subnet mask, wildcard mask, total/usable hosts, IP class, network type, and binary representation.
- Accepts a single IP in CIDR notation (e.g., 192.168.1.0/24) and outputs a clear, structured table.
- Validates input format and provides helpful error messages for invalid entries.
- Distinguishes between private, public, loopback, and special-use IP ranges.
- Includes example inputs, expected output, and a quick CIDR reference chart.
元数据
常见问题
Cidr Calc 是什么?
Calculate subnet information from CIDR notation. Use when the user asks to calculate a subnet, find the network address, broadcast address, host range, subne... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 144 次。
如何安装 Cidr Calc?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install cidr-calc」即可一键安装,无需额外配置。
Cidr Calc 是免费的吗?
是的,Cidr Calc 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Cidr Calc 支持哪些平台?
Cidr Calc 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Cidr Calc?
由 Omar Hernandez(@ohernandez-dev-blossom)开发并维护,当前版本 v1.0.0。
推荐 Skills