2 network_namespace_framework.h -- Declarations for Individual Test Case implementation functions
3 Copyright (C) 2019 Guus Sliepen <guus@meshlink.io>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
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 General Public License for more details.
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 #include <sys/ioctl.h>
30 #include <arpa/inet.h>
31 #include <sys/socket.h>
38 #include <netinet/in.h>
43 #include <sys/types.h>
59 typedef void *pthread_fun_ptr_t(void *arg);
68 char *fetch_ip_netns_name;
69 char *if_default_route_ip;
75 char *dnat_to_destination;
76 } netns_fullcone_handle_t;
80 namespace_type_t type;
82 char static_config_net_addr[INET6_ADDRSTRLEN]; // Buffer should be of length INET_ADDRSTRLEN or INET6_ADDRSTRLEN
83 interface_t *interfaces;
92 namespace_t *namespaces;
94 char *public_net_addr;
100 char *namespace_name;
101 pthread_fun_ptr_t *netns_thread;
102 pthread_t thread_handle;
111 char *join_invitation;
115 mesh_arg_t *mesh_arg;
120 extern bool netns_create_topology(netns_state_t *state);
121 extern void netns_destroy_topology(netns_state_t *test_state);
122 extern void run_node_in_namespace_thread(netns_thread_t *netns_arg);
123 extern pid_t run_cmd_in_netns(netns_state_t *test_state, char *namespace_name, char *cmd_str);