In my GTK app, I am trying to determine whether a local networked device is online. Looking at some online examples of how to send a ping packet, they all seem to open a socket using IPPROTO_ICMP.
For example:-
sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
I'm trying to create the same using GIO functions, along the lines of:-
GSocket* sock_ping = g_socket_new(G_SOCKET_FAMILY_IPV4, G_SOCKET_TYPE_DATAGRAM, G_SOCKET_PROTOCOL_????, NULL);
But what do I use for the protocol type ? Gio.SocketProtocol enum does not list any such type.
Can anyone point me in the right direction ? Or, if a "ping" is not possible, maybe suggest another method ?