|
the dummy types for AX.25 or 802.3 also
*
* -1 indicates an error
* 0 or higher is a file descriptor which we have set non blocking
*
* WARNING: It is ok to listen to a service the system is using (eg arp)
* but don't try and run a user mode stack on the same service or all
* hell will break loose.
*/
int
OpenNetworkType(unsigned short netid)
{
int s = socket(AF_INET, SOCK_PACKET, htons(netid));
if (s == -1)
return -1;
fcntl(s, F_SETFL, O_NDELAY);
return s;
}
页码:[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] 第4页、共11页 |