Chapter Contents

Previous

Next
ntohl

ntohl



Converts a Long Integer from Network to Host Byte Order

Portability: UNIX compatible


SYNOPSIS
DESCRIPTION
RETURN VALUE
CAUTION
PORTABILITY
IMPLEMENTATION
RELATED FUNCTIONS


SYNOPSIS

#include <sys/types.h>
#include <netinet/in.h>

unsigned long ntohl(unsigned long netlong);


DESCRIPTION

The ntohl macro converts an unsigned long integer netlong from network byte order to host byte order. On an IBM 370, this is a null macro, since IBM 370 byte ordering is big endian, as is network byte ordering.


RETURN VALUE

ntohl returns the converted value.


CAUTION

There is also an ntohl function. Be sure to include the proper header files so that the ntohl macro is always used.


PORTABILITY

ntohl is portable to other environments, including most UNIX systems, that implement BSD sockets.


IMPLEMENTATION

The ntohl macro is defined in the <netinet/in.h> header file.


RELATED FUNCTIONS

htoncs , htonl , htons , ntohcs , ntohs


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.