Overview
| Artifact ID: | 754c1b93888ff4d634f92ef93bcda8f1a4878bb4 |
|---|---|
| Ticket: | 1260196fffffffffffffffffffffffffffffffff |
| Date: | 2005-08-19 08:18:28 |
| User: | aakhter |
| Artifact Attached: | 26abc66d814cb63fec36206cb720b79eee60ba61 |
| Filename: | ipExtension.html |
| Description: | doc in html format |
Content:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>::ipExtension::</title><style type="text/css"> @import url(/atsdoc/css/atsdoc.css); </style></head> <body bgcolor="FFFFFF"><a name="top"></a><table border="0" cellspacing="1" cellpadding="0" width="700"> <tr> <td class="nav" width="233" align="center" valign="middle"><a href="#over">Library Header</a></td> <td class="nav" width="233" align="center" valign="middle"><a href="#files">Procedure Summary</a></td> <td class="nav" width="233" align="center" valign="middle"><a href="#procs">Procedure Details </a></td> </tr> </table><br><table border="0" cellspacing="0" cellpadding="2" width="700"> <tr> <td><a href="http://wwwin-ats.cisco.com/cgi/tcl2html.cgi?file_path=/auto/nsite-l3vpn/users/aakhter/l3vpn-proj/lib/tcl/ipExtension/ipExtension.tcl"> View Code</a> File Name: ipExtension.tcl </td> </tr> </table><a name="over"></a><table border="0" cellspacing="0" cellpadding="2" width="700"> <tr> <td bgcolor="#c0c0c0" class="head1" align="center">Library Header</td> </tr> </table> <table border="0" cellspacing="0" cellpadding="2" width="700"> <tr> <td bgcolor="#cccccc" height="25" class="head2">Library Name: ::ipExtension::</td> </tr> </table> <table width="700" bgcolor="#eeeeee" border="0" cellpadding="2" cellspacing="0"> <tr> <td class="key" colspan="2">Author(s)</td> </tr> <tr> <td width="60"> </td> <td width="630">Aamer Akhter / [email protected]</td> </tr> <tr> <td class="key" colspan="2">Support Alias</td> </tr> <tr> <td width="60"> </td> <td width="630">[email protected]</td> </tr> <tr> <td class="key" colspan="2">Purpose</td> </tr> <tr> <td width="60"> </td> <td width="630">an extension to tcllib ip library</td> </tr> <tr> <td class="key" colspan="2">Description</td> </tr> <tr> <td width="60"> </td> <td width="630"> <p>A detailed description of the functionality provided by the library.</p> </td> </tr> <tr> <td class="key" colspan="2">Usage</td> </tr> <tr> <td width="60"> </td> <td><pre><font face="Arial, Helvetica, san-serif"></font></pre></td> </tr> <tr> <td class="key" colspan="2">Requirements</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> package require logger package require ip </font></pre></td> </tr> <tr> <td class="key" colspan="2">Variables</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> namespace ::ipExtension:: id: CVS ID: keyword extraction version: current version of package packageDir: directory where package is located log: instance log </font></pre></td> </tr> <tr> <td class="key" colspan="2">Notes</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> 1. </font></pre></td> </tr> </table> <div style="position: absolute; left: 685px"><a href="#top">Top</a></div><br><a name="global"></a><a name="files"></a><table border="0" cellspacing="0" cellpadding="2" width="700"> <tr> <td bgcolor="#cccccc" class="head2">Procedures Summary</td> </tr> </table> <table width="700" bgcolor="#eeeeee" border="0" cellpadding="2" cellspacing="0"> <tr> <td width="60"> </td> <td colspan="2"><a href="#::ip::prefixToNative"><b>::ip::prefixToNative</b></a></td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td width="60"> </td> <td>convert from dotted from to native (hex) form</td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td colspan="2"><a href="#::ip::nativeToPrefix"><b>::ip::nativeToPrefix</b></a></td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td width="60"> </td> <td>convert from native (hex) form to dotted form</td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td colspan="2"><a href="#::ip::intToString"><b>::ip::intToString</b></a></td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td width="60"> </td> <td>convert from an integer/hex to dotted form</td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td colspan="2"><a href="#::ip::toInteger"><b>::ip::toInteger</b></a></td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td width="60"> </td> <td>convert dotted form ip to integer</td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td colspan="2"><a href="#::ip::toHex"><b>::ip::toHex</b></a></td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td width="60"> </td> <td>convert dotted form ip to hex</td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td colspan="2"><a href="#::ip::maskToInt"><b>::ip::maskToInt</b></a></td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td width="60"> </td> <td>convert mask to integer</td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td colspan="2"><a href="#::ip::broadcastAddress"><b>::ip::broadcastAddress</b></a></td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td width="60"> </td> <td>return broadcast address given prefix</td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td colspan="2"><a href="#::ip::maskToLength"><b>::ip::maskToLength</b></a></td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td width="60"> </td> <td>converts dotted or integer form of mask to length</td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td colspan="2"><a href="#::ip::lengthToMask"><b>::ip::lengthToMask</b></a></td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td width="60"> </td> <td>converts mask length to dotted mask form</td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td colspan="2"><a href="#::ip::nextNet"><b>::ip::nextNet</b></a></td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td width="60"> </td> <td>returns next an ipaddress in same position in next network</td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td colspan="2"><a href="#::ip::isOverlap"><b>::ip::isOverlap</b></a></td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td width="60"> </td> <td>checks to see if prefixes overlap</td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td colspan="2"><a href="#::ip::isOverlapNative"><b>::ip::isOverlapNative</b></a></td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td width="60"> </td> <td>checks to see if prefixes overlap (optimized native form)</td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td colspan="2"><a href="#::ip::ipToLayer2Multicast"><b>::ip::ipToLayer2Multicast</b></a></td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td width="60"> </td> <td>converts ipv4 address to a layer 2 multicast address</td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td colspan="2"><a href="#::ip::ipHostFromPrefix"><b>::ip::ipHostFromPrefix</b></a></td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td width="60"> </td> <td>gives back a host address from a prefix</td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td colspan="2"><a href="#::ip::reduceToAggregates"><b>::ip::reduceToAggregates</b></a></td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td width="60"> </td> <td>finds nets that overlap and filters out the more specifc nets</td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td colspan="2"><a href="#::ip::longestPrefixMatch"><b>::ip::longestPrefixMatch</b></a></td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td width="60"> </td> <td>given host IP finds longest prefix match from set of prefixes</td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td colspan="2"><a href="#::ip::cmpDotIP"><b>::ip::cmpDotIP</b></a></td> <td width="100"> </td> </tr> <tr> <td width="60"> </td> <td width="60"> </td> <td>helper function for dotted ip address for use in lsort</td> <td width="100"> </td> </tr> </table><br><table width="700" bgcolor="#eeeeee" border="0" cellpadding="2" cellspacing="0"></table><br><a name="procs"></a><table border="0" cellspacing="0" cellpadding="2" width="700"> <tr> <td bgcolor="#cccccc" class="head2">Procedure Details</td> </tr> </table><br><table width="700" bgcolor="#eeeeee" border="0" cellpadding="2" cellspacing="0"> <tr> <td bgcolor="#dedede" class="head3" colspan="2"><a name="::ip::prefixToNative"></a> External Procedure Name: ::ip::prefixToNative </td> </tr> <tr> <td class="key" colspan="2">Purpose</td> </tr> <tr> <td width="60"> </td> <td width="630">convert from dotted from to native (hex) form</td> </tr> <tr> <td class="key" colspan="2">Synopsis</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> prefixToNative <prefix> </font></pre></td> </tr> <tr> <td class="key" colspan="2">Arguments</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> <prefix> string in the <ipaddr>/<mask> format </font></pre></td> </tr> <tr> <td class="key" colspan="2">Return Output</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> <prefix> in native format {<hexip> <hexmask>} </font></pre></td> </tr> <tr> <td class="key" colspan="2">Examples</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif" color="green"> % ip::prefixToNative 1.1.1.0/24 0x01010100 0xffffff00 </font></pre></td> </tr> <tr> <td class="key" colspan="2">Notes</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> fixed bug in C extension that modified calling context variable </font></pre></td> </tr> </table> <div style="position: absolute; left: 685px"><a href="#top">Top</a></div><br><table width="700" bgcolor="#eeeeee" border="0" cellpadding="2" cellspacing="0"> <tr> <td bgcolor="#dedede" class="head3" colspan="2"><a name="::ip::nativeToPrefix"></a> External Procedure Name: ::ip::nativeToPrefix </td> </tr> <tr> <td class="key" colspan="2">Purpose</td> </tr> <tr> <td width="60"> </td> <td width="630">convert from native (hex) form to dotted form</td> </tr> <tr> <td class="key" colspan="2">Synopsis</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> nativeToPrefix <nativeList>|<native> [-ipv4] </font></pre></td> </tr> <tr> <td class="key" colspan="2">Arguments</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> <nativeList> list of native form ip addresses native form is: <native> tcllist in format {<hexip> <hexmask>} -ipv4 the provided native format addresses are in ipv4 format (default) </font></pre></td> </tr> <tr> <td class="key" colspan="2">Return Output</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> if nativeToPrefix is called with <native> a single (non-listified) address is returned if nativeToPrefix is called with a <nativeList> address list, then a list of addresses is returned return form is: <ipaddr>/<mask> </font></pre></td> </tr> <tr> <td class="key" colspan="2">Examples</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif" color="green"> % ip::nativeToPrefix {0x01010100 0xffffff00} -ipv4 1.1.1.0/24 </font></pre></td> </tr> </table> <div style="position: absolute; left: 685px"><a href="#top">Top</a></div><br><table width="700" bgcolor="#eeeeee" border="0" cellpadding="2" cellspacing="0"> <tr> <td bgcolor="#dedede" class="head3" colspan="2"><a name="::ip::intToString"></a> External Procedure Name: ::ip::intToString </td> </tr> <tr> <td class="key" colspan="2">Purpose</td> </tr> <tr> <td width="60"> </td> <td width="630">convert from an integer/hex to dotted form</td> </tr> <tr> <td class="key" colspan="2">Synopsis</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> intToString <integer/hex> [-ipv4] </font></pre></td> </tr> <tr> <td class="key" colspan="2">Arguments</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> <integer> ip address in integer form -ipv4 the provided integer addresses is ipv4 (default) </font></pre></td> </tr> <tr> <td class="key" colspan="2">Return Output</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> ip address in dotted form </font></pre></td> </tr> <tr> <td class="key" colspan="2">Examples</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif" color="green"> ip::intToString 4294967295 255.255.255.255 </font></pre></td> </tr> </table> <div style="position: absolute; left: 685px"><a href="#top">Top</a></div><br><table width="700" bgcolor="#eeeeee" border="0" cellpadding="2" cellspacing="0"> <tr> <td bgcolor="#dedede" class="head3" colspan="2"><a name="::ip::toInteger"></a> External Procedure Name: ::ip::toInteger </td> </tr> <tr> <td class="key" colspan="2">Purpose</td> </tr> <tr> <td width="60"> </td> <td width="630">convert dotted form ip to integer</td> </tr> <tr> <td class="key" colspan="2">Synopsis</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> toInteger <ipaddr> </font></pre></td> </tr> <tr> <td class="key" colspan="2">Arguments</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> <ipaddr> decimal dotted from ip address </font></pre></td> </tr> <tr> <td class="key" colspan="2">Return Output</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> integer form of <ipaddr> </font></pre></td> </tr> <tr> <td class="key" colspan="2">Examples</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif" color="green"> % ::ip::toInteger 1.1.1.0 16843008 </font></pre></td> </tr> </table> <div style="position: absolute; left: 685px"><a href="#top">Top</a></div><br><table width="700" bgcolor="#eeeeee" border="0" cellpadding="2" cellspacing="0"> <tr> <td bgcolor="#dedede" class="head3" colspan="2"><a name="::ip::toHex"></a> External Procedure Name: ::ip::toHex </td> </tr> <tr> <td class="key" colspan="2">Purpose</td> </tr> <tr> <td width="60"> </td> <td width="630">convert dotted form ip to hex</td> </tr> <tr> <td class="key" colspan="2">Synopsis</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> toHex <ipaddr> </font></pre></td> </tr> <tr> <td class="key" colspan="2">Arguments</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> <ipaddr> decimal dotted from ip address </font></pre></td> </tr> <tr> <td class="key" colspan="2">Return Output</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> hex form of <ipaddr> </font></pre></td> </tr> <tr> <td class="key" colspan="2">Examples</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif" color="green"> % ::ip::toHex 1.1.1.0 0x01010100 </font></pre></td> </tr> </table> <div style="position: absolute; left: 685px"><a href="#top">Top</a></div><br><table width="700" bgcolor="#eeeeee" border="0" cellpadding="2" cellspacing="0"> <tr> <td bgcolor="#dedede" class="head3" colspan="2"><a name="::ip::maskToInt"></a> External Procedure Name: ::ip::maskToInt </td> </tr> <tr> <td class="key" colspan="2">Purpose</td> </tr> <tr> <td width="60"> </td> <td width="630">convert mask to integer</td> </tr> <tr> <td class="key" colspan="2">Synopsis</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> maskToInt <mask> </font></pre></td> </tr> <tr> <td class="key" colspan="2">Arguments</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> <mask> mask in either dotted form or mask length form (255.255.255.0 or 24) </font></pre></td> </tr> <tr> <td class="key" colspan="2">Return Output</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> integer form of mask </font></pre></td> </tr> <tr> <td class="key" colspan="2">Examples</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif" color="green"> ::ip::maskToInt 24 4294967040 </font></pre></td> </tr> </table> <div style="position: absolute; left: 685px"><a href="#top">Top</a></div><br><table width="700" bgcolor="#eeeeee" border="0" cellpadding="2" cellspacing="0"> <tr> <td bgcolor="#dedede" class="head3" colspan="2"><a name="::ip::broadcastAddress"></a> External Procedure Name: ::ip::broadcastAddress </td> </tr> <tr> <td class="key" colspan="2">Purpose</td> </tr> <tr> <td width="60"> </td> <td width="630">return broadcast address given prefix</td> </tr> <tr> <td class="key" colspan="2">Synopsis</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> broadcastAddress <prefix> [-ipv4] </font></pre></td> </tr> <tr> <td class="key" colspan="2">Arguments</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> <prefix> route in the form of <ipaddr>/<mask> or native form {<hexip> <hexmask>} -ipv4 the provided native format addresses are in ipv4 format (default) note: broadcast addresses are not valid in ipv6 </font></pre></td> </tr> <tr> <td class="key" colspan="2">Return Output</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> ipaddress of broadcast </font></pre></td> </tr> <tr> <td class="key" colspan="2">Examples</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif" color="green"> ::ip::broadcastAddress 1.1.1.0/24 1.1.1.255 ::ip::broadcastAddress {0x01010100 0xffffff00} 0x010101ff </font></pre></td> </tr> </table> <div style="position: absolute; left: 685px"><a href="#top">Top</a></div><br><table width="700" bgcolor="#eeeeee" border="0" cellpadding="2" cellspacing="0"> <tr> <td bgcolor="#dedede" class="head3" colspan="2"><a name="::ip::maskToLength"></a> External Procedure Name: ::ip::maskToLength </td> </tr> <tr> <td class="key" colspan="2">Purpose</td> </tr> <tr> <td width="60"> </td> <td width="630">converts dotted or integer form of mask to length</td> </tr> <tr> <td class="key" colspan="2">Synopsis</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> maskToLength <dottedMask>|<integerMask>|<hexMask> [-ipv4] </font></pre></td> </tr> <tr> <td class="key" colspan="2">Arguments</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> <dottedMask> <integerMask> <hexMask> mask to convert to prefix length format (eg /24) -ipv4 the provided integer/hex format masks are ipv4 (default) </font></pre></td> </tr> <tr> <td class="key" colspan="2">Return Output</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> prefix length </font></pre></td> </tr> <tr> <td class="key" colspan="2">Examples</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif" color="green"> ::ip::maskToLength 0xffffff00 -ipv4 24 % ::ip::maskToLength 255.255.255.0 24 </font></pre></td> </tr> </table> <div style="position: absolute; left: 685px"><a href="#top">Top</a></div><br><table width="700" bgcolor="#eeeeee" border="0" cellpadding="2" cellspacing="0"> <tr> <td bgcolor="#dedede" class="head3" colspan="2"><a name="::ip::lengthToMask"></a> External Procedure Name: ::ip::lengthToMask </td> </tr> <tr> <td class="key" colspan="2">Purpose</td> </tr> <tr> <td width="60"> </td> <td width="630">converts mask length to dotted mask form</td> </tr> <tr> <td class="key" colspan="2">Synopsis</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> lengthToMask <maskLength> [-ipv4] </font></pre></td> </tr> <tr> <td class="key" colspan="2">Arguments</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> <maskLength> mask length -ipv4 the provided mask length is ipv4 (default) </font></pre></td> </tr> <tr> <td class="key" colspan="2">Return Output</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> mask in dotted form </font></pre></td> </tr> <tr> <td class="key" colspan="2">Examples</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif" color="green"> ::ip::lengthToMask 24 255.255.255.0 </font></pre></td> </tr> </table> <div style="position: absolute; left: 685px"><a href="#top">Top</a></div><br><table width="700" bgcolor="#eeeeee" border="0" cellpadding="2" cellspacing="0"> <tr> <td bgcolor="#dedede" class="head3" colspan="2"><a name="::ip::nextNet"></a> External Procedure Name: ::ip::nextNet </td> </tr> <tr> <td class="key" colspan="2">Purpose</td> </tr> <tr> <td width="60"> </td> <td width="630">returns next an ipaddress in same position in next network</td> </tr> <tr> <td class="key" colspan="2">Synopsis</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> nextNet <ipaddr> <mask> [<count>] [-ipv4] </font></pre></td> </tr> <tr> <td class="key" colspan="2">Arguments</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> <ipaddress> in hex/integer/dotted format <mask> mask in hex/integer/dotted/maskLen format <count> number of nets to skip over (default is 1) -ipv4 the provided hex/integer addresses are in ipv4 format (default) </font></pre></td> </tr> <tr> <td class="key" colspan="2">Return Output</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> ipaddress in same position in next network in hex </font></pre></td> </tr> </table> <div style="position: absolute; left: 685px"><a href="#top">Top</a></div><br><table width="700" bgcolor="#eeeeee" border="0" cellpadding="2" cellspacing="0"> <tr> <td bgcolor="#dedede" class="head3" colspan="2"><a name="::ip::isOverlap"></a> External Procedure Name: ::ip::isOverlap </td> </tr> <tr> <td class="key" colspan="2">Purpose</td> </tr> <tr> <td width="60"> </td> <td width="630">checks to see if prefixes overlap</td> </tr> <tr> <td class="key" colspan="2">Synopsis</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> isOverlap <prefix> <prefix1> <prefix2>... </font></pre></td> </tr> <tr> <td class="key" colspan="2">Arguments</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> <prefix> in form <ipaddr>/<mask> prefix to compare <prefixN> against <prefixN> in form <ipaddr>/<mask> prefixes to compare against </font></pre></td> </tr> <tr> <td class="key" colspan="2">Return Output</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> 1 if there is an overlap </font></pre></td> </tr> <tr> <td class="key" colspan="2">Examples</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif" color="green"> % ::ip::isOverlap 1.1.1.0/24 2.1.0.1/32 0 ::ip::isOverlap 1.1.1.0/24 2.1.0.1/32 1.1.1.1/32 1 </font></pre></td> </tr> </table> <div style="position: absolute; left: 685px"><a href="#top">Top</a></div><br><table width="700" bgcolor="#eeeeee" border="0" cellpadding="2" cellspacing="0"> <tr> <td bgcolor="#dedede" class="head3" colspan="2"><a name="::ip::isOverlapNative"></a> External Procedure Name: ::ip::isOverlapNative </td> </tr> <tr> <td class="key" colspan="2">Purpose</td> </tr> <tr> <td width="60"> </td> <td width="630">checks to see if prefixes overlap (optimized native form)</td> </tr> <tr> <td class="key" colspan="2">Synopsis</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> isOverlap <hexipaddr> <hexmask> {{<hexipaddr1> <hexmask1>} {<hexipaddr2> <hexmask2>...} </font></pre></td> </tr> <tr> <td class="key" colspan="2">Arguments</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> -all return all overlaps rather than the first one -inline rather than returning index values, return the actual overlap prefixes <hexipaddr> ipaddress in hex/integer form <hexMask> mask in hex/integer form -ipv4 the provided native format addresses are in ipv4 format (default) </font></pre></td> </tr> <tr> <td class="key" colspan="2">Return Output</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> non-zero if there is an overlap, value is element # in list with overlap </font></pre></td> </tr> <tr> <td class="key" colspan="2">Description</td> </tr> <tr> <td width="60"> </td> <td width="630"> <p>isOverlapNative is avaliabel both as a C extension and in a native tcl form if the extension is loaded (tried automatically), isOverlapNative will be linked to isOverlapNativeC. If an extension is not loaded, then isOverlapNative will be linked to the native tcl proc: ipOverlapNativeTcl. </p> </td> </tr> <tr> <td class="key" colspan="2">Examples</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif" color="green"> % ::ip::isOverlapNative 0x01010100 0xffffff00 {{0x02010001 0xffffffff}} 0 %::ip::isOverlapNative 0x01010100 0xffffff00 {{0x02010001 0xffffffff} {0x01010101 0xffffffff}} 2 </font></pre></td> </tr> </table> <div style="position: absolute; left: 685px"><a href="#top">Top</a></div><br><table width="700" bgcolor="#eeeeee" border="0" cellpadding="2" cellspacing="0"> <tr> <td bgcolor="#dedede" class="head3" colspan="2"><a name="::ip::ipToLayer2Multicast"></a> External Procedure Name: ::ip::ipToLayer2Multicast </td> </tr> <tr> <td class="key" colspan="2">Purpose</td> </tr> <tr> <td width="60"> </td> <td width="630">converts ipv4 address to a layer 2 multicast address</td> </tr> <tr> <td class="key" colspan="2">Synopsis</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> ipToLayer2Multicast <ipaddr> </font></pre></td> </tr> <tr> <td class="key" colspan="2">Arguments</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> <ipaddr> ipaddress in dotted form </font></pre></td> </tr> <tr> <td class="key" colspan="2">Return Output</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> mac address in xx.xx.xx.xx.xx.xx form </font></pre></td> </tr> <tr> <td class="key" colspan="2">Examples</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif" color="green"> % ::ip::ipToLayer2Multicast 224.0.0.2 01.00.5e.00.00.02 </font></pre></td> </tr> </table> <div style="position: absolute; left: 685px"><a href="#top">Top</a></div><br><table width="700" bgcolor="#eeeeee" border="0" cellpadding="2" cellspacing="0"> <tr> <td bgcolor="#dedede" class="head3" colspan="2"><a name="::ip::ipHostFromPrefix"></a> External Procedure Name: ::ip::ipHostFromPrefix </td> </tr> <tr> <td class="key" colspan="2">Purpose</td> </tr> <tr> <td width="60"> </td> <td width="630">gives back a host address from a prefix</td> </tr> <tr> <td class="key" colspan="2">Synopsis</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> ::ip::ipHostFromPrefix <prefix> [-exclude <list of prefixes>] </font></pre></td> </tr> <tr> <td class="key" colspan="2">Arguments</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> <prefix> prefix is <ipaddr>/<masklen> -exclude <list of prefixes> list if ipprefixes that host should not be in </font></pre></td> </tr> <tr> <td class="key" colspan="2">Return Output</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> ip address </font></pre></td> </tr> <tr> <td class="key" colspan="2">Examples</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif" color="green"> %::ip::ipHostFromPrefix 1.1.1.5/24 1.1.1.1 %::ip::ipHostFromPrefix 1.1.1.1/32 1.1.1.1 </font></pre></td> </tr> </table> <div style="position: absolute; left: 685px"><a href="#top">Top</a></div><br><table width="700" bgcolor="#eeeeee" border="0" cellpadding="2" cellspacing="0"> <tr> <td bgcolor="#dedede" class="head3" colspan="2"><a name="::ip::reduceToAggregates"></a> External Procedure Name: ::ip::reduceToAggregates </td> </tr> <tr> <td class="key" colspan="2">Purpose</td> </tr> <tr> <td width="60"> </td> <td width="630">finds nets that overlap and filters out the more specifc nets</td> </tr> <tr> <td class="key" colspan="2">Synopsis</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> ::ip::reduceToAggregates <prefixList> </font></pre></td> </tr> <tr> <td class="key" colspan="2">Arguments</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> <prefixList> prefixList a list in the from of is <ipaddr>/<masklen> or native format </font></pre></td> </tr> <tr> <td class="key" colspan="2">Return Output</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> non-overlapping ip prefixes </font></pre></td> </tr> <tr> <td class="key" colspan="2">Examples</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif" color="green"> % ::ip::reduceToAggregates {1.1.1.0/24 1.1.0.0/8 2.1.1.0/24 1.1.1.1/32 } 1.0.0.0/8 2.1.1.0/24 </font></pre></td> </tr> </table> <div style="position: absolute; left: 685px"><a href="#top">Top</a></div><br><table width="700" bgcolor="#eeeeee" border="0" cellpadding="2" cellspacing="0"> <tr> <td bgcolor="#dedede" class="head3" colspan="2"><a name="::ip::longestPrefixMatch"></a> External Procedure Name: ::ip::longestPrefixMatch </td> </tr> <tr> <td class="key" colspan="2">Purpose</td> </tr> <tr> <td width="60"> </td> <td width="630">given host IP finds longest prefix match from set of prefixes</td> </tr> <tr> <td class="key" colspan="2">Synopsis</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> ::ip::longestPrefixMatch <ipaddr> <prefixList> [-ipv4] </font></pre></td> </tr> <tr> <td class="key" colspan="2">Arguments</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> <prefixList> is list of <ipaddr> in native or dotted form <ipaddr> ip address in <ipprefix> format, dotted form, or integer form -ipv4 the provided integer format addresses are in ipv4 format (default) </font></pre></td> </tr> <tr> <td class="key" colspan="2">Return Output</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> <ipprefix> that is the most specific match to <ipaddr> </font></pre></td> </tr> <tr> <td class="key" colspan="2">Examples</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif" color="green"> % ::ip::longestPrefixMatch 1.1.1.1 {1.1.1.0/24 1.0.0.0/8 2.1.1.0/24 1.1.1.0/28 } 1.1.1.0/28 </font></pre></td> </tr> </table> <div style="position: absolute; left: 685px"><a href="#top">Top</a></div><br><table width="700" bgcolor="#eeeeee" border="0" cellpadding="2" cellspacing="0"> <tr> <td bgcolor="#dedede" class="head3" colspan="2"><a name="::ip::cmpDotIP"></a> External Procedure Name: ::ip::cmpDotIP </td> </tr> <tr> <td class="key" colspan="2">Purpose</td> </tr> <tr> <td width="60"> </td> <td width="630">helper function for dotted ip address for use in lsort</td> </tr> <tr> <td class="key" colspan="2">Synopsis</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> ::ip::cmpDotIP <ipaddr1> <ipaddr2> </font></pre></td> </tr> <tr> <td class="key" colspan="2">Arguments</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> <ipaddr1> <ipaddr2> prefix is in dotted ip address format </font></pre></td> </tr> <tr> <td class="key" colspan="2">Return Output</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif"> -1 if ipaddr1 is less that ipaddr2 1 if ipaddr1 is more that ipaddr2 0 if ipaddr1 and ipaddr2 are equal </font></pre></td> </tr> <tr> <td class="key" colspan="2">Examples</td> </tr> <tr> <td width="60"> </td> <td width="630"><pre><font face="Arial, Helvetica, san-serif" color="green"> % lsort -command ip::cmpDotIP {1.0.0.0 2.2.0.0 128.0.0.0 3.3.3.3} 1.0.0.0 2.2.0.0 3.3.3.3 128.0.0.0 </font></pre></td> </tr> </table> <div style="position: absolute; left: 685px"><a href="#top">Top</a></div><a name="over"></a><p> </p> <div style="font-family: Arial, Helvetica, sans-serif; font-size: 11px;"> <table width="700" border="0" cellspacing="2" cellpadding="2"> <tr> <td> <div style="font-family: Arial, Helvetica, sans-serif; font-size: 11px;"><strong>Copyright (c) Cisco Systems, Inc. <a href="http://wwwin.cisco.com/infosec/policies/info_sensitivity.html">Internal Use Only</a></strong><br><script language="JavaScript"> document.write("Last Modified on: " + document.lastModified ); </script></div> </td> </tr> </table> </div> </body> </html>
