blob: 564f5abf97b418848f07afb43015f5f65c3cc0d9 [file] [log] [blame]
Damien Millere4340be2000-09-16 13:29:08 +11001/*
2 * Author: Tatu Ylonen <ylo@cs.hut.fi>
3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 * All rights reserved
5 * This file contains various auxiliary functions related to multiple
6 * precision integers.
7 *
8 * As far as I am concerned, the code I have written for this software
9 * can be used freely for any purpose. Any derived versions of this
10 * software must be clearly marked as such, and if the derived work is
11 * incompatible with the protocol description in the RFC file, it must be
12 * called by a name other than "ssh" or "Secure Shell".
13 */
Damien Miller450a7a12000-03-26 13:04:51 +100014#ifndef MATCH_H
15#define MATCH_H
16
17/*
18 * Returns true if the given string matches the pattern (which may contain ?
19 * and * as wildcards), and zero if it does not match.
20 */
21int match_pattern(const char *s, const char *pattern);
22
23/*
24 * Tries to match the host name (which must be in all lowercase) against the
25 * comma-separated sequence of subpatterns (each possibly preceded by ! to
Damien Millerd3a18572000-06-07 19:55:44 +100026 * indicate negation). Returns -1 if negation matches, 1 if there is
27 * a positive match, 0 if there is no match at all.
Damien Miller450a7a12000-03-26 13:04:51 +100028 */
29int match_hostname(const char *host, const char *pattern, unsigned int len);
30
31#endif