From 37451c7ccab6a04214ef4671feb7b778c66868b1 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Tue, 5 Mar 2013 16:06:17 +0200 Subject: [PATCH] provider: Function to set the immutable flag --- include/provider.h | 2 ++ src/provider.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/provider.h b/include/provider.h index c9a3b917..bfefaed3 100644 --- a/include/provider.h +++ b/include/provider.h @@ -101,6 +101,8 @@ int connman_provider_set_ipaddress(struct connman_provider *provider, int connman_provider_set_pac(struct connman_provider *provider, const char *pac); int connman_provider_create_service(struct connman_provider *provider); +int connman_provider_set_immutable(struct connman_provider *provider, + connman_bool_t immutable); struct connman_provider *connman_provider_get(const char *identifier); void connman_provider_put(struct connman_provider *provider); int connman_provider_set_domain(struct connman_provider *provider, diff --git a/src/provider.c b/src/provider.c index fa3bc485..ca868803 100644 --- a/src/provider.c +++ b/src/provider.c @@ -334,6 +334,19 @@ int connman_provider_create_service(struct connman_provider *provider) return 0; } +int connman_provider_set_immutable(struct connman_provider *provider, + connman_bool_t immutable) +{ + if (provider == NULL) + return -EINVAL; + + if (provider->vpn_service == NULL) + return -ESRCH; + + return __connman_service_set_immutable(provider->vpn_service, + immutable); +} + static struct connman_provider *provider_lookup(const char *identifier) { return g_hash_table_lookup(provider_hash, identifier); -- 2.34.1