Skip to content

Latest commit

 

History

History
142 lines (81 loc) · 3.67 KB

nf-winsock2-ntohl.md

File metadata and controls

142 lines (81 loc) · 3.67 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:winsock2.ntohl
ntohl function (winsock2.h)
The ntohl function (winsock2.h) converts a u_long from TCP/IP network order to host byte order (which is little-endian on Intel processors).
_win32_ntohl_2
ntohl
ntohl function [Winsock]
winsock.ntohl_2
winsock/ntohl
winsock\ntohl_2.htm
WinSock
04673bef-22c6-424f-a5ae-689fb648b54e
08/03/2022
_win32_ntohl_2, ntohl, ntohl function [Winsock], winsock.ntohl_2, winsock/ntohl
winsock2.h
Winsock2.h
Windows
Windows 8.1, Windows Vista [desktop apps \| UWP apps]
Windows Server 2003 [desktop apps \| UWP apps]
Ws2_32.lib
Ws2_32.dll
Windows
19H1
ntohl
winsock2/ntohl
c++
APIRef
kbSyntax
DllExport
Ws2_32.dll
ntohl

ntohl function

-description

The ntohl function converts a u_long from TCP/IP network order to host byte order (which is little-endian on Intel processors).

-parameters

-param netlong [in]

A 32-bit number in TCP/IP network byte order.

-returns

The ntohl function returns the value supplied in the netlong parameter with the byte order reversed. If netlong is already in host byte order, then this function will reverse it. It is up to the application to determine if the byte order must be reversed.

-remarks

The ntohl function takes a 32-bit number in TCP/IP network byte order (the AF_INET or AF_INET6 address family) and returns a 32-bit number in host byte order.

The ntohl function can be used to convert an IPv4 address in network byte order to the IPv4 address in host byte order. This function does not do any checking to determine if the netlong parameter is a valid IPv4 address.

The ntohl function does not require that the Winsock DLL has previously been loaded with a successful call to the WSAStartup function.

Windows 8.1 and Windows Server 2012 R2: This function is supported for Windows Store apps on Windows 8.1, Windows Server 2012 R2, and later.

-see-also

InetNtop

InetPton

WSAHtonl

WSAHtons

WSANtohl

WSANtohs

htond

htonf

htonl

htonll

htons

inet_addr

inet_ntoa

ntohd

ntohf

ntohs