Kai Vehmanen <Kai.Vehmanen@nokia-email.address.hidden>
#include "config.h"
#include "sofia-sip/bnf.h"
#include <assert.h>
#include <sofia-sip/hostdomain.h>
Include dependency graph for bnf.c:
Functions | |
int | span_ip4_octet (char const *host) |
Return length of decimal-octet. | |
int | span_canonic_ip4_address (char const *host, int *return_canonize) |
Return length of valid IP4 address. | |
int | span_ip4_address (char const *host) |
Return length of valid IP4 address. | |
int | scan_ip4_address (char **inout_host) |
Scan valid IP4 address. | |
int | span_hex4 (char const *host) |
Return length of hex4. | |
int | span_canonic_ip6_address (char const *host, int *return_canonize, char *hexparts[9]) |
Return length of valid IP6 address. | |
int | canonize_ip6_address (char *host, char *hexparts[9]) |
Canonize scanned IP6 address. | |
int | span_ip6_address (char const *host) |
Return length of valid IP6 address. | |
int | scan_ip6_address (char **inout_host) |
Scan and canonize valid IP6 address. | |
int | span_ip6_reference (char const *host) |
Return length of valid IP6 reference. | |
int | scan_ip6_reference (char **inout_host) |
Scan valid IP6 reference. | |
int | span_ip_address (char const *host) |
Return length of valid IP4 or IP6 address. | |
int | scan_ip_address (char **inout_host) |
Scan valid IP4/IP6 address. | |
int | span_domain_label (char const *label) |
Return length of a valid domain label. | |
int | span_domain_labels (char const *host, int *return_labels) |
Scan valid domain name and count number of labels in it. | |
int | span_domain (char const *host) |
Return length of a valid domain name. | |
int | scan_domain (char **inout_host) |
Scan valid domain name. | |
int | span_host (char const *host) |
Return length of a valid domain name or IP address. | |
int | scan_host (char **inout_host) |
Scan valid domain name or IP address. | |
int | host_is_ip4_address (char const *string) |
Return true if string is valid IP4 address in dot-notation. | |
int | host_is_ip6_address (char const *string) |
Return true if string is valid IP6 address in hex notation. | |
int | host_ip6_reference (char const *string) |
This is typo. | |
int | host_is_ip6_reference (char const *string) |
Return true if string is valid IP6 reference, i.e. | |
int | host_is_ip_address (char const *string) |
Return true if string is valid IP address. | |
int | host_is_domain (char const *string) |
Return true if string is valid a domain name. | |
int | host_is_valid (char const *string) |
Return true if string is valid a host name. | |
int | host_is_local (char const *host) |
Returns true if string is describing a local address. | |
int | host_has_domain_invalid (char const *string) |
Return true if string has domain name in "invalid." domain. |
int canonize_ip6_address | ( | char * | host, | |
char * | hexparts[9] | |||
) | [inline] |
Canonize scanned IP6 address.
Length | of canonized IP6 address. |
int host_ip6_reference | ( | char const * | string | ) |
int host_is_domain | ( | char const * | string | ) |
Return true if string is valid a domain name.
Valid domain name consists of alphanumeric labels separated with dot ("."). There can be a "-" in the middle of label. The last label must start with a letter.
int host_is_ip4_address | ( | char const * | string | ) |
Return true if string is valid IP4 address in dot-notation.
127.1
is not considered valid IP4 address. int host_is_ip6_address | ( | char const * | string | ) |
Return true if string is valid IP6 address in hex notation.
E.g., fe80::1 is a valid IP6 address.
int host_is_ip6_reference | ( | char const * | string | ) |
Return true if string is valid IP6 reference, i.e.
hex notation in square brackets.
E.g., [::1] is a valid IP6 reference.
int host_is_ip_address | ( | char const * | string | ) |
Return true if string is valid IP address.
Valid IP address is either a IP4 adddress in quad-octet notation, IP6 hex address or IP6 reference in square brackets ([]).
int host_is_local | ( | char const * | host | ) |
Returns true if string is describing a local address.
Uses the definitions of local addresses found in RFC1700 and RFC4291.
int host_is_valid | ( | char const * | string | ) |
Return true if string is valid a host name.
Check if the string is a domain name, IP address or IP6 reference.
int scan_ip6_address | ( | char ** | inout_host | ) |
Scan and canonize valid IP6 address.
inout_host | input pointer to string to scan output pointer to first character after valid IP6 address |
Length | of valid IP6 address or -1 upon an error. |
int span_domain | ( | char const * | host | ) |
int span_ip4_address | ( | char const * | host | ) |
Return length of valid IP4 address.
Note that we accept here up to two leading zeroes which makes "dotted decimal" notation ambiguous: 127.000.000.001 is interpreted same as 127.0.0.1
Note that traditionally IP address octets starting with zero have been interpreted as octal: 172.055.055.001 has been same as 172.45.45.1
However, we interpret them as decimal, 172.055.055.001 is same as 172.55.55.1.