From f5415cd1bcf90b716c98c95216721ca97fff0d07 Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Wed, 8 Mar 2023 11:11:08 -0600 Subject: [PATCH] Added int_to_inet function --- easysock.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/easysock.h b/easysock.h index f2066a8..b0f5d90 100644 --- a/easysock.h +++ b/easysock.h @@ -51,8 +51,13 @@ It prints the error returned by 'connect' if something went wrong, and exits wit int create_remote (int network,char transport,char* address,int port,struct sockaddr* remote_addr_struct); /* check_ip_ver - This function checks if the given string is an IPv4 address (returns 4), -IPv6 address (returns 6) or neither (returns -1). +IPv6 address (returns 6) or neither (returns -1). */ int check_ip_ver(char* address); +/* int_to_inet - Takes an int value (4 for IPv4, 6 for IPv6) and returns AF_INET or +AF_INET6 respectively. */ + +int int_to_inet(int network); + #endif