|
(int sock, const char *device, const char *data, int len)
{
struct sockaddr sa;
sa.sa_family = AF_INET;
strcpy(sa.sa_data, device);
return (sendto(sock, data, len, 0, &sa, sizeof(sa)));
}
/*
* Read a packet from the network. The device parameter will
* be filled in by this routine (make it 32 bytes or more).
* If you wish to work with one interface only you must filter
* yourself. Remember to make your buffer big enough for your
* data. Oversized packets will be truncated.
*
* Return:
* -1 Error
页码:[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] 第6页、共11页 |