Skip to content

Update sockets header to include ntop/pton IPv4/v6 API declarations #1031

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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