|
ELinks 0.19.1
|
#include "elinks.h"#include "intl/charsets.h"#include "network/ssl/match-hostname.h"#include "util/conv.h"#include "util/error.h"#include "util/string.h"
Functions | |
| int | match_hostname_pattern (const char *hostname, size_t hostname_length, const char *pattern, size_t pattern_length) |
| Checks whether a host name matches a pattern that may contain wildcards. | |
| int match_hostname_pattern | ( | const char * | hostname, |
| size_t | hostname_length, | ||
| const char * | pattern, | ||
| size_t | pattern_length ) |
Checks whether a host name matches a pattern that may contain wildcards.
| [in] | hostname | The host name to which the user wanted to connect. Should be in UTF-8 and need not be null-terminated. |
| [in] | hostname_length | The length of hostname, in bytes. |
| [in] | pattern | A pattern that the host name might match. Should be in UTF-8 and need not be null-terminated. The pattern may contain wildcards, as specified in RFC 2818 section 3.1. |
| [in] | pattern_length | The length of pattern, in bytes. |
According to RFC 2818 section 3.1, '' matches any number of characters except '.'. For example, "*r</em>.example.org" matches "random.example.org" or "history.example.org" but not "frozen.fruit.example.org".
This function does not allocate memory, and consumes at most O(hostname_length * pattern_length) time.