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> sendto<br />

MSG_DONTROUTE Specifies that you want sendto() to turn on<br />

the socket flag SO_DONTROUTE for the duration<br />

of the send operation. The SO_DONTROUTE flag<br />

prohibits routing of outgoing data from the<br />

socket. Packets directed at unconnected nodes<br />

are dropped.<br />

MSG_RAWMEM Specifies that you have set buf to point to a<br />

linked list of mblks and len to the total size of<br />

the message.<br />

MSG_INTERFACE Specifies the outgoing interface of the message.<br />

If no route is found to the destination, then the<br />

interface number is specified in the argument<br />

to, which is a pointer to the structure<br />

sockaddr_intf. This is supported only for datagram<br />

or raw sockets. This is helpful with unnumbered<br />

links where there may not be a route<br />

to the destination.<br />

to Specifies the destination socket address and is a pointer to either the<br />

sockaddr_in structure or the sockaddr_intf structure.<br />

sockaddr_intf is used only if the MSG_INTERFACE option is set in<br />

flags. These structures are defined in and have the following<br />

format:<br />

struct sockaddr_in {<br />

short sin_family; /* must be AF_INET */<br />

unsigned short sin_port; /* 16-bit port number */<br />

struct in_addr sin_addr; /* 32-bit IP address */<br />

char sin_zero[8]; /* must be 0 */<br />

};<br />

struct sockaddr_intf {<br />

short sin_family; /* must be AF_INET */<br />

unsigned short sin_port; /* 16-bit port number */<br />

struct in_addr sin_addr; /* 32-bit IP address */<br />

long sin_ifno; /* 32-bit interface number */<br />

char sin_zero[4]; /* must be 0 */<br />

};<br />

The field sin_ifno identifies the interface number of the outgoing<br />

packet's output interface.<br />

The above structures cannot be packed.<br />

tolen Specifies the size in bytes of either struct sockaddr_in or struct<br />

sockaddr_intf and must be 16.<br />

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

4

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

Saved successfully!

Ooh no, something went wrong!