Lines Matching refs:sock

134 static void sendpacket(int sock, struct sockaddr *addr, socklen_t addr_len, int ptpv2)  in sendpacket()  argument
141 res = sendto(sock, sync_p, sync_len, 0, addr, addr_len); in sendpacket()
153 int sock, int recvmsg_flags, in printpacket() argument
260 if (ioctl(sock, SIOCGSTAMP, &tv)) in printpacket()
268 if (ioctl(sock, SIOCGSTAMPNS, &ts)) in printpacket()
277 static void recvpacket(int sock, int recvmsg_flags, in recvpacket() argument
300 res = recvmsg(sock, &msg, recvmsg_flags|MSG_DONTWAIT); in recvpacket()
308 sock, recvmsg_flags, in recvpacket()
324 int sock; in main() local
383 sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); in main()
384 if (sock < 0) in main()
389 if (ioctl(sock, SIOCGIFADDR, &device) < 0) in main()
404 if (ioctl(sock, SIOCSHWTSTAMP, &hwtstamp) < 0) { in main()
420 if (bind(sock, in main()
425 if (setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, interface, if_len)) in main()
434 if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_IF, in main()
439 if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, in main()
443 if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_LOOP, in main()
450 setsockopt(sock, SOL_SOCKET, SO_TIMESTAMP, in main()
455 setsockopt(sock, SOL_SOCKET, SO_TIMESTAMPNS, in main()
460 setsockopt(sock, SOL_SOCKET, SO_TIMESTAMPING, &so_timestamping, in main()
465 if (setsockopt(sock, SOL_IP, IP_PKTINFO, in main()
471 if (getsockopt(sock, SOL_SOCKET, SO_TIMESTAMP, &val, &len) < 0) in main()
476 if (getsockopt(sock, SOL_SOCKET, SO_TIMESTAMPNS, &val, &len) < 0) in main()
483 if (getsockopt(sock, SOL_SOCKET, SO_TIMESTAMPING, &so_timestamping_get, in main()
517 FD_SET(sock, &readfs); in main()
518 FD_SET(sock, &errorfs); in main()
522 res = select(sock + 1, &readfs, 0, &errorfs, &delta); in main()
529 if (FD_ISSET(sock, &readfs)) in main()
531 if (FD_ISSET(sock, &errorfs)) in main()
533 recvpacket(sock, 0, in main()
536 recvpacket(sock, MSG_ERRQUEUE, in main()
542 sendpacket(sock, in main()