match.h revision 76259
176259Sgreen/*	$OpenBSD: match.h,v 1.7 2001/03/10 17:51:04 markus Exp $	*/
276259Sgreen
365668Skris/*
465668Skris * Author: Tatu Ylonen <ylo@cs.hut.fi>
565668Skris * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
665668Skris *                    All rights reserved
765668Skris * This file contains various auxiliary functions related to multiple
865668Skris * precision integers.
965668Skris *
1065668Skris * As far as I am concerned, the code I have written for this software
1165668Skris * can be used freely for any purpose.  Any derived versions of this
1265668Skris * software must be clearly marked as such, and if the derived work is
1365668Skris * incompatible with the protocol description in the RFC file, it must be
1465668Skris * called by a name other than "ssh" or "Secure Shell".
1565668Skris */
1658582Skris#ifndef MATCH_H
1758582Skris#define MATCH_H
1858582Skris
1958582Skris/*
2058582Skris * Returns true if the given string matches the pattern (which may contain ?
2158582Skris * and * as wildcards), and zero if it does not match.
2258582Skris */
2358582Skrisint     match_pattern(const char *s, const char *pattern);
2458582Skris
2558582Skris/*
2658582Skris * Tries to match the host name (which must be in all lowercase) against the
2758582Skris * comma-separated sequence of subpatterns (each possibly preceded by ! to
2865668Skris * indicate negation).  Returns -1 if negation matches, 1 if there is
2965668Skris * a positive match, 0 if there is no match at all.
3058582Skris */
3176259Sgreenint     match_hostname(const char *host, const char *pattern, u_int len);
3258582Skris
3376259Sgreen/*
3476259Sgreen * Returns first item from client-list that is also supported by server-list,
3576259Sgreen * caller must xfree() returned string.
3676259Sgreen */
3776259Sgreenchar	*match_list(const char *client, const char *server, u_int *next);
3876259Sgreen
3958582Skris#endif
40