Skip to content

Commit

Permalink
Update sockets header to include ntop/pton IPv4/v6 API declarations (F…
Browse files Browse the repository at this point in the history
…reeRTOS#1031)

* update sockets header to include ntop / pton IPv4/v6 API declarations

* Uncrustify: triggered by comment

---------

Co-authored-by: GitHub Action <[email protected]>
  • Loading branch information
tony-josi-aws and actions-user authored Oct 6, 2023
1 parent 243de78 commit 3cc5d1c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
9 changes: 0 additions & 9 deletions source/include/FreeRTOS_IPv4_Sockets.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@
extern "C" {
#endif


/* Translate from 192.168.1.1 to a 32-bit number. */
BaseType_t FreeRTOS_inet_pton4( const char * pcSource,
void * pvDestination );

const char * FreeRTOS_inet_ntop4( const void * pvSource,
char * pcDestination,
socklen_t uxSize );

/**
* @brief Called by prvSendUDPPacket(), this function will UDP packet
* fields and IPv4 address for the packet to be send.
Expand Down
30 changes: 27 additions & 3 deletions source/include/FreeRTOS_Sockets.h
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,6 @@
char * pcDestination,
socklen_t uxSize );

BaseType_t FreeRTOS_inet_pton6( const char * pcSource,
void * pvDestination );

/** @brief This function converts a human readable string, representing an 48-bit MAC address,
* into a 6-byte address. Valid inputs are e.g. "62:48:5:83:A0:b2" and "0-12-34-fe-dc-ba". */
BaseType_t FreeRTOS_EUI48_pton( const char * pcSource,
Expand Down Expand Up @@ -565,6 +562,33 @@

#endif /* ( ipconfigSUPPORT_SELECT_FUNCTION == 1 ) */


#if ipconfigUSE_IPv4
/* Translate from dot-decimal notation (example 192.168.1.1) to a 32-bit number. */
BaseType_t FreeRTOS_inet_pton4( const char * pcSource,
void * pvDestination );

/* Translate 32-bit IPv4 address representation dot-decimal notation. */
const char * FreeRTOS_inet_ntop4( const void * pvSource,
char * pcDestination,
socklen_t uxSize );
#endif

#if ipconfigUSE_IPv6
/* Translate hexadecimal IPv6 address to 16 bytes binary format */
BaseType_t FreeRTOS_inet_pton6( const char * pcSource,
void * pvDestination );

/*
* Convert a string like 'fe80::8d11:cd9b:8b66:4a80'
* to a 16-byte IPv6 address
*/
const char * FreeRTOS_inet_ntop6( const void * pvSource,
char * pcDestination,
socklen_t uxSize );

#endif

#ifdef __cplusplus
} /* extern "C" */
#endif
Expand Down

0 comments on commit 3cc5d1c

Please sign in to comment.