aboutsummaryrefslogtreecommitdiffhomepage
path: root/unix.c
diff options
context:
space:
mode:
authorFloogle <[email protected]>2023-01-08 15:58:31 +0100
committerFloogle <[email protected]>2023-01-08 15:58:31 +0100
commit4e69c700d6ca737c36c5a84829bbd04df8acc22b (patch)
treef0126aedc5421ea5ac3eb1d5db212dae802ad04b /unix.c
parent311360dbddc350722da00a3026077c47327e932d (diff)
downloadenet-4e69c700d6ca737c36c5a84829bbd04df8acc22b.tar.gz
enet-4e69c700d6ca737c36c5a84829bbd04df8acc22b.zip
added ENET_SOCKOPT_TTL
Diffstat (limited to 'unix.c')
-rw-r--r--unix.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/unix.c b/unix.c
index b029221..2c7d847 100644
--- a/unix.c
+++ b/unix.c
@@ -348,6 +348,10 @@ enet_socket_set_option (ENetSocket socket, ENetSocketOption option, int value)
result = setsockopt (socket, IPPROTO_TCP, TCP_NODELAY, (char *) & value, sizeof (int));
break;
+ case ENET_SOCKOPT_TTL:
+ result = setsockopt (socket, IPPROTO_IP, IP_TTL, (char *) & value, sizeof (int));
+ break;
+
default:
break;
}
@@ -366,6 +370,11 @@ enet_socket_get_option (ENetSocket socket, ENetSocketOption option, int * value)
result = getsockopt (socket, SOL_SOCKET, SO_ERROR, value, & len);
break;
+ case ENET_SOCKOPT_TTL:
+ len = sizeof (int);
+ result = getsockopt (socket, IPPROTO_IP, IP_TTL, (char *) value, & len);
+ break;
+
default:
break;
}