From 7badccf7fb90d59a55e0e7eb95bdba14f8aa1877 Mon Sep 17 00:00:00 2001 From: Deepak Kumar Sahu Date: Mon, 21 Mar 2016 19:47:23 +0530 Subject: [PATCH] Warnings Resolved for vpn-service module. Change-Id: I126226716f15f77b2b1b60710a83f3beb3b279d1 Signed-off-by: Deepak Kumar Sahu --- CMakeLists.txt | 2 +- daemon/include/vpn_service_daemon.h | 6 +++--- daemon/src/vpn_service_daemon.c | 8 ++++---- daemon/src/vpnsvc.c | 5 +++-- framework/src/capi_vpn_service.c | 6 +++--- include/vpn_service.h | 4 ++-- include/vpn_service_internal.h | 2 +- 7 files changed, 17 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 42a6afb..f6911e1 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ ADD_DEFINITIONS("-fPIC") # Set compiler warning flags -#ADD_DEFINITIONS("-Werror") # Make all warnings into errors. +# ADD_DEFINITIONS("-Werror") # Make all warnings into errors. ADD_DEFINITIONS("-Wall") # Generate all warnings ADD_DEFINITIONS("-Wextra") # Generate even more extra warnings diff --git a/daemon/include/vpn_service_daemon.h b/daemon/include/vpn_service_daemon.h index 211e72c..f0b10b0 100755 --- a/daemon/include/vpn_service_daemon.h +++ b/daemon/include/vpn_service_daemon.h @@ -27,12 +27,12 @@ int vpn_daemon_init(const char* iface_name, size_t iface_name_len, int fd, vpnsv int vpn_daemon_deinit(const char* dev_name); int vpn_daemon_protect(int socket, const char* dev_name); int vpn_daemon_up(int iface_index, const char* local_ip, const char* remote_ip, - const char* routes[], int prefix[], size_t nr_routes, + char* routes[], int prefix[], size_t nr_routes, char** dns_servers, size_t nr_dns, size_t total_dns_string_cnt, const char* dns_suffix, const unsigned int mtu); int vpn_daemon_down(int iface_index); -int vpn_daemon_block_networks(const char* nets_vpn[], int prefix_vpn[], size_t nr_nets_vpn, - const char* nets_orig[], int prefix_orig[], size_t nr_nets_orig); +int vpn_daemon_block_networks(char* nets_vpn[], int prefix_vpn[], size_t nr_nets_vpn, + char* nets_orig[], int prefix_orig[], size_t nr_nets_orig); int vpn_daemon_unblock_networks(void); #endif /* __TIZEN_CAPI_VPN_SERVICE_DAEMON_H__ */ diff --git a/daemon/src/vpn_service_daemon.c b/daemon/src/vpn_service_daemon.c index 0a95595..58d43e7 100755 --- a/daemon/src/vpn_service_daemon.c +++ b/daemon/src/vpn_service_daemon.c @@ -84,7 +84,7 @@ static in_addr_t host2net(ipv4 host) return net; } -static int add_routes(char* iface_name, const char* routes[], int prefix[], size_t nr_routes) +static int add_routes(char* iface_name, char* routes[], int prefix[], size_t nr_routes) { struct rtentry rt; struct sockaddr_in addr; @@ -732,7 +732,7 @@ int vpn_daemon_protect(int socket_fd, const char* dev_name) } int vpn_daemon_up(int iface_index, const char* local_ip, const char* remote_ip, - const char* routes[], int prefix[], size_t nr_routes, + char* routes[], int prefix[], size_t nr_routes, char** dns_servers, size_t nr_dns, size_t total_dns_string_cnt, const char* dns_suffix, const unsigned int mtu) { @@ -913,8 +913,8 @@ int vpn_daemon_down(int iface_index) return VPNSVC_ERROR_NONE; } -int vpn_daemon_block_networks(const char* nets_vpn[], int prefix_vpn[], size_t nr_nets_vpn, - const char* nets_orig[], int prefix_orig[], size_t nr_nets_orig) { +int vpn_daemon_block_networks(char* nets_vpn[], int prefix_vpn[], size_t nr_nets_vpn, + char* nets_orig[], int prefix_orig[], size_t nr_nets_orig) { unsigned int i; /* iptable chain regist */ diff --git a/daemon/src/vpnsvc.c b/daemon/src/vpnsvc.c index be80c9f..2ca1416 100755 --- a/daemon/src/vpnsvc.c +++ b/daemon/src/vpnsvc.c @@ -18,6 +18,7 @@ */ #include +#include #include #include #include @@ -167,7 +168,7 @@ gboolean handle_vpn_up(Vpnsvc *object, int result = VPNSVC_ERROR_NONE; - char* routes[arg_nr_routes]; + char *routes[arg_nr_routes]; int prefix[arg_nr_routes]; char **dns_servers = NULL; @@ -503,7 +504,7 @@ gboolean vpn_service_gdbus_check_privilege(GDBusMethodInvocation *invocation, ne client_session = cynara_session_from_pid(pid); ret = cynara_check(p_cynara, client, client_session, user, privilege); - if (ret == CYNARA_API_ACCESS_ALLOWED); + if (ret == CYNARA_API_ACCESS_ALLOWED) LOGD("cynara PASS"); return (ret == CYNARA_API_ACCESS_ALLOWED) ? TRUE : FALSE; diff --git a/framework/src/capi_vpn_service.c b/framework/src/capi_vpn_service.c index 08e6aa6..05843ef 100755 --- a/framework/src/capi_vpn_service.c +++ b/framework/src/capi_vpn_service.c @@ -444,7 +444,7 @@ EXPORT_API int vpnsvc_protect(vpnsvc_h handle, int socket_fd, const char* iface_ } EXPORT_API int vpnsvc_up(vpnsvc_h handle, const char* local_ip, const char* remote_ip, - const char* routes_dest_add[], int routes_prefix[], size_t num_routes, + char* routes_dest_add[], int routes_prefix[], size_t num_routes, const char** dns_servers, size_t num_dns_servers, const char* dns_suffix) { @@ -649,10 +649,10 @@ EXPORT_API int vpnsvc_write(vpnsvc_h handle, const char* data, size_t size) EXPORT_API int vpnsvc_block_networks(vpnsvc_h handle, - const char* routes_dest_vpn_addr[], + char* routes_dest_vpn_addr[], int routes_vpn_prefix[], size_t num_allow_routes_vpn, - const char* routes_dest_orig_addr[], + char* routes_dest_orig_addr[], int routes_orig_prefix[], size_t num_allow_routes_orig) diff --git a/include/vpn_service.h b/include/vpn_service.h index adefef3..183eed1 100755 --- a/include/vpn_service.h +++ b/include/vpn_service.h @@ -198,10 +198,10 @@ int vpnsvc_write(vpnsvc_h handle, const char* data, size_t size); * @see vpnsvc_unblock_networks() */ int vpnsvc_block_networks(vpnsvc_h handle, - const char *routes_dest_vpn_addr[], + char *routes_dest_vpn_addr[], int routes_vpn_prefix[], size_t num_allow_routes_vpn, - const char *routes_dest_orig_addr[], + char *routes_dest_orig_addr[], int routes_orig_prefix[], size_t num_allow_routes_orig); diff --git a/include/vpn_service_internal.h b/include/vpn_service_internal.h index 7cbf633..1fda902 100755 --- a/include/vpn_service_internal.h +++ b/include/vpn_service_internal.h @@ -59,7 +59,7 @@ extern "C" { * @see vpnsvc_down() */ int vpnsvc_up(vpnsvc_h handle, const char* local_ip, const char* remote_ip, - const char *routes_dest_addr[], int routes_prefix[], size_t num_routes, + char *routes_dest_addr[], int routes_prefix[], size_t num_routes, const char** dns_servers, size_t num_dns_servers, const char* dns_suffix); -- 2.7.4