Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

byteorder(3) [linux man page]

BYTEORDER(3)						     Linux Programmer's Manual						      BYTEORDER(3)

NAME
htonl, htons, ntohl, ntohs - convert values between host and network byte order SYNOPSIS
#include <arpa/inet.h> uint32_t htonl(uint32_t hostlong); uint16_t htons(uint16_t hostshort); uint32_t ntohl(uint32_t netlong); uint16_t ntohs(uint16_t netshort); DESCRIPTION
The htonl() function converts the unsigned integer hostlong from host byte order to network byte order. The htons() function converts the unsigned short integer hostshort from host byte order to network byte order. The ntohl() function converts the unsigned integer netlong from network byte order to host byte order. The ntohs() function converts the unsigned short integer netshort from network byte order to host byte order. On the i386 the host byte order is Least Significant Byte first, whereas the network byte order, as used on the Internet, is Most Signifi- cant Byte first. CONFORMING TO
POSIX.1-2001. Some systems require the inclusion of <netinet/in.h> instead of <arpa/inet.h>. SEE ALSO
endian(3), gethostbyname(3), getservent(3) COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
2009-01-15 BYTEORDER(3)

Check Out this Related Man Page

BYTEORDER(3)						     Linux Programmer's Manual						      BYTEORDER(3)

NAME
htonl, htons, ntohl, ntohs - convert values between host and network byte order SYNOPSIS
#include <arpa/inet.h> uint32_t htonl(uint32_t hostlong); uint16_t htons(uint16_t hostshort); uint32_t ntohl(uint32_t netlong); uint16_t ntohs(uint16_t netshort); DESCRIPTION
The htonl() function converts the unsigned integer hostlong from host byte order to network byte order. The htons() function converts the unsigned short integer hostshort from host byte order to network byte order. The ntohl() function converts the unsigned integer netlong from network byte order to host byte order. The ntohs() function converts the unsigned short integer netshort from network byte order to host byte order. On the i386 the host byte order is Least Significant Byte first, whereas the network byte order, as used on the Internet, is Most Signifi- cant Byte first. CONFORMING TO
POSIX.1-2001. Some systems require the inclusion of <netinet/in.h> instead of <arpa/inet.h>. SEE ALSO
endian(3), gethostbyname(3), getservent(3) COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
2009-01-15 BYTEORDER(3)
Man Page

5 More Discussions You Might Find Interesting

1. Programming

Printing out Byte in C

Hi all, Can anyone advise on how to display the data in a byte variable, i.e can i use printf("%s", vairable_name);? Cheers (2 Replies)
Discussion started by: dwgi32
2 Replies

2. UNIX for Dummies Questions & Answers

Number of Bits in the Byte

Char BYTE=0XFE... How can we find the number of Bits in this Byte? Thanks, Harika (4 Replies)
Discussion started by: harikamamidala
4 Replies

3. UNIX for Dummies Questions & Answers

Formatting values in byte

Hello Does a command already exist for formatting numbers in byte for example? Just thought I would ask if there is a function for it or if I should write one myself, don't want to reinvent the wheel. Example: 10 = 10 B 1234 = 1.234 kB 1500000 = 1.5 MB Thanks by advance (1 Reply)
Discussion started by: Indalecio
1 Replies

4. Shell Programming and Scripting

Remove a byte(Last byte from the last line)

Hi All Can anyone please suggest me how to remove the last byte from a falt file .This is from the last line's last BYTE. Please suggest me something. Thank's and regards Vinay (1 Reply)
Discussion started by: vinayrao
1 Replies

5. Shell Programming and Scripting

delete zero byte file

Hello I have a requirement where i need to find the zero byte size file in the directory and need to delete that zero byte file. Thanks (2 Replies)
Discussion started by: dsdev_123
2 Replies