Next: , Previous: , Up: Client connections   [Contents][Index]


5.2.7.4 ICMP sockets

The ICMP socket implementation is currently used in the tunnel server which comes with the Serveez package. It implements a user protocol receiving and sending ICMP packets by opening a raw socket with the protocol IPPROTO_ICMP.

The types of ICMP packets passed to the socket can be filtered using the ICMP_FILTER socket option (or by software as done here). ICMP packets are always processed by the kernel too, even when passed to a user socket.

Function: svz_socket_t * svz_icmp_connect (svz_address_t *host, in_port_t port, uint8_t type)

Create an ICMP socket for receiving and sending. Return NULL on errors, otherwise an enqueued socket structure.

Function: int svz_icmp_send_control (svz_socket_t *sock, uint8_t type)

“If you are calling this function we will send an empty ICMP packet signaling that this connection is going down soon.” [ttn sez: huh?]

Function: int svz_icmp_write (svz_socket_t *sock, char *buf, int length)

Send buf with length length via this ICMP socket sock. If length supersedes the maximum ICMP message size the buffer is split into smaller packets.