December 3rd, 2003, 09:18 PM
What is "Network Byte Order" and "Host Byte Order" and what's the difference between them?
December 3rd, 2003, 09:33 PM
Network Byte order: The order in which the bytes of a multi-byte number are transmitted on a network - most significant byte first
Host Byte Order: The order in which the host processes and stores data
I think this is correct, please correct em if I am wrong. Oh and on some systems the two are the same so there is no need for conversion.
December 3rd, 2003, 09:36 PM
Indeed XTC46, is right
2good4u, here's an answer to your question from FOLDOC
It's like "Big-Endian" a lot of cpu's are like that, for example the IBM370
December 3rd, 2003, 09:38 PM
Here' what I found.
Network and Host Byte Order Functions
Byte order is dependent on the CPU Word architecture. In processors compatible with Intel processors, 4 byte long integers are represented as a sequence of 4 bytes, with the less significant bytes of the integer stored in the more significant bytes. This byte order is called host byte order or little endian order (little-end-first).
In contrast, most mainframe CPUs, Motorola CPUs, and RISC-designed CPUs store 4 byte long integers with the most significant bytes of an integer before the less significant bytes. This byte order is called network byte order or big endian order (big-end-first).
By default, heterogeneous TCP/IP networks transmit integers, IP addresses, and port number in network byte order. Because NetWareŽ runs on host byte order machines, you will need to switch between host byte order and network byte order.
The following functions allow you to switch integers between these two formats.
htonl Converts 32-bit quantities from host to network byte order.
htons Converts 16-bit quantities from host to network byte order.
ntohl Converts 32-bit quantities from network to host byte order.
ntohs Converts 16-bit quantities from network to host byte order.
Sorry, I need to give due credit. http://developer.novell.com/ndk/doc/...a/ai88kkq.html
December 4th, 2003, 09:39 PM