Damien Miller | e4340be | 2000-09-16 13:29:08 +1100 | [diff] [blame] | 1 | /* |
| 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 Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 14 | #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 | */ |
| 21 | int 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 Miller | d3a1857 | 2000-06-07 19:55:44 +1000 | [diff] [blame] | 26 | * indicate negation). Returns -1 if negation matches, 1 if there is |
| 27 | * a positive match, 0 if there is no match at all. |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 28 | */ |
| 29 | int match_hostname(const char *host, const char *pattern, unsigned int len); |
| 30 | |
| 31 | #endif |