⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ethers.3

📁 ecos实时嵌入式操作系统
💻 3
字号:
.\"	$OpenBSD: ethers.3,v 1.14 2001/08/06 10:42:26 mpech Exp $.\".\" Written by roland@frob.com.  Public domain..\".Dd December 16, 1993.Dt ETHERS 3.Os.Sh NAME.Nm ether_aton ,.Nm ether_ntoa ,.Nm ether_addr ,.Nm ether_ntohost ,.Nm ether_hostton ,.Nm ether_line.Nd get ethers entry.Sh SYNOPSIS.Fd #include <netinet/if_ether.h>.Ft char *.Fn ether_ntoa "struct ether_addr *e".Ft struct ether_addr *.Fn ether_aton "char *s".Ft int.Fn ether_ntohost "char *hostname" "struct ether_addr *e".Ft int.Fn ether_hostton "char *hostname" "struct ether_addr *e".Ft int.Fn ether_line "char *l" "struct ether_addr *e" "char *hostname".Sh DESCRIPTIONEthernet addresses are represented by thefollowing structure:.Bd -literal -offset indentstruct ether_addr {        u_int8_t  ether_addr_octet[6];};.Ed.PpThe.Fn ether_ntoafunction converts this structure into an.Tn ASCIIstring of the form.Dq xx:xx:xx:xx:xx:xx ,consisting of 6 hexadecimal numbers separatedby colons.It returns a pointer to a static buffer that is reused for each call.The.Fn ether_atonconverts an.Tn ASCIIstring of the same form and to a structurecontaining the 6 octets of the address.It returns a pointer to a static structure that is reused for each call..PpThe.Fn ether_ntohostand.Fn ether_hosttonfunctions interrogate the database mapping host names to Ethernetaddresses,.Pa /etc/ethers .The.Fn ether_ntohostfunction looks up the given Ethernet address and writes the associatedhost name into the character buffer passed.This buffer should be.Dv MAXHOSTNAMELENcharacters in size.The.Fn ether_hosttonfunction looks up the given host name and writes the associatedEthernet address into the structure passed.Both functions returnzero if they find the requested host name or address, and \-1 if not..PpEach call reads.Pa /etc/ethersfrom the beginning; if a.Ql +appears alone on a line in the file, then.Fn ether_hosttonwill consult the.Pa ethers.bynameYP map, and.Fn ether_ntohostwill consult the.Pa ethers.byaddrYP map..PpThe.Fn ether_linefunction parses a line from the.Pa /etc/ethersfile and fills in the passed.Li struct ether_addrand character buffer with the Ethernet address and host name on the line.It returns zero if the line was successfully parsed and \-1 if not.The character buffer should be.Dv MAXHOSTNAMELENcharacters in size..Sh FILES.Bl -tag -width /etc/ethers -compact.It Pa /etc/ethers.El.Sh SEE ALSO.Xr ethers 5.Sh HISTORYThe.Fn ether_ntoa ,.Fn ether_aton ,.Fn ether_ntohost ,.Fn ether_hostton ,and.Fn ether_linefunctions were adopted from SunOS and appeared in.Nx 0.9 b..Sh BUGSThe data space used by these functions is static; if future userequires the data, it should be copied before any subsequent calls tothese functions overwrite it.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -