Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-os by
lwip_ip4_addr.c File Reference
This is the IPv4 address tools implementation. More...
Go to the source code of this file.
Functions | |
| u8_t | ip4_addr_isbroadcast_u32 (u32_t addr, const struct netif *netif) |
| Determine if an address is a broadcast address on a network interface. | |
| u8_t | ip4_addr_netmask_valid (u32_t netmask) |
| Checks if a netmask is valid (starting with ones, then only zeros) | |
| u32_t | ipaddr_addr (const char *cp) |
| Ascii internet address interpretation routine. | |
| int | ip4addr_aton (const char *cp, ip4_addr_t *addr) |
| Check whether "cp" is a valid ascii representation of an Internet address and convert to a binary address. | |
| char * | ip4addr_ntoa (const ip4_addr_t *addr) |
| Convert numeric IP address into decimal dotted ASCII representation. | |
| char * | ip4addr_ntoa_r (const ip4_addr_t *addr, char *buf, int buflen) |
| Same as ipaddr_ntoa, but reentrant since a user-supplied buffer is used. | |
Detailed Description
This is the IPv4 address tools implementation.
Definition in file lwip_ip4_addr.c.
Function Documentation
| u8_t ip4_addr_isbroadcast_u32 | ( | u32_t | addr, |
| const struct netif * | netif | ||
| ) |
Determine if an address is a broadcast address on a network interface.
- Parameters:
-
addr address to be checked netif the network interface against which the address is checked
- Returns:
- returns non-zero if the address is a broadcast address
Definition at line 58 of file lwip_ip4_addr.c.
| u8_t ip4_addr_netmask_valid | ( | u32_t | netmask ) |
Checks if a netmask is valid (starting with ones, then only zeros)
- Parameters:
-
netmask the IPv4 netmask to check (in network byte order!)
- Returns:
- 1 if the netmask is valid, 0 if it is not
Definition at line 93 of file lwip_ip4_addr.c.
| int ip4addr_aton | ( | const char * | cp, |
| ip4_addr_t * | 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 representation (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 155 of file lwip_ip4_addr.c.
| char* ip4addr_ntoa | ( | const ip4_addr_t * | addr ) |
Convert numeric IP address into decimal dotted ASCII representation.
returns ptr to static buffer; not reentrant!
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 representation of addr
Definition at line 277 of file lwip_ip4_addr.c.
| char* ip4addr_ntoa_r | ( | const ip4_addr_t * | addr, |
| char * | buf, | ||
| int | buflen | ||
| ) |
Same as ipaddr_ntoa, but reentrant since a user-supplied buffer is used.
- Parameters:
-
addr ip address in network order to convert buf target buffer where the string is stored buflen length of buf
- Returns:
- either pointer to buf which now holds the ASCII representation of addr or NULL if buf was too small
Definition at line 293 of file lwip_ip4_addr.c.
| u32_t ipaddr_addr | ( | const char * | cp ) |
Ascii internet address interpretation routine.
The value returned is in network order.
- Parameters:
-
cp IP address in ascii representation (e.g. "127.0.0.1")
- Returns:
- ip address in network order
Definition at line 133 of file lwip_ip4_addr.c.
Generated on Tue Jul 12 2022 13:16:22 by
1.7.2
