net :: ³Ý ¸¶½ºÅ©±¸¹® ºÐ¼®, Á¶ÀÛ ¹× Á¶È¸ IP ³×Æ®¿öÅ© ºí·Ï | |
Áö±Ý ´Ù¿î·Îµå |
net :: ³Ý ¸¶½ºÅ© ¼øÀ§ ¹× ¿ä¾à
±¤°í
- ƯÇã:
- Perl Artistic License
- °¡°Ý:
- FREE
- °Ô½ÃÀÚ À̸§:
- David Muir Sharnoff
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://search.cpan.org/~muir/
net :: ³Ý ¸¶½ºÅ© ű×
net :: ³Ý ¸¶½ºÅ© ¼³¸í
±¸¹® ºÐ¼®, Á¶ÀÛ ¹× Á¶È¸ IP ³×Æ®¿öÅ© ºí·Ï net :: ³Ý ¸¶½ºÅ©´Â IPv4 CIDR ºí·ÏÀ» ÆĽÌÇÏ°í ÀÌÇØÇÏ´Â Perl ¸ðµâÀÔ´Ï´Ù. °´Ã¼ ÁöÇâ ÀÎÅÍÆäÀ̽º·Î ±¸ÃàµÇ¾ú½À´Ï´Ù. °ÅÀÇ ¸ðµç ±â´ÉÀº Net :: NetMask °´Ã¼¿¡¼ ÀÛµ¿ÇÏ´Â ¸Þ¼ÒµåÀÔ´Ï´Ù. ³×Æ®¿öÅ© ºí·Ï¿¡ ´ëÇÑ °ÅÀÇ ¸ðµç Á¤º¸¸¦ Á¦°ø ÇÒ ¼öÀÖ´Â ³×Æ®¿öÅ© ºí·ÏÀ» Å×ÀÌºí¿¡ ³ÖÀº ´ÙÀ½ ³ªÁß¿¡ ÇÔ¼ö°¡ ÀÖ½À´Ï´Ù. ·è¾÷ ³×Æ®¿öÅ© ºí·Ï ÇØ´ç Å×À̺íÀÇ IP ÁÖ¼Ò·Î Â÷´ÜÇÕ´Ï´Ù. IP ÁÖ¼Ò ¹üÀ§¸¦ CIDR ºí·Ï ¸ñ·ÏÀ¸·Î ÀüȯÇÏ´Â ±â´ÉÀÌ ÀÖ½À´Ï´Ù. CIDR ºí·Ï ¸ñ·ÏÀ» IP ÁÖ¼Ò ¸ñ·ÏÀ¸·Î ÀüȯÇÏ´Â ±â´ÉÀÌ ÀÖ½À´Ï´Ù. ÅؽºÆ® IP ÁÖ¼Ò·Î Á¤·ÄÇÏ´Â ±â´ÉÀÔ´Ï´Ù .SynopSisuse Net :: NetMask; $ block = new net :: netmask (³×Æ®¿öÅ© ºí·Ï) $ block = new net :: netmask (³×Æ®¿öÅ© ºí·Ï, ³Ý ¸¶½ºÅ©) $ block = new2 net :: netmask (³×Æ®¿öÅ© ºí·Ï) $ block = new2 net :: ³Ý ¸¶½ºÅ© (³×Æ®¿öÅ© ºí·Ï, ³Ý ¸¶½ºÅ©) $ ºí·ÏÀ» ÀμâÇϽʽÿÀ. # ABCD / BITS Àμâ $ ºí·Ï -> BAST () $ ºí·Ï> ¸¶½ºÅ© Àμâ $ ºí·Ï -> hostMask () Àμâ $ ºí·Ï -> ºñÆ® () Àμâ $ ºí·Ï -> Å©±â () Àμâ $ ºí·Ï -> maxblock () $ ºí·Ï -> ºê·Îµå ij½ºÆ® () Àμâ $ ºí·Ï -> ´ÙÀ½ () Àμâ $ ºí·Ï -> ÀÏÄ¡ ($ IP); $ ºí·Ï Àμâ -> n ¹ø° (1, ); if ($ block-> sameblock ( "³×Æ®¿öÅ© ºí·Ï") ... ($ block-> cmpBlocks ( "³×Æ®¿öÅ© ºí·Ï") ... $ NewBlock = $ Block-> NextBlock (); $ IP ($ ºí·Ï -> enumerate ()) {} $ ZONE ($ block-> inaddr ()) {} ³» $ table = {}; $ ºí·Ï -> StoreNetBlock () $ ºí·Ï -> deleteNetBlock () @missingblocks = $ ºí·Ï -> CIDRS2Inverthe (@blocks) $ block = findnetbrock (IP, ) $ block = findouternetblock (IP, ) @blocks = FindAllNetBlock (IP, ) ($ BLOCK-> CHECHNETBLOCK () ... $ BLOCK2 = $ BLOCK1-> FindOuternetBlock () @blocks = @blocks = @blocks = range2cidrlist ($ beginip, $ endip); @blocks = cidrs2cidrs (@blocks_with_dups) @listofblocks = cidrs2contiglists (@blocks); @blocks = sort @blocks @blocks = sort_network_blocks ( @blocks) @sorted_ip_addrs = sort_by_ip_address (@unsorted_ip_addrs) ¿ä±¸ »çÇ× : ¡¤ Perl.
net :: ³Ý ¸¶½ºÅ© °ü·Ã ¼ÒÇÁÆ®¿þ¾î