2 * Network Configuration - VPN Service Internal Module
4 * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 #ifndef __NETCONFIG_VPN_SERVICE_INTERNAL_H__
22 #define __NETCONFIG_VPN_SERVICE_INTERNAL_H__
24 #include <vpn_service.h>
26 typedef struct _vpnsvc_tun_s {
27 GDBusConnection *connection; /**< D-Bus Connection */
28 int fd; /**< tun socket fd */
29 int index; /**< tun index (if.iface_index) */
30 char name[VPNSVC_VPN_IFACE_NAME_LEN]; /**< tun name (if.iface_name) */
31 char session[VPNSVC_SESSION_STRING_LEN];/**< session name (user setting) */
32 unsigned int mtu; /**< mtu (user setting) */
35 int vpn_service_init(const char* iface_name, size_t iface_name_len, int fd, vpnsvc_tun_s *handle_s);
36 int vpn_service_deinit(const char* dev_name);
37 int vpn_service_protect(int socket, const char* dev_name);
38 int vpn_service_up(int iface_index, const char* local_ip, const char* remote_ip,
39 char* routes[], int prefix[], size_t nr_routes,
40 char** dns_servers, size_t nr_dns, size_t total_dns_string_cnt,
41 const char* dns_suffix, const unsigned int mtu);
42 int vpn_service_down(int iface_index);
43 int vpn_service_block_networks(char* nets_vpn[], int prefix_vpn[], size_t nr_nets_vpn,
44 char* nets_orig[], int prefix_orig[], size_t nr_nets_orig);
45 int vpn_service_unblock_networks(void);
47 #endif /* __NETCONFIG_VPN_SERVICE_INTERNAL_H__ */