Added int_to_inet function
This commit is contained in:
10
easysock.c
10
easysock.c
@@ -114,3 +114,13 @@ int check_ip_ver(char* address) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int int_to_inet(int network) {
|
||||
if (network == 4) {
|
||||
return AF_INET;
|
||||
} else if (network == 6) {
|
||||
return AF_INET6;
|
||||
} else {
|
||||
exit(207);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user