{"id":"ipv4-prefix-set-subtract","version":"1.0.0","description":"Subtract one IPv4 prefix set from another into sorted minimal disjoint CIDRs.","supported_operations":["subtract one ipv4 prefix set from another","ipv4 prefix set difference","cidr blocks only in the left prefix set","remove a prefix set from an ipv4 set","punch holes in an ipv4 prefix set","exclude these cidrs from the ipv4 set","left minus right ipv4 prefixes"],"unsupported_operations":["IPv6 prefix sets","prefixes longer than /32","returning the removed addresses as well as the remainder"],"semantics":["left and right are arrays of canonical IPv4 CIDR strings (dotted decimal, a slash, and a prefix length 0-32 with no leading zeros). An omitted strict means true.","When strict is true, any prefix with host bits set is invalid_input. When strict is false, those bits are cleared before the subtraction.","prefixes is the shortest list of non-overlapping CIDRs, sorted by network address, whose addresses are exactly left minus right. Covering stops at /32: removing one address from a block emits host routes and aligned neighbors, never a length above 32.","More than 64 prefixes on one side, or a prefix longer than 18 code points, is limit_exceeded before syntax checks. A cover longer than 16 prefixes is limit_exceeded.","Empty arrays are empty sets. Subtracting a set from itself, or subtracting a superset, yields an empty cover."],"limits":{"max_prefixes_per_side":64,"max_prefix_chars":18,"max_emitted_prefixes":16},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["left","right"],"properties":{"left":{"type":"array","minItems":0,"maxItems":64,"items":{"type":"string","minLength":1,"maxLength":18,"pattern":"^(?:0|[1-9][0-9]{0,2})(?:\\.(?:0|[1-9][0-9]{0,2})){3}/(?:0|[1-9]|[12][0-9]|3[0-2])$"}},"right":{"type":"array","minItems":0,"maxItems":64,"items":{"type":"string","minLength":1,"maxLength":18,"pattern":"^(?:0|[1-9][0-9]{0,2})(?:\\.(?:0|[1-9][0-9]{0,2})){3}/(?:0|[1-9]|[12][0-9]|3[0-2])$"}},"strict":{"type":"boolean"}}},"output_schema":{"type":"object","additionalProperties":false,"required":["prefixes","count"],"properties":{"prefixes":{"type":"array","minItems":0,"maxItems":16,"items":{"type":"string","minLength":1,"maxLength":18,"pattern":"^(?:0|[1-9][0-9]{0,2})(?:\\.(?:0|[1-9][0-9]{0,2})){3}/(?:0|[1-9]|[12][0-9]|3[0-2])$"}},"count":{"type":"integer","minimum":0,"maximum":16}}},"examples":[{"input":{"left":["10.0.0.0/30"],"right":["10.0.0.1/32"]},"output":{"prefixes":["10.0.0.0/32","10.0.0.2/31"],"count":2}},{"input":{"left":["10.0.0.0/24"],"right":["10.0.0.128/25"]},"output":{"prefixes":["10.0.0.0/25"],"count":1}},{"input":{"left":["10.0.0.0/31"],"right":["10.0.0.1/32"]},"output":{"prefixes":["10.0.0.0/32"],"count":1}}],"execute_url":"/v1/tools/ipv4-prefix-set-subtract/versions/1.0.0/execute"}