ICMPSocket


C Specification

#include <dolphin/ip.h>

struct ICMPInfo
{
    //
    // Note do not access members without API functions
    //
    IPInfo          info;
    IPSocket        local;      // Bind
    IPSocket        remote;     // Connect
    ICMPObj         obj;
};
s32 ICMPSocket( int af, ICMPInfo* info );

Description

ICMPSocket() initializes an endpoint for ICMP communication (ICMPInfo). af must be SO_AF_INET (IPv4) or SO_AF_INET6(IPv6). To send ICMP Echo Request (ping), call ICMPPing().

Note: When a session has been completed, ICMPClose() should be performed.

Arguments

af The address family (SO_AF_INET for IPv4 or SO_AF_INET6 for IPv6).
info The pointer to the data structure that represents an endpoint for ICMP communication.

Return Values

IP_ERR_NONE Succeeded.
IP_ERR_INVALID info is NULL, or af is neither SO_AF_INET nor SO_AF_INET6.
IP_ERR_EXIST Specified info is already in use.

See Also

ICMPPing, ICMPCancel, ICMPClose