Jump to content
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
HP.com home

Transition Impacts

Tru64 UNIX Software Transition Kit
» 

DSPP Home

» HP STK home
Tru64 UNIX STK
» Home
» Overview
» Tools
» Documentation
» Transition impacts
» Identifier types
» Impact list
» Porting to HP-UX
» FAQ
» Glossary
» Help
» Send us feedback
Site maps
» Tru64 UNIX STK
» DSPP
Content starts here

critical impact:

ntohs and ntohl - different header files (CrCh219)

NW Impacts

Problem description

The Tru64 UNIX and HP-UX header files for the ntohs and ntohl functions are different.

On Tru64 UNIX, the routines are defined in the following header file:

<arpa/inet.h>

On HP-UX, the routines are defined in the following header file:

<netinet/in.h>

For _XOPEN_SOURCE_EXTENDED only, the routines are defined in the following header file:

<arpa/inet.h>

Identifiers

C/C++ Functionsntohl C/C++ Functionsntohs          

See also

Solution description

Modify the code to include the correct header files.

For ntohs and ntohl to function correctly on HP-UX, change all occurrences of <arpa/inet.h> to <netinet.h>. If you are using UNIX 98 sockets, continue to use <arpa/inet.h>.

Note that on HP-UX, ntohs and ntohl are defined as null macros because the host and network byte order are identical. Review the applicable manpages and code for more information.

See also


Problem summary

classifications source types OS release severity type
NW C, C++ any HP-UX 11i version critical changed
Printable version
Privacy statement Using this site means you accept its terms Feedback to DSPP
© 2007 Hewlett-Packard Development Company, L.P.