SO_{SND,RCV}TIMEO: should be pretty straight forward to implement. We just need to find a place to stuff the data in the socket channel and then block on the internal fd with a timeout.
SO_TIMESTAMP: we'll need to timestamp with just the system clock for now. Eventually we'll want our own clocking mechanism for l2-l3 timestamping, and we'll need to update the socket code to use that. (So that L2-3 packets and sockets are using the same clock infrastructure)
SO_{RCV,SND}BUF: nothing to do here as users can't set this yet. Looks like it doesn't generate any warnings either.
IP_RECVERR: We'd need stack support for this, so leave it unimplemented.
ICMP_FILTER: Looks straightforward. Just need to store the filter in the raw socket, and then check the incoming packet for ICMP protocol and type.
Following setsockopt calls are invoked by the standard ping command but are currently not supported by lwip/inception (ping succeeds however):
SOL_RAW, ICMP_FILTER SOL_IP, IP_RECVERR SOL_SOCKET, SO_RCVBUF SOL_SOCKET, SO_SNDBUF SOL_SOCKET, SO_TIMESTAMP SOL_SOCKET, SO_SNDTIMEO SOL_SOCKET, SO_RCVTIMEO
root@ubuntu:~/inception-core# LD_PRELOAD=build/libicp-shim-linux-x86_64-testing/lib/libicp-shim.so ICP_TRACE=1 ICP_BINDTODEVICE="e1142fe0-c586-4d2c-40fb-ba2a64eabd5d" ping 10.10.0.20 -c 1 socket(2,2,1,) = -1 socket(2,3,1,) = 4 setsockopt(4,1,25,e1142fe0-c586-4d2c-40fb-ba2a64eabd5d,36,) = 0 socket(10,2,58,) = -1 socket(10,3,58,) = 6 setsockopt(6,1,25,e1142fe0-c586-4d2c-40fb-ba2a64eabd5d,36,) = 0 socket(2,2,0,) = 8 setsockopt(8,1,25,e1142fe0-c586-4d2c-40fb-ba2a64eabd5d,36,) = 0 connect(8,0x7ffee7c93ae0,16,) = 0 getsockname(8,0x55c01cb21070,0x7ffee7c93ac4,) = 0 close(8,) = 0 setsockopt(4,255,1,0x7ffee7c93ac8,4,) = -1 WARNING: setsockopt(ICMP_FILTER): Protocol not available setsockopt(4,0,11,0x7ffee7c93ac4,4,) = -1 WARNING: your kernel is veeery old. No problems. setsockopt(4,1,7,0x55c01cb256a8,4,) = -1 setsockopt(4,1,8,0x7ffee7c93a70,4,) = -1 getsockopt(4,1,8,0x7ffee7c93a70,0x7ffee7c93a74,) = 0 PING 10.10.0.20 (10.10.0.20) 56(84) bytes of data. setsockopt(4,1,29,0x7ffee7c939b0,4,) = -1 Warning: no SO_TIMESTAMP support, falling back to SIOCGSTAMP setsockopt(4,1,21,0x7ffee7c939a0,16,) = -1 setsockopt(4,1,20,0x7ffee7c939a0,16,) = -1 sendto(4,0x55c01cb256c0,64,0,0x55c01cb22500,16,) = 64 recvmsg(4,0x7ffee7c92990,64,) = 84 64 bytes from 10.10.0.20: icmp_seq=1 ttl=255 time=0.397 ms
--- 10.10.0.20 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.397/0.397/0.397/0.000 ms