06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

IP Level Options<br />

level must be set to IPPROTO_IP for IP protocol level operations. The argument<br />

optname can have one of the following values (defined in ):<br />

IP_ADD_MEMBERSHIP Join a multicast group. For this option, optval is<br />

a pointer to the ip_mreq structure (defined in<br />

). The group multicast address must be<br />

specified in the field imr_mcastaddr. This is a<br />

CLASS-D IP multicast address. The<br />

imr_interface parameter may be set to the IP<br />

address of a specific interface for which group<br />

membership will be enabled. The interface must<br />

of course support multicasting. Optionally the<br />

imr_interface parameter may be set to<br />

INADDR_ANY in which case pNA+ will decide the<br />

interface to join on (for example, if a route exists<br />

for a matching multicast address that specifies<br />

the interface). The maximum number of groups<br />

that can be joined per multicast socket is defined<br />

by the constant IP_MAX_MEMBERSHIPS in pna.h.<br />

The structure below is defined in and<br />

used with the IP_ADD_MEMBERSHIP option.<br />

struct ip_mreq {<br />

struct in_addr imr_mcastaddr;<br />

/* IP multicast address of group */<br />

struct in_addr imr_interface;<br />

/* local IP address of interface */<br />

};<br />

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

4

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

Saved successfully!

Ooh no, something went wrong!