#include "lwip/opt.h"
#include "lwip/inet.h"
Go to the source code of this file.
Defines |
#define | in_range(c, lo, up) ((u8_t)c >= lo && (u8_t)c <= up) |
#define | isprint(c) in_range(c, 0x20, 0x7f) |
#define | isdigit(c) in_range(c, '0', '9') |
#define | isxdigit(c) (isdigit(c) || in_range(c, 'a', 'f') || in_range(c, 'A', 'F')) |
#define | islower(c) in_range(c, 'a', 'z') |
#define | isspace(c) (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v') |
Functions |
u32_t | inet_addr (const char *cp) |
int | inet_aton (const char *cp, struct in_addr *addr) |
char * | inet_ntoa (struct in_addr addr) |
u16_t | htons (u16_t n) |
u16_t | ntohs (u16_t n) |
u32_t | htonl (u32_t n) |
u32_t | ntohl (u32_t n) |
Detailed Description
Functions common to all TCP/IPv4 modules, such as the byte order functions.
Definition in file inet.c.
Function Documentation
Convert an u32_t from host- to network byte order.
- Parameters:
-
| n | u32_t in host byte order |
- Returns:
- n in network byte order
Definition at line 258 of file inet.c.
u32_t inet_addr |
( |
const char * |
cp |
) |
|
Ascii internet address interpretation routine. The value returned is in network order.
- Parameters:
-
| cp | IP address in ascii represenation (e.g. "127.0.0.1") |
- Returns:
- ip address in network order
Definition at line 61 of file inet.c.
int inet_aton |
( |
const char * |
cp, |
|
|
struct in_addr * |
addr | |
|
) |
| | |
Check whether "cp" is a valid ascii representation of an Internet address and convert to a binary address. Returns 1 if the address is valid, 0 if not. This replaces inet_addr, the return value from which cannot distinguish between failure and a local broadcast address.
- Parameters:
-
| cp | IP address in ascii represenation (e.g. "127.0.0.1") |
| addr | pointer to which to save the ip address in network order |
- Returns:
- 1 if cp could be converted to addr, 0 on failure
Definition at line 83 of file inet.c.
char* inet_ntoa |
( |
struct in_addr |
addr |
) |
|
Convert numeric IP address into decimal dotted ASCII representation. returns ptr to static buffer; not reentrant!
- Parameters:
-
| addr | ip address in network order to convert |
- Returns:
- pointer to a global static (!) buffer that holds the ASCII represenation of addr
Definition at line 183 of file inet.c.
Convert an u32_t from network- to host byte order.
- Parameters:
-
| n | u32_t in network byte order |
- Returns:
- n in host byte order
Definition at line 273 of file inet.c.
Convert an u16_t from network- to host byte order.
- Parameters:
-
| n | u16_t in network byte order |
- Returns:
- n in host byte order
Definition at line 246 of file inet.c.