xref: /freebsd/crypto/openssh/match.h (revision a8f6863aa612ce6941e7bad9cf809a8d0608a7ca)
1a8f6863aSKris Kennaway #ifndef MATCH_H
2a8f6863aSKris Kennaway #define MATCH_H
3a8f6863aSKris Kennaway 
4a8f6863aSKris Kennaway /*
5a8f6863aSKris Kennaway  * Returns true if the given string matches the pattern (which may contain ?
6a8f6863aSKris Kennaway  * and * as wildcards), and zero if it does not match.
7a8f6863aSKris Kennaway  */
8a8f6863aSKris Kennaway int     match_pattern(const char *s, const char *pattern);
9a8f6863aSKris Kennaway 
10a8f6863aSKris Kennaway /*
11a8f6863aSKris Kennaway  * Tries to match the host name (which must be in all lowercase) against the
12a8f6863aSKris Kennaway  * comma-separated sequence of subpatterns (each possibly preceded by ! to
13a8f6863aSKris Kennaway  * indicate negation).  Returns true if there is a positive match; zero
14a8f6863aSKris Kennaway  * otherwise.
15a8f6863aSKris Kennaway  */
16a8f6863aSKris Kennaway int     match_hostname(const char *host, const char *pattern, unsigned int len);
17a8f6863aSKris Kennaway 
18a8f6863aSKris Kennaway #endif
19