iPXE
|
Go to the source code of this file.
Data Structures | |
struct | in_addr |
IP address structure. More... | |
struct | in6_addr |
IP6 address structure. More... | |
struct | sockaddr_in |
IPv4 socket address. More... | |
struct | sockaddr_in6 |
IPv6 socket address. More... | |
Macros | |
#define | IP_ICMP 1 |
#define | IP_TCP 6 |
#define | IP_UDP 17 |
#define | IP_ICMP6 58 |
#define | INADDR_NONE htonl ( 0xffffffff ) |
#define | INADDR_BROADCAST htonl ( 0xffffffff ) |
#define | INADDR_NET_CLASSA htonl ( 0xff000000 ) |
#define | INADDR_NET_CLASSB htonl ( 0xffff0000 ) |
#define | INADDR_NET_CLASSC htonl ( 0xffffff00 ) |
#define | IN_IS_CLASSA(addr) ( ( (addr) & htonl ( 0x80000000 ) ) == htonl ( 0x00000000 ) ) |
#define | IN_IS_CLASSB(addr) ( ( (addr) & htonl ( 0xc0000000 ) ) == htonl ( 0x80000000 ) ) |
#define | IN_IS_CLASSC(addr) ( ( (addr) & htonl ( 0xe0000000 ) ) == htonl ( 0xc0000000 ) ) |
#define | IN_IS_MULTICAST(addr) ( ( (addr) & htonl ( 0xf0000000 ) ) == htonl ( 0xe0000000 ) ) |
#define | IN_IS_SMALL(mask) ( (mask) & htonl ( 0x00000003 ) ) |
#define | s6_addr in6_u.u6_addr8 |
#define | s6_addr16 in6_u.u6_addr16 |
#define | s6_addr32 in6_u.u6_addr32 |
#define | IN6_IS_ADDR_UNSPECIFIED(addr) |
#define | IN6_IS_ADDR_MULTICAST(addr) ( *( ( const uint8_t * ) (addr) ) == 0xff ) |
#define | IN6_IS_ADDR_LINKLOCAL(addr) |
#define | IN6_IS_ADDR_SITELOCAL(addr) |
#define | IN6_IS_ADDR_ULA(addr) ( ( *( ( const uint8_t * ) (addr) ) & 0xfe ) == 0xfc ) |
Typedefs | |
typedef struct in_addr | in_addr |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
int | inet_aton (const char *cp, struct in_addr *inp) |
Parse IPv4 address. More... | |
char * | inet_ntoa (struct in_addr in) |
Convert IPv4 address to dotted-quad notation. More... | |
int | inet6_aton (const char *string, struct in6_addr *in) |
Parse IPv6 address. More... | |
char * | inet6_ntoa (const struct in6_addr *in) |
Convert IPv6 address to standard notation. More... | |
#define IN6_IS_ADDR_UNSPECIFIED | ( | addr | ) |
#define IN6_IS_ADDR_LINKLOCAL | ( | addr | ) |
#define IN6_IS_ADDR_SITELOCAL | ( | addr | ) |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
int inet_aton | ( | const char * | string, |
struct in_addr * | in | ||
) |
Parse IPv4 address.
string | IPv4 address string |
in | IPv4 address to fill in |
ok | IPv4 address is valid |
Note that this function returns nonzero iff the address is valid, to match the standard BSD API function of the same name. Unlike most other iPXE functions, a zero therefore indicates failure.
Definition at line 641 of file ipv4.c.
References in, strtoul(), and value.
Referenced by inet_aton_fail_okx(), inet_aton_okx(), ipv4_sock_aton(), parse_ipv4_setting(), and tftp_process_multicast().
char* inet_ntoa | ( | struct in_addr | in | ) |
Convert IPv4 address to dotted-quad notation.
in | IPv4 address |
string | IPv4 address in dotted-quad notation |
Definition at line 668 of file ipv4.c.
References bytes, in, and sprintf.
Referenced by add_ipv4_miniroute(), del_ipv4_miniroute(), dhcp_deliver(), dhcp_discovery_rx(), dhcp_proxy_rx(), dhcp_proxy_tx(), dhcp_pxebs_accept(), dhcp_pxebs_rx(), dhcp_pxebs_tx(), dhcp_request_rx(), dhcp_request_tx(), efi_snp_mcast_ip_to_mac(), fetch_next_server_and_filename(), format_ipv4_setting(), gve_describe(), ibft_ipaddr(), inet_aton_okx(), inet_ntoa_okx(), ipoib_transmit(), ipv4_gratuitous_arp(), ipv4_ntoa(), ipv4_rx(), ipv4_sock_ntoa(), ipv4_tx(), pxenv_udp_open(), pxenv_udp_read(), pxenv_udp_write(), pxenv_undi_get_mcast_address(), route_ipv4_print(), start_pxebs(), tftp_apply_settings(), and tftp_process_multicast().
int inet6_aton | ( | const char * | string, |
struct in6_addr * | in | ||
) |
Parse IPv6 address.
string | IPv6 address string |
in | IPv6 address to fill in |
rc | Return status code |
Definition at line 824 of file ipv6.c.
References DBG, EINVAL, end, htons, in, memmove(), memset(), NULL, pad, pad_len, string, strtoul(), and value.
Referenced by inet6_aton_fail_okx(), inet6_aton_okx(), ipv6_route_okx(), ipv6_sock_aton(), ipv6_table_okx(), and parse_ipv6_setting().
char* inet6_ntoa | ( | const struct in6_addr * | in | ) |
Convert IPv6 address to standard notation.
in | IPv6 address |
string | IPv6 address string in canonical format |
RFC5952 defines the canonical format for IPv6 textual representation.
Definition at line 894 of file ipv6.c.
References dest, in, len, ntohs, NULL, out, sprintf, start, strcpy(), and value.
Referenced by dhcpv6_rx(), format_ipv6_setting(), inet6_aton_okx(), inet6_ntoa_okx(), ipv6_dump_miniroute(), ipv6_ntoa(), ipv6_route_okx(), ipv6_rx(), ipv6_sock_ntoa(), ipv6_tx(), ndp_prefix_fetch_ip6(), ndp_rx_neighbour_advertisement_ll_target(), ndp_rx_neighbour_solicitation_ll_source(), ndp_rx_router_advertisement_ll_source(), ndp_rx_router_advertisement_prefix(), and route_ipv6_print().