uIP 1.0 based webserver for LPC1114 + ENC28J60

Dependencies:   mbed TMP102

Embed: (wiki syntax)

« Back to documentation index

uIP conversion functions

uIP conversion functions
[Uip]

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

Functions

CCIF uint16_t uip_htons (uint16_t val)
 Convert a 16-bit quantity from host byte order to network byte order.
unsigned char uiplib_ipaddrconv (char *addrstr, unsigned char *addr)
 Convert a textual representation of an IP address to a numerical representation.

Detailed Description

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


Function Documentation

CCIF uint16_t uip_htons ( uint16_t  val )

Convert a 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 UIP_HTONS() macro instead.

Definition at line 1947 of file uip.c.

unsigned char uiplib_ipaddrconv ( char *  addrstr,
unsigned char *  addr 
)

Convert a textual representation of an IP address to a numerical representation.

This function takes a textual representation of an IP address in the form a.b.c.d and converts it into a 4-byte array that can be used by other uIP functions.

Parameters:
addrstrA pointer to a string containing the IP address in textual form.
addrA pointer to a 4-byte array that will be filled in with the numerical representation of the address.
Return values:
0If the IP address could not be parsed.
Non-zeroIf the IP address was parsed.

Definition at line 43 of file uiplib.c.