Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.6.0.3
Ping APIs

The ping command is a very common method for troubleshooting the accessibility of devices. It uses two Internet Control Message Protocol (ICMP) query messages, ICMP echo requests, and ICMP echo replies to determine whether a remote host is active. The ping command also measures the amount of time it takes to receive the echo reply. The ping command first sends an echo request packet to an address, and then it waits for a reply. The ping is successful only if the ECHO REQUEST gets to the destination, and the destination is able to send an ECHO REPLY back to the source of the ping within a predefined time interval. When ping to an unreachable destination is executed, the destination unreachable messages are received at a certain time interval based on the ARP timeout on the last hop router. The default interval provided may not be sufficient to receive the destination unreachable messages for all the ECHO REQUESTS.

Ping OpEN API

This document provides a brief description of the Ping OpEN APIs. It provides the following services:

Example C Application ping_example

Initialization

In the main function, the sample application initializes the OpEN API RPC service by calling openapiClientRegister() and waits for the RPC service in switchdrvr to start. A Client Handle is returned by openapiClientRegister() which is used while invoking the OpEN APIs. The application then exercises the associated OpEN APIs and logs informational and/or error messages on the console. The example application runs to its completion and exits.

ping_example

ping_example.c is a sample application that demonstrates the use of the Ping OpEN API. ping_example is started from the command line. It then exercises all the Ping OpEN APIs one by one with appropriate arguments to manage the Ping component in the ICOS main process (switchdrvr).

Usage: ping_example <test#> <arg1> <arg2> ...

PING CLI/API Cross Reference

CLI Command | OpEN API Reference ---------— | ----------— (Priv-User Mode)#
ping <ipaddr|ipv6addr|hostname> | openapiPingAddress() (Priv-User Mode)#
ping <ipaddr|ipv6addr|hostname> count <count> | openapiPingAddressWithCount() (Priv-User Mode)#
ping <ipaddr|ipv6addr|hostname> interval <interval> | openapiPingAddressWithInterval() (Priv-User Mode)#
ping <ipaddr|ipv6addr|hostname> size <size> | openapiPingAddressWithPDUSize() (Priv-User Mode)#
ping <ipaddr|ipv6addr|hostname> source <srcIfType> | openapiPingAddressWithSourceInterface() (Priv-User Mode)#
ping <ipaddr|ipv6addr|hostname> count <count> interval <interval> size <size> source <srcIfType> | openapiPingAddressExplicit()