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

📄 arp.4p

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 4P
字号:
.\" SCCSID: @(#)arp.4p	2.1	3/10/87.\" SCCSID: @(#)arp.4p	2.1	3/10/87.TH arp 4p.SH Namearp \- Address Resolution Protocol.SH Syntax  .B "pseudo-device ether".SH Description.NXR "Address Resolution Protocol".NXR "Address Resolution Protocol" "communicating with non-ARP system".NXR "Ethernet address" "mapping to Internet address".NXR "Internet address" "mapping to Ethernet address"TheARP protocol is used to map dynamically between DARPA Internetand 10Mb/s Ethernet addresses.  It isused by all the 10Mb/s Ethernet interface drivers..PPThe ARP protocol caches Internet-Ethernet address mappings.  When an interfacerequests a mapping for an address not in the cache, ARP queues themessage which requires the mapping and broadcastsa message on the associated network requesting the address mapping.If a response is provided, the new mapping is cached and any pendingmessages are transmitted.  The ARP protocol queues only the most recently ``transmitted''  packet while waiting for a mapping request to be responded to..PPTo enable communications with systems which do not use ARP, ioctlsare provided to enter and deleteentries in the Internet-to-Ethernet tables.The usage is:.EX 0#include <sys/ioctl.h>#include <sys/socket.h>#include <net/if.h>struct arpreq arpreq;ioctl(s, SIOCSARP, (caddr_t)&arpreq);ioctl(s, SIOCGARP, (caddr_t)&arpreq);ioctl(s, SIOCDARP, (caddr_t)&arpreq);.EE.PPEach ioctl takes the same structure as an argument.SIOCSARP sets an ARP entry, SIOCGARP gets an ARP entry, and SIOCDARPdeletes an ARP entry.These ioctls may be applied to any socket descriptor.I s,but only by the superuser.The.I arpreqstructure contains:.EX 0/* * ARP ioctl request */struct arpreq {    struct sockaddr   arp_pa;     /* protocol address */    struct sockaddr   arp_ha;     /* hardware address */    int               arp_flags;  /* flags */};/*  arp_flags field values */#define ATF_COM  2   /* completed entry (arp_ha valid) */#define	ATF_PERM 4   /* permanent entry */#define	ATF_PUBL 8   /* publish (respond for other host) */.EE.PPThe address family for the.I arp_pasockaddr must be AF_INET; for the .I arp_hasockaddr, it must be AF_UNSPEC.The only flag bits that can be written are ATF_PERM and ATF_PUBL.ATF_PERM causes the entry to be permanent if the ioctl call succeeds.The ioctl may fail if morethan four permanent Internet host addresses hash to the same slot.ATF_PUBL specifies that the ARP codeshould respond to ARP requests for theindicated host coming from other machines.  This lets a SUN act as anARP server, which can be used to make an ARP-only machine talkto a non-ARP machine..PPThe ARP protocol watches passively for a host that responds to an ARP mapping request for the local host's address..SH Restrictions .NXR "Address Resolution Protocol" "restricted"ARP packets on the Ethernet use only 42 bytes of data.  The smallestlegal Ethernet packet is 60 bytes, however, not including CRC.Some systems may not enforce the minimum packet size.  .SH Diagnostics.NXR "Address Resolution Protocol" "diagnostics".B "duplicate IP address!! sent from Ethernet address: %x:%x:%x:%x:%x:%x".brARP has discovered another host on the local network that responds tomapping requests for its own Internet address..SH See Alsoinet(4f), arp(8c), ifconfig(8c)

⌨️ 快捷键说明

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