match.h (761efaa7) match.h (a8f6863a)
1/* $OpenBSD: match.h,v 1.13 2006/03/25 22:22:43 djm Exp $ */
1#ifndef MATCH_H
2#define MATCH_H
2
3/*
3
4/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
5 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
6 * All rights reserved
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".
5 * Returns true if the given string matches the pattern (which may contain ?
6 * and * as wildcards), and zero if it does not match.
13 */
7 */
14#ifndef MATCH_H
15#define MATCH_H
8int match_pattern(const char *s, const char *pattern);
16
9
17int match_pattern(const char *, const char *);
18int match_pattern_list(const char *, const char *, u_int, int);
19int match_hostname(const char *, const char *, u_int);
20int match_host_and_ip(const char *, const char *, const char *);
21int match_user(const char *, const char *, const char *, const char *);
22char *match_list(const char *, const char *, u_int *);
10/*
11 * Tries to match the host name (which must be in all lowercase) against the
12 * comma-separated sequence of subpatterns (each possibly preceded by ! to
13 * indicate negation). Returns true if there is a positive match; zero
14 * otherwise.
15 */
16int match_hostname(const char *host, const char *pattern, unsigned int len);
23
24#endif
17
18#endif