Greenbone Vulnerability Manager  22.4.0~dev1
manage_sql_port_lists.h
1 /* Copyright (C) 2020-2022 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 #ifndef _GVMD_MANAGE_SQL_PORT_LISTS_H
20 #define _GVMD_MANAGE_SQL_PORT_LISTS_H
21 
22 #include "manage.h"
23 #include "manage_sql.h"
24 
25 column_t*
27 
28 const char**
30 
31 int
32 create_port_list_no_acl (const char *, const char *, const char *,
33  const char *, array_t *, port_list_t *);
34 
35 int
36 create_port_list_unique (const char *, const char *, const char *,
37  port_list_t *);
38 
39 gboolean
40 find_port_list_no_acl (const char *, port_list_t *);
41 
42 gboolean
43 find_trash_port_list_no_acl (const char *, port_list_t *);
44 
45 int
46 port_list_is_predefined (port_list_t);
47 
48 port_protocol_t
50 
51 int
52 restore_port_list (const char *);
53 
54 void
56 
57 void
58 inherit_port_lists (user_t, user_t);
59 
60 void
61 delete_port_lists_user (user_t);
62 
63 void
65 
66 int
67 port_list_updated_in_feed (port_list_t, const gchar *);
68 
69 void
70 update_port_list (port_list_t, const gchar *, const gchar *, array_t *);
71 
72 void
74 
75 #endif /* not _GVMD_MANAGE_SQL_PORT_LISTS_H */
void migrate_predefined_port_lists()
Migrate old ownerless port lists to the Feed Owner.
Definition: manage_sql_port_lists.c:2503
column_t * port_list_select_columns()
Get select columns.
Definition: manage_sql_port_lists.c:1936
port_protocol_t port_range_iterator_type_int(iterator_t *iterator)
Get the type from a port range iterator.
Definition: manage_sql_port_lists.c:2294
int create_port_list_no_acl(const char *id, const char *name, const char *comment, const char *port_ranges, array_t *ranges, port_list_t *port_list_return)
Create a port list.
Definition: manage_sql_port_lists.c:1359
void update_port_list(port_list_t port_list, const gchar *name, const gchar *comment, array_t *ranges)
Update a port list from an XML file.
Definition: manage_sql_port_lists.c:2557
int restore_port_list(const char *port_list_id)
Try restore a port list.
Definition: manage_sql_port_lists.c:2384
gboolean find_trash_port_list_no_acl(const char *uuid, port_list_t *port_list)
Find a trash port list given a UUID.
Definition: manage_sql_port_lists.c:821
int port_list_updated_in_feed(port_list_t port_list, const gchar *path)
Check if a port list has been updated in the feed.
Definition: manage_sql_port_lists.c:2525
void check_db_port_lists()
Check port lists, for startup.
Definition: manage_sql_port_lists.c:2595
gboolean find_port_list_no_acl(const char *uuid, port_list_t *port_list)
Find a port list given a UUID.
Definition: manage_sql_port_lists.c:765
void inherit_port_lists(user_t user, user_t inheritor)
Change ownership of port lists, for user deletion.
Definition: manage_sql_port_lists.c:2471
const char ** port_list_filter_columns()
Get filter columns.
Definition: manage_sql_port_lists.c:1924
void delete_port_lists_user(user_t user)
Delete all port lists owned by a user.
Definition: manage_sql_port_lists.c:2486
void empty_trashcan_port_lists()
Empty trashcan.
Definition: manage_sql_port_lists.c:2451
int create_port_list_unique(const char *name, const char *comment, const char *port_range, port_list_t *port_list)
Create a port list having a unique name.
Definition: manage_sql_port_lists.c:1121
Iterator column.
Definition: manage_sql.h:217
A generic SQL iterator structure.
Definition: iterator.h:50