MySQL 8.0.40
Source Code Documentation
net_ns.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2019, 2024, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is designed to work with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have either included with
14 the program or referenced in the documentation.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License, version 2.0, for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24*/
25
26#ifndef SQL_NET_NS_H_
27#define SQL_NET_NS_H_
28
29#include "my_config.h"
30
31#ifdef HAVE_SETNS
32#include <string>
33
34/**
35 Set active network namespace specified by a name.
36
37 @param network_namespace the name of a network namespace to be set active
38
39 @return false on success, true on error
40 @note all opened descriptors used during function run are closed on error
41*/
42bool set_network_namespace(const std::string &network_namespace);
43
44/**
45 Restore original network namespace used to be active before a new network
46 namespace has been set.
47
48 @return false on success, true on failure
49*/
51
52/**
53 Close file descriptors for every opened network namespace file
54 and release a memory used by internal cache of opened network namespaces.
55*/
57
58#endif /* HAVE_SETNS */
59
60#endif /* SQL_NET_NS_H_ */
bool restore_original_network_namespace()
Restore original network namespace used to be active before a new network namespace has been set.
Definition: net_ns.cc:176
void release_network_namespace_resources()
Close file descriptors for every opened network namespace file and release a memory used by internal ...
Definition: net_ns.cc:191
bool set_network_namespace(const std::string &network_namespace)
Set active network namespace specified by a name.
Definition: net_ns.cc:153
required string network_namespace
Definition: replication_asynchronous_connection_failover.proto:34