1 /* Copyright (C) 2009-2020 Greenbone Networks GmbH
2  *
3  * SPDX-License-Identifier: AGPL-3.0-or-later
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as
7  * published by the Free Software Foundation, either version 3 of the
8  * License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 /**
20  * @file gmp.h
21  * @brief Headers for the GMP library.
22  */
23 
24 #ifndef _GVMD_GMP_H
25 #define _GVMD_GMP_H
26 
27 #include "manage.h"
28 #include "types.h"
29 
30 #include <glib.h>
31 #include <gnutls/gnutls.h>
32 #include <gvm/util/serverutils.h>
33 #include <sys/types.h>
34 
35 /**
36  * @brief The size of the \ref to_client data buffer, in bytes.
37  */
38 #define TO_CLIENT_BUFFER_SIZE 26214400
39 
40 /**
41  * @brief The maximum length in bytes for long result text like the description.
42  */
43 #define TRUNCATE_TEXT_LENGTH 10000000
44 
45 /**
46  * @brief The text to append when text is truncated.
47  */
48 #define TRUNCATE_TEXT_SUFFIX "[...]\n(text truncated)"
49 
50 int
51 init_gmp (GSList *, const db_conn_info_t *, int, int, int, int,
52           manage_connection_forker_t, int);
53 
54 void
55 init_gmp_process (const db_conn_info_t *, int (*) (const char *, void *),
56                   void *, gchar **);
57 
58 int
59 process_gmp_client_input ();
60 
61 /** @todo As described in gmp.c, probably should be replaced by gmp_parser_t. */
62 extern char to_client[];
63 extern buffer_size_t to_client_start;
64 extern buffer_size_t to_client_end;
65 
66 #endif /* not _GVMD_MANAGE_H */
67