Willy TARREAU | 3dc0644 | 2006-06-15 21:48:13 +0200 | [diff] [blame] | 1 | /* |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 2 | include/proto/checks.h |
| 3 | Functions prototypes for the checks. |
| 4 | |
Willy Tarreau | 26c2506 | 2009-03-08 09:38:41 +0100 | [diff] [blame] | 5 | Copyright (C) 2000-2009 Willy Tarreau - w@1wt.eu |
Willy TARREAU | 3dc0644 | 2006-06-15 21:48:13 +0200 | [diff] [blame] | 6 | |
| 7 | This library is free software; you can redistribute it and/or |
| 8 | modify it under the terms of the GNU Lesser General Public |
| 9 | License as published by the Free Software Foundation, version 2.1 |
| 10 | exclusively. |
| 11 | |
| 12 | This library is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | Lesser General Public License for more details. |
| 16 | |
| 17 | You should have received a copy of the GNU Lesser General Public |
| 18 | License along with this library; if not, write to the Free Software |
| 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 | */ |
| 21 | |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 22 | #ifndef _PROTO_CHECKS_H |
| 23 | #define _PROTO_CHECKS_H |
| 24 | |
| 25 | #include <types/task.h> |
Willy Tarreau | e3ba5f0 | 2006-06-29 18:54:54 +0200 | [diff] [blame] | 26 | #include <common/config.h> |
Willy TARREAU | 3dc0644 | 2006-06-15 21:48:13 +0200 | [diff] [blame] | 27 | |
Krzysztof Piotr Oledzki | 0960541 | 2009-09-23 22:09:24 +0200 | [diff] [blame] | 28 | const char *get_check_status_description(short check_status); |
| 29 | const char *get_check_status_info(short check_status); |
Simon Horman | 4a74143 | 2013-02-23 15:35:38 +0900 | [diff] [blame] | 30 | void set_server_down(struct check *check); |
| 31 | void set_server_up(struct check *check); |
Krzysztof Oledzki | b304dc7 | 2007-10-14 23:40:01 +0200 | [diff] [blame] | 32 | int start_checks(); |
Willy Tarreau | 9fe7aae | 2013-12-31 23:47:37 +0100 | [diff] [blame] | 33 | void __health_adjust(struct server *s, short status); |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 34 | |
Willy Tarreau | bc174aa | 2012-11-19 16:10:32 +0100 | [diff] [blame] | 35 | extern struct data_cb check_conn_cb; |
| 36 | |
Willy Tarreau | 9fe7aae | 2013-12-31 23:47:37 +0100 | [diff] [blame] | 37 | /* Use this one only. This inline version only ensures that we don't |
| 38 | * call the function when the observe mode is disabled. |
| 39 | */ |
| 40 | static inline void health_adjust(struct server *s, short status) |
| 41 | { |
| 42 | /* return now if observing nor health check is not enabled */ |
| 43 | if (!s->observe || !s->check.task) |
| 44 | return; |
| 45 | |
| 46 | return __health_adjust(s, status); |
| 47 | } |
| 48 | |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 49 | #endif /* _PROTO_CHECKS_H */ |
Willy TARREAU | 3dc0644 | 2006-06-15 21:48:13 +0200 | [diff] [blame] | 50 | |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 51 | /* |
| 52 | * Local variables: |
| 53 | * c-indent-level: 8 |
| 54 | * c-basic-offset: 8 |
| 55 | * End: |
| 56 | */ |