Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals

# uIP conversion functions
[The uIP TCP/IP stack]

## Detailed Description

These functions can be used for converting between different data formats used by uIP.

## Defines
#define | uip_ipaddr(addr, addr0, addr1, addr2, addr3)
| Pack an IP address into a 4-byte array which is used by uIP to represent IP addresses.
#define | HTONS(n)
| Convert 16-bit quantity from host byte order to network byte order.
## Functions
u16_t | htons (u16_t val)
| Convert 16-bit quantity from host byte order to network byte order.

## Define Documentation

#define HTONS | ( | n |  | ) |

| Convert 16-bit quantity from host byte order to network byte order. This macro is primarily used for converting constants from host byte order to network byte order. For converting variables to network byte order, use the htons() function instead.

#define uip_ipaddr | ( | addr,
|  | addr0,
|  | addr1,
|  | addr2,
|  | addr3 |  | ) |

| Pack an IP address into a 4-byte array which is used by uIP to represent IP addresses. Example:
     u16_t ipaddr[2];

     uip_ipaddr(&ipaddr, 192,168,1,2);
  Parameters:
  addr | A pointer to a 4-byte array that will be filled in with the IP addres.
  addr0 | The first octet of the IP address.
  addr1 | The second octet of the IP address.
  addr2 | The third octet of the IP address.
  addr3 | The forth octet of the IP address.

## Function Documentation

u16_t htons | ( | u16_t | val | ) |

| Convert 16-bit quantity from host byte order to network byte order. This function is primarily used for converting variables from host byte order to network byte order. For converting constants to network byte order, use the HTONS() macro instead.