#include "common.h"
#include "host_addr.h"
#include "misc.h"
#include "endian.h"
#include "walloc.h"
#include "override.h"
Functions | |
RCSID ("$Id:host_addr.c, v 1.16 2005/12/20 13:28:42 cbiere Exp $") | |
gboolean | is_private_addr (const host_addr_t ha) |
Checks for RFC1918 private addresses. | |
gboolean | ipv4_addr_is_routable (guint32 ip) |
gboolean | host_addr_is_loopback (const host_addr_t addr) |
Checks whether the given address is 127.0.0.1 or ::1. | |
gboolean | host_addr_is_routable (const host_addr_t addr) |
Check whether host can be reached from the Internet. | |
size_t | host_addr_to_string_buf (const host_addr_t ha, gchar *dst, size_t size) |
Prints the host address ``ha'' to ``dst''. | |
const gchar * | host_addr_to_string (const host_addr_t ha) |
Prints the host address ``ha'' to a static buffer. | |
size_t | host_addr_port_to_string_buf (const host_addr_t ha, guint16 port, gchar *dst, size_t size) |
Prints the host address ``ha'' followed by ``port'' to ``dst''. | |
const gchar * | host_addr_port_to_string (const host_addr_t ha, guint16 port) |
Prints the host address ``ha'' followed by ``port'' to a static buffer. | |
host_addr_t | string_to_host_addr (const char *s, const gchar **endptr) |
Parses IPv4 and IPv6 addresses. | |
gboolean | string_to_host_or_addr (const char *s, const gchar **endptr, host_addr_t *ha) |
Parses the NUL-terminated string ``s'' for a host address or a hostname. | |
gboolean | string_to_host_addr_port (const gchar *str, const gchar **endptr, host_addr_t *addr_ptr, guint16 *port_ptr) |
void | gethostbyname_error (const gchar *host) |
const gchar * | host_addr_to_name (const host_addr_t addr) |
Resolves an IP address to a hostname per DNS. | |
host_addr_t | name_to_host_addr (const gchar *host) |
Resolves a hostname to an IP address per DNS. | |
guint | host_addr_hash_func (gconstpointer key) |
gboolean | host_addr_eq_func (gconstpointer p, gconstpointer q) |
void | wfree_host_addr (gpointer key, gpointer unused_data) |
|
|
|
|
|
|
|
Checks whether the given address is 127.0.0.1 or ::1.
|
|
Check whether host can be reached from the Internet. We rule out IPs of private networks, plus some other invalid combinations. |
|
Prints the host address ``ha'' followed by ``port'' to a static buffer.
|
|
Prints the host address ``ha'' followed by ``port'' to ``dst''. The string written to ``dst'' is always NUL-terminated unless ``size'' is zero. If ``size'' is too small, the string will be truncated.
|
|
Resolves an IP address to a hostname per DNS.
|
|
Prints the host address ``ha'' to a static buffer.
|
|
Prints the host address ``ha'' to ``dst''. The string written to ``dst'' is always NUL-terminated unless ``size'' is zero. If ``size'' is too small, the string will be truncated.
|
|
|
|
Checks for RFC1918 private addresses.
|
|
Resolves a hostname to an IP address per DNS.
|
|
|
|
Parses IPv4 and IPv6 addresses. The latter requires IPv6 support to be enabled. "0.0.0.0" and "::" cannot be distinguished from unparsable addresses.
|
|
|
|
Parses the NUL-terminated string ``s'' for a host address or a hostname. If ``s'' points to a parsable address, ``*ha'' will be set to it. Otherwise, ``*ha'' is set to ``zero_host_addr''. If the string is a possible hostname the function returns TRUE nonetheless and ``*endptr'' will point to the first character after hostname. If IPv6 support is disabled, "[::]" will be considered a hostname rather than a host address.
|
|
|