Commit 97d2b26f authored by Joanne Hugé's avatar Joanne Hugé

Clean up the code

parent 6ce8b49a
......@@ -219,33 +219,6 @@ static void print_timestamps(struct msghdr *msg) {
struct timespec *stamp = (struct timespec *)CMSG_DATA(cmsg);
printf("SO_TIMESTAMPING ");
printf("SW %ld.%09ld ", (long)stamp->tv_sec, (long)stamp->tv_nsec);
stamp++;
printf("HW transformed %ld.%09ld ", (long)stamp->tv_sec,
(long)stamp->tv_nsec);
stamp++;
printf("HW raw %ld.%09ld", (long)stamp->tv_sec,
(long)stamp->tv_nsec);
break;
}
default:
printf("type %d", cmsg->cmsg_type);
break;
}
break;
case IPPROTO_IP:
printf("IPPROTO_IP ");
switch (cmsg->cmsg_type) {
case IP_RECVERR: {
struct sock_extended_err *err =
(struct sock_extended_err *)CMSG_DATA(cmsg);
printf("IP_RECVERR ee_errno '%s' ee_origin %d => %s",
strerror(err->ee_errno), err->ee_origin,
"probably SO_EE_ORIGIN_TIMESTAMPING");
break;
}
case IP_PKTINFO: {
struct in_pktinfo *pktinfo = (struct in_pktinfo *)CMSG_DATA(cmsg);
printf("IP_PKTINFO interface index %u", pktinfo->ipi_ifindex);
break;
}
default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment