Skip to content
Open
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
3 changes: 2 additions & 1 deletion include/enet/enet.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ typedef enum _ENetSocketOption
ENET_SOCKOPT_SNDTIMEO = 7,
ENET_SOCKOPT_ERROR = 8,
ENET_SOCKOPT_NODELAY = 9,
ENET_SOCKOPT_TTL = 10
ENET_SOCKOPT_TTL = 10,
ENET_SOCKOPT_TOS = 11
} ENetSocketOption;

typedef enum _ENetSocketShutdown
Expand Down
9 changes: 9 additions & 0 deletions unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,10 @@ enet_socket_set_option (ENetSocket socket, ENetSocketOption option, int value)
result = setsockopt (socket, IPPROTO_IP, IP_TTL, (char *) & value, sizeof (int));
break;

case ENET_SOCKOPT_TOS:
result = setsockopt (socket, IPPROTO_IP, IP_TOS, (char *) & value, sizeof (int));
break;

default:
break;
}
Expand All @@ -375,6 +379,11 @@ enet_socket_get_option (ENetSocket socket, ENetSocketOption option, int * value)
result = getsockopt (socket, IPPROTO_IP, IP_TTL, (char *) value, & len);
break;

case ENET_SOCKOPT_TOS:
len = sizeof (int);
result = getsockopt (socket, IPPROTO_IP, IP_TOS, (char *) value, & len);
break;

default:
break;
}
Expand Down
9 changes: 9 additions & 0 deletions win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ enet_socket_set_option (ENetSocket socket, ENetSocketOption option, int value)
result = setsockopt (socket, IPPROTO_IP, IP_TTL, (char *) & value, sizeof (int));
break;

case ENET_SOCKOPT_TOS:
result = setsockopt (socket, IPPROTO_IP, IP_TOS, (char *) & value, sizeof (int));
break;

default:
break;
}
Expand All @@ -258,6 +262,11 @@ enet_socket_get_option (ENetSocket socket, ENetSocketOption option, int * value)
result = getsockopt (socket, IPPROTO_IP, IP_TTL, (char *) value, & len);
break;

case ENET_SOCKOPT_TOS:
len = sizeof(int);
result = getsockopt (socket, IPPROTO_IP, IP_TOS, (char *) value, & len);
break;

default:
break;
}
Expand Down