Difference between revisions of "Template:IP Range"
Jump to navigation
Jump to search
Line 12: | Line 12: | ||
|} | |} | ||
</noinclude><includeonly>{{#if: | </noinclude><includeonly>{{#if: | ||
{{#vardefine:ip- | {{#vardefine:ip-num|{{#switch:{{{npl|}}} | ||
|32=1|31=2|30=4|29=8 | |32=1|31=2|30=4|29=8 | ||
|28=16|27=32|26=64|25=128 | |28=16|27=32|26=64|25=128 | ||
Line 23: | Line 23: | ||
|0=4294967296|{{#expr:4294967296 - {{IP_Range/IP2Int|{{{subnet|255.255.255.255}}}}}}} | |0=4294967296|{{#expr:4294967296 - {{IP_Range/IP2Int|{{{subnet|255.255.255.255}}}}}}} | ||
}}}} | }}}} | ||
{{#vardefine:ip-count|{{#expr:{{#var:ip-count}}+{{#var:ip- | {{#vardefine:ip-npl|{{#expr:32 - {{#log:{{#var:ip-num}}|2}}}}}} | ||
{{#vardefine:ip-count|{{#expr:{{#var:ip-count}}+{{#var:ip-num}}}}}} | |||
{{#vardefine:ip-start|{{IP_Range/IP2Int|{{{ip|}}}}}}} | {{#vardefine:ip-start|{{IP_Range/IP2Int|{{{ip|}}}}}}} | ||
{{#vardefine:ip-start|{{#expr:{{#var:ip-start}} - {{mod|{{#var:ip-start}}|{{#var:ip- | {{#vardefine:ip-start|{{#expr:{{#var:ip-start}} - {{mod|{{#var:ip-start}}|{{#var:ip-num}}}}}}}} | ||
{{#vardefine:ip-end|{{IP Range/Int2IP|{{#expr:{{#var:ip-start}} + {{#var:ip- | {{#vardefine:ip-end|{{IP Range/Int2IP|{{#expr:{{#var:ip-start}} + {{#var:ip-num}} - 1}}}}}} | ||
{{#vardefine:ip-start|{{IP Range/Int2IP|{{#var:ip-start}}}}}} | {{#vardefine:ip-start|{{IP Range/Int2IP|{{#var:ip-start}}}}}} | ||
}}{{HoverText|{{#var:ip-start}}/ | }}{{HoverText|{{#var:ip-start}}/{{#var:ip-npl}}|Start: {{#var:ip-start}}, End: {{#var:ip-end}}, Addresses: {{#var:ip-num}}, Subnet Mask: {{IP Range/Int2IP|(4294967295 * {{#var:ip-num}})}}}}</includeonly> |
Revision as of 16:11, 24 April 2007
{{IP Range|ip=0.0.0.0|npl=30}} | 0.0.0.0/Expression error: Unrecognized punctuation character "{". |
{{IP Range|ip=255.255.255.255|npl=30}} | 255.255.255.252/Expression error: Unrecognized punctuation character "{". |
{{IP Range|ip=255.255.255.255|subnet=255.255.255.252}} | 255.255.255.252/Expression error: Unrecognized punctuation character "{". |