OpENer - Open Source EtherNet/IP(TM) I/O Target Stack  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
opener_error.h File Reference

This file includes the prototypes for error resolution functions like strerror_r or WSAGetLastError. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void FreeErrorMessage (char *error_message)
 Frees the space of the error message generated by GetErrorMessage(int) More...
 
char * GetErrorMessage (int error_number)
 Returns a human readable message for the given error number. More...
 
int GetSocketErrorNumber ()
 Gets the error number or equivalent. More...
 

Detailed Description

This file includes the prototypes for error resolution functions like strerror_r or WSAGetLastError.

Author
Martin Melik Merkumians

Definition in file opener_error.h.

Function Documentation

void FreeErrorMessage ( char *  error_message)

Frees the space of the error message generated by GetErrorMessage(int)

This function shall implement an appropriate method to free the space allocated by GetErrorMessage(int)

Definition at line 34 of file opener_error.c.

Referenced by CheckAndHandleConsumingUdpSockets(), CheckAndHandleTcpListenerSocket(), CheckAndHandleUdpGlobalBroadcastSocket(), CheckAndHandleUdpUnicastSocket(), CloseEncapsulationSessionBySockAddr(), CloseSocketPlatform(), CreateUdpSocket(), HandleDataOnTcpSocket(), NetworkHandlerInitialize(), NetworkHandlerProcessOnce(), and SendUdpData().

Here is the caller graph for this function:

char* GetErrorMessage ( int  error_number)

Returns a human readable message for the given error number.

Returns a human readable error message to be used in logs and traces. The error message shall not be a shared memory, like the classic strerror function, as such functions are non-reentrant To free the space in which the error message is returned the user shall implement and use the function FreeErrorMessage(char *)

Returns
A human readable error message for the given error number

Definition at line 21 of file opener_error.c.

References kErrorMessageBufferSize.

Referenced by CheckAndHandleConsumingUdpSockets(), CheckAndHandleTcpListenerSocket(), CheckAndHandleUdpGlobalBroadcastSocket(), CheckAndHandleUdpUnicastSocket(), CloseEncapsulationSessionBySockAddr(), CloseSocketPlatform(), CreateUdpSocket(), HandleDataOnTcpSocket(), NetworkHandlerInitialize(), NetworkHandlerProcessOnce(), and SendUdpData().

Here is the caller graph for this function:

int GetSocketErrorNumber ( )

Gets the error number or equivalent.

A delegate which implements how to get the error number from the system

Returns
Error number

Definition at line 17 of file opener_error.c.

Referenced by CheckAndHandleConsumingUdpSockets(), CheckAndHandleTcpListenerSocket(), CheckAndHandleUdpGlobalBroadcastSocket(), CheckAndHandleUdpUnicastSocket(), CloseEncapsulationSessionBySockAddr(), CloseSocketPlatform(), CreateUdpSocket(), HandleDataOnTcpSocket(), NetworkHandlerInitialize(), NetworkHandlerProcessOnce(), and SendUdpData().

Here is the caller graph for this function: