SOIcmpLastCodeType

Syntax

#include <cafe.h>
#include <cafe/network.h>

int SOIcmpLastCodeType(int handle);

Parameters

handle ICMP handle to get last code type from.

Return Values

Upon success, an ICMP code type from an ICMP error received during last ping attempt associated with handle. Refer to RFC 792 (http://www.ietf.org/rfc/rfc792.txt) for code meanings. Upon failure, -1 is returned and errno is set appropriately.

Description

If during a ping an ICMP error is received, the ICMP code type is saved and associated to handle.
The last code type associated with handle is cleared when SOIcmpPing is called. Refer to RFC 792 (http://www.ietf.org/rfc/rfc792.txt) for code meanings.

NOTE:
When calling SOIcmpLastCodeType, it will overwrite errno. Be sure to save errno with SOLastError from your SOIcmpPing call BEFORE calling SOIcmpLastCodeType.

Errors

SO_ELIBNOTREADY Socket library is not initialized.
SO_ENOMEM Insufficient memory in the stack.
SO_EINPROGRESS Ping already in progress. Only one ping per ICMP handle may be pending.
SO_EINVAL Invalid handle passed.
SO_EFAULT An abnormal operation occurred in the stack.

Do Not Call From

Callbacks Do not call this function from any callback function.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.

See Also

SOIcmpCreateHandle
SOIcmpCloseHandle
SOIcmpPing
SOIcmpCancel

Revision History

2014/06/24 Reworked external link.
2014/01/24 Initial version.


CONFIDENTIAL