.\" Copyright (c) 1995 .\" Bill Paul . All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by Bill Paul. .\" 4. Neither the name of the author nor the names of any co-contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" %FreeBSD: src/lib/libc/net/ethers. 3, v 1.10. 2.10 2001/12/14 18:33:55 ru Exp % .\" $FreeBSD: doc/ja_JP.eucJP/man/man3/ethers. 3, v 1.6 2002/05/18 07:12:54 horikawa Exp $ .\" .Dd April 12, 1995 .Dt ETHERS 3 .Os .Sh ¸íĪ .Nm ethers , .Nm ether_line , .Nm ether_aton , .Nm ether_ntoa , .Nm ether_ntohost , .Nm ether_hostton .Nd ÀÌ´õ³Ý ¾îµå·¹½º º¯È¯ ¹× Á¶»ç routine .Sh ÇÁ·Î±×·¥ ¶óÀ̺귯¸® .Lb libc .Sh ¼­½Ä .In sys/types.h .In sys/socket.h .In net/ethernet.h .Ft int .Fn ether_line "const char *l" "struct ether_addr *e" "char *hostname" .Ft struct ether_addr * .Fn ether_aton "const char *a" .Ft char * .Fn ether_ntoa "const struct ether_addr *n" .Ft int .Fn ether_ntohost "char *hostname" "const struct ether_addr *e" .Ft int .Fn ether_hostton "const char *hostname" "struct ether_addr *e" .Sh ÇØ¼³ ÀÌ·¯ÇÑ ÇÔ¼ö´Â, .Ar ether_addr ±¸Á¶Ã¼¸¦ »ç¿ëÇØ ÀÌ´õ³Ý ¾îµå·¹½º¸¦ Á¶ÀÛÇÕ´Ï´Ù. ÀÌ ±¸Á¶Ã¼´Â Çì´õ ÆÄÀÏ .Aq Pa netinet/if_ether.h ¿¡ Á¤Àǵǰí ÀÖ½À´Ï´Ù. .Bd -literal -offset indent /* * ÀÌ´õ³Ý(ethernet)(MAC) ÁÖ¼ÒÀÇ ¹ÙÀÌÆ®¼ö */ #define ETHER_ADDR_LEN 6 /* * 48 ºñÆ® ÀÌ´õ³Ý ¾îµå·¹½ºÀÇ ±¸Á¶Ã¼ */ struct ether_addr { u_char octet[ETHER_ADDR_LEN]; }; .Ed .Pp .Fn ether_line ÇÔ¼ö´Â, .Xr ethers 5 Çü½ÄÀÇ .Tn ASCII ij¸¯ÅÍ ¶óÀÎÀÌ´Ù .Ar l (À»)¸¦ ÁÖ»ç ÇØ, ij¸¯ÅÍ ¶óÀÎÀ¸·Î ÁöÁ¤µÈ ÀÌ´õ³Ý ¾îµå·¹½º¸¦ .Ar e (À¸)·Î ¼³Á¤ÇØ, È£½ºÆ®¸íÀ» .Ar h (À¸)·Î ¼³Á¤ÇÕ´Ï´Ù. ÀÌ ÇÔ¼ö´Â, .Pa /etc/ethers ÀÇ ÇàÀ» ±× ±¸¼º ºÎºÐ¿¡ ÆÛ½º Çϴµ¥ »ç¿ëµË´Ï´Ù. .Pp .Fn ether_aton ÇÔ¼ö´Â, ÀÌ´õ³Ý ¾îµå·¹½ºÀÇ .Tn ASCII Ç¥ÇöÀ» .Ar ether_addr ±¸Á¶Ã¼·Î º¯È¯ÇÕ´Ï´Ù. °°ÀÌ .Fn ether_ntoa (Àº)´Â, .Ar ether_addr ±¸Á¶Ã¼·Î¼­ ÁöÁ¤µÈ ÀÌ´õ³Ý ¾îµå·¹½º¸¦ .Tn ASCII ij¸¯ÅÍ ¶óÀÎÀ¸·Î º¯È¯ÇÕ´Ï´Ù. .Pp .Fn ether_ntohost ÇÔ¼ö¿Í .Fn ether_hostton ÇÔ¼ö´Â, ÀÌ´õ³Ý ¾îµå·¹½º¸¦ .Pa /etc/ethers µ¥ÀÌŸº£À̽º·Î ÁöÁ¤µÈ ´ëÀÀÇϴ ȣ½ºÆ®¸í¿¡ MAP ÇÕ´Ï´Ù. .Fn ether_ntohost (Àº)´Â, ÀÌ´õ³Ý ¾îµå·¹½º·ÎºÎÅÍ È£½ºÆ®¸í¿¡ÀÇ º¯È¯À» ½Ç½ÃÇØ, .Fn ether_hostton (Àº)´Â, È£½ºÆ®¸íÀ¸·ÎºÎÅÍ ÀÌ´õ³Ý ¾îµå·¹½º¿¡ÀÇ º¯È¯À» ½Ç½ÃÇÕ´Ï´Ù. .Sh ¹Ýȯ°ª .Fn ether_line (Àº)´Â, 󸮰¡ ¼º°øÇϸé(ÀÚ) 0 À» µ¹·ÁÁÝ´Ï´Ù. ÁÖ¾îÁø Çà .Ar l ÀÇ ÀϺο¡¼­µµ ÆÛ½º ÇÒ ¼ö ¾ø¾ú´ø °æ¿ì´Â 0 ÀÌ ¾Æ´Ñ °ªÀ» µ¹·ÁÁÝ´Ï´Ù. ÃßÃâµÈ ÀÌ´õ³Ý ¾îµå·¹½º°¡ ÁÖ¾îÁ³´Ù .Ar ether_addr ±¸Á¶Ã¼ .Ar e ¿¡ µ¹·ÁÁÖ¾î, È£½ºÆ®¸íÀÌ ÁÖ¾îÁø ij¸¯ÅÍ ¶óÀÎ .Ar h ¿¡ µ¹·ÁÁÝ´Ï´Ù. .Pp .Fn ether_ntoa (Àº)´Â, 󸮰¡ ¼º°øÇϸé(ÀÚ) ÀÌ´õ³Ý ¾îµå·¹½ºÀÇ .Tn ASCII Ç¥ÇöÀÌ µé¾î°£ ij¸¯ÅÍ ¶óÀο¡ÀÇ Æ÷ÀÎÅ͸¦ µ¹·ÁÁÝ´Ï´Ù. ÁÖ¾îÁ³´Ù .Ar ether_addr ±¸Á¶Ã¼¸¦ º¯È¯ÇÒ ¼ö ¾ø¾ú´ø °æ¿ì´Â, .Dv NULL Æ÷ÀÎÅ͸¦ µ¹·ÁÁÝ´Ï´Ù. ¶È°°ÀÌ, .Fn ether_aton (Àº)´Â ¼º°øÇϸé(ÀÚ) .Ar ether_addr ±¸Á¶Ã¼¿¡ÀÇ Æ÷ÀÎÅ͸¦ µ¹·ÁÁÖ¾î, ½ÇÆÐÇϸé(ÀÚ) .Dv NULL Æ÷ÀÎÅ͸¦ µ¹·ÁÁÝ´Ï´Ù. .Pp .Fn ether_ntohost ÇÔ¼ö¿Í .Fn ether_hostton ÇÔ¼ö´Â ¾çÂÊ ¸ðµÎ, ¼º°øÇßÀ» °æ¿ì´Â 0 À» µ¹·ÁÁÖ¾î, .Pa /etc/ethers µ¥ÀÌŸº£À̽º³»¿¡ ÀÏÄ¡ÇÏ´Â °ÍÀ» ã¾Æ³¾ ¼ö ¾ø¾ú´ø °æ¿ì´Â 0 ÀÌ ¾Æ´Ñ °ªÀ» µ¹·ÁÁÝ´Ï´Ù. .Sh ÁÖ À¯Àú´Â, .Fn ether_line , .Fn ether_ntohost ¹× .Fn ether_hostton ÀÇ °¢ ÇÔ¼ö¿¡°Ô °Ç³×Áö´Â È£½ºÆ® ¸í¹®ÀÚ¿­ÀÌ, µ¹·ÁÁÖ¾îÁø È£½ºÆ®¸íÀ» ³ÖÀ» ¼ö ÀÖÀ» ¸¸Å­ Å« ÀÏÀ» ÇÁ·ÎÅØ¼ÇÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù. .Sh NIS »óÈ£ÀÛ¿ë .Pa /etc/ethers ÀÇ ¾È¿¡ 1 °³ÀÇ °Í + ÀÌ µé¾î°£ ÇàÀÌ ÀÖ´Â °æ¿ì, .Fn ether_ntohost ÇÔ¼ö¿Í .Fn ether_hostton ÇÔ¼ö´Â, .Pa /etc/ethers ÆÄÀϳ»ÀÇ µ¥ÀÌÅÍ¿¡ °¡¼¼ÇØ, NIS .Pa ethers.byname ¹× .Pa ethers.byaddr MAP¸¦ Á¶»çÇÏ·Á°í ÇÕ´Ï´Ù. .Sh °ü·Ã Ç׸ñ .Xr yp 4 , .Xr ethers 5 .Sh ¹ö±× .Fn ether_aton ÇÔ¼ö¿Í .Fn ether_ntoa ÇÔ¼ö´Â, À̰͵éÀÌ ´ÙÀ½¿¡ ºÒ·Á °¬À» ¶§¿¡´Â µ¡¾²±âµÉ °¡´É¼ºÀÌ ÀÖ´Â Á¤Àû ¸Þ¸ð¸® area¿¡ º¸Á¸µÈ °ªÀ» µ¹·ÁÁÝ´Ï´Ù. .Sh ¿ª»ç .Nm ÇÁ·Î±×·¥ ¶óÀ̺귯¸® ÇÔ¼öÀÇ ÀÌ ½ÇÀåÀº, .Fx 2.1 (À»)¸¦ À§Çؼ­(¶§¹®¿¡) ÀÛ¼ºµÇ¾î µîÀåÇß½À´Ï´Ù.