Andreas Schultz | b629240 | 2018-10-05 13:58:45 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014-2017, Travelping GmbH <info@travelping.com> |
| 3 | * |
| 4 | * This program is free software: you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU Affero General Public License as |
| 6 | * published by the Free Software Foundation, either version 3 of the |
| 7 | * License, or (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU Affero General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Affero General Public License |
| 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | * |
| 17 | */ |
| 18 | |
| 19 | #ifndef __NETNS_H |
| 20 | #define __NETNS_H |
| 21 | |
| 22 | #if defined(__linux__) |
| 23 | |
Pau Espin Pedrol | ad6eaa2 | 2020-02-25 12:17:29 +0100 | [diff] [blame] | 24 | int init_netns(void); |
Andreas Schultz | b629240 | 2018-10-05 13:58:45 +0100 | [diff] [blame] | 25 | |
| 26 | int switch_ns(int nsfd, sigset_t *oldmask); |
Pau Espin Pedrol | ad6eaa2 | 2020-02-25 12:17:29 +0100 | [diff] [blame] | 27 | int restore_ns(sigset_t *oldmask); |
Andreas Schultz | b629240 | 2018-10-05 13:58:45 +0100 | [diff] [blame] | 28 | |
| 29 | int open_ns(int nsfd, const char *pathname, int flags); |
| 30 | int socket_ns(int nsfd, int domain, int type, int protocol); |
| 31 | int get_nsfd(const char *name); |
| 32 | |
| 33 | #endif |
| 34 | |
| 35 | #endif |