Lines Matching refs:rawSocket
368 int rawSocket, count, value = TIMETOLIVE; in network_listener() local
372 rawSocket = socket(PF_INET, SOCK_RAW, protocol->p_proto); in network_listener()
375 if (rawSocket < 0) { in network_listener()
388 recvfrom(rawSocket, packet, sizeof(packet), 0, in network_listener()
404 close(rawSocket); in network_listener()
487 int i, rawSocket, count = 1; in ping_network() local
493 rawSocket = socket(PF_INET, SOCK_RAW, protocol->p_proto); in ping_network()
495 if (rawSocket < 0) { in ping_network()
496 printf("Error: cannot open RAW socket %d\n", rawSocket); in ping_network()
500 if (setsockopt(rawSocket, SOL_IP, IP_TTL, &value, sizeof(value)) != 0) { in ping_network()
509 if (fcntl(rawSocket, F_SETFL, O_NONBLOCK) != 0) { in ping_network()
520 (rawSocket, &rawPacket, sizeof(rawPacket), 0, in ping_network()
540 (rawSocket, &rawPacket, sizeof(rawPacket), 0, in ping_network()
552 close(rawSocket); in ping_network()