This module provides functions to convert from the native byte order on the AVR microcontroller to a big-endian network order like the order used by the Internet Protocol.
To use the network order module, place the following in your source files:
#include <network.h>
This function takes a 16 bit word in host order, host, and returns it in network order.
This function takes a 32 bit word in host order, host, and returns it in network order.
This function takes a 16 bit word in network order, network, and returns it in host order.
This function takes a 32 bit word in network order, network, and returns it in host order.
This function takes a pointer to two bytes in network order, network2, and returns its value in host order.
This functions takes a 16 bit word in host order, host, and writes its value in network order at the two bytes pointed to by network2.
This function takes a pointer to three bytes in network order, network3, and returns its value in host order.
This functions takes a 32 bit word in host order, host, and writes its value in network order at the three bytes pointed to by network3. Only the least significant 24 bits of host are used in this conversion.
This function takes a pointer to four bytes in network order, network4, and returns its value in host order.
This functions takes a 32 bit word in host order, host, and writes its value in network order at the four bytes pointed to by network4.