06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

pNA+ <strong>System</strong> <strong>Calls</strong> ioctl<br />

struct arpreq {<br />

struct sockaddr arp_pa; /* protocol address */<br />

struct sockaddr arp_ha; /* hardware address */<br />

int arp_flags; /* flags */<br />

};<br />

The arp_pa structure is used to specify the host’s IP address. The address family<br />

field in arp_pa must be AF_INET. The arp_ha structure is used to specify the<br />

host’s hardware address. The arp_ha address field must be AF_UNSPEC.<br />

arp_flags must be one of the following symbolic constants, defined in pna.h:<br />

Symbolic Constant Description<br />

ATF_PERM Permanent entry.<br />

ATF_PUBL Publish (respond for other host.)<br />

ATF_PERM makes the entry permanent if the ioctl() call succeeds. ATF_PUBL<br />

specifies that the ARP protocol should respond to ARP requests coming from other<br />

machines for the indicated host. This allows a host to act as an ARP server, which<br />

might be useful in convincing an ARP-only machine to talk to a non-ARP machine.<br />

Routing-Related Operations<br />

The following operations are available for manipulating the Routing Table:<br />

Operation Description<br />

SIOCADDRT Adds a routing table entry.<br />

SIOCDELRT Deletes a routing table entry.<br />

SIOCMODRT Modifies a routing table entry.<br />

For all Routing-related operations, arg must point to struct rtentry. If a subnet<br />

mask must be specified with the route, the rt_flags field must have the<br />

RTF_MASK flag set and the rt_netmask field must be filled with the subnet mask.<br />

The interface number of the route’s output interface can be specified. Usually this is<br />

computed internally. But for unnumbered point-point links, for instance, you could<br />

specify an interface. The rt_ifno field is ignored unless the RTF_INTF flag is set.<br />

struct rtentry {<br />

struct sockaddr rt_dst; /* Specifies the destination<br />

* IP address of the route. */<br />

struct sockaddr rt_gateway; /* Specifies the gateway<br />

<strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong> 4-27<br />

4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!