Article ID: 196358
Article Last Modified on 7/11/2005
152734 How to Obtain the Latest Windows NT 4.0 Service Pack
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\ Value Name: DefaultTOS Value Type: REG_DWORD Valid Range: 0x00, 0x02, 0x04, 0x08, 0x10The following code fragment demonstrates how to programmatically set TOS bits using the TCP/IP socket option IP_TOS:
int tos, tos_len;
tos_len = sizeof(tos);
if (getsockopt(sock, IPPROTO_IP, IP_TOS, (char *)&tos,
&tos_len) == SOCKET_ERROR)
printf("\nWarning: TCPIP stack does not support the "
"IP_TOS option - %d\n", WSAGetLastError());
if (setsockopt(sock, IPPROTO_IP, IP_TOS, (char *)&tos,
tos_len) == SOCKET_ERROR)
printf("\nWarning: Fail to set TOS value: error - %d",
WSAGetLastError());
Keywords: kbbug kbfix kbwinsock kbip kboswinnt400sp4fix KB196358