Dragan Dosen | 59bb97a | 2017-06-02 12:03:16 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Mod Defender for HAProxy |
| 3 | * |
| 4 | * Copyright 2017 HAProxy Technologies, Dragan Dosen <ddosen@haproxy.com> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License |
| 8 | * as published by the Free Software Foundation; either version |
| 9 | * 3 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | */ |
| 12 | #ifndef __DEFENDER_H__ |
| 13 | #define __DEFENDER_H__ |
| 14 | |
Willy Tarreau | e6ce10b | 2020-06-04 15:33:47 +0200 | [diff] [blame] | 15 | #include <haproxy/sample-t.h> |
Dragan Dosen | 59bb97a | 2017-06-02 12:03:16 +0200 | [diff] [blame] | 16 | |
| 17 | struct defender_request { |
| 18 | struct sample clientip; |
| 19 | struct sample id; |
| 20 | struct sample method; |
| 21 | struct sample path; |
| 22 | struct sample query; |
| 23 | struct sample version; |
| 24 | struct sample headers; |
| 25 | struct sample body; |
| 26 | }; |
| 27 | |
| 28 | struct defender_header { |
| 29 | struct { |
| 30 | char *str; |
| 31 | uint64_t len; |
| 32 | } name; |
| 33 | struct { |
| 34 | char *str; |
| 35 | uint64_t len; |
| 36 | } value; |
| 37 | }; |
| 38 | |
| 39 | int defender_init(const char *config_file, const char *log_file); |
| 40 | int defender_process_request(struct worker *worker, struct defender_request *request); |
| 41 | |
| 42 | #endif /* __DEFENDER_H__ */ |