X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fhelper%2Fhelper-net-cls.c;h=ef5e4b350717906205ef38b283b28897eeea9ff6;hb=f59a400b27ff4da933812d36da7c9a67e34ead10;hp=0f2ae3048aebe7da8e650d70e99422058a0651f0;hpb=c1a66d6d01e44a4d64232748d0701174b035bb7c;p=platform%2Fcore%2Fconnectivity%2Fstc-manager.git diff --git a/src/helper/helper-net-cls.c b/src/helper/helper-net-cls.c index 0f2ae30..ef5e4b3 100755 --- a/src/helper/helper-net-cls.c +++ b/src/helper/helper-net-cls.c @@ -26,7 +26,7 @@ #include "helper-file.h" #include "helper-net-cls.h" -#define CUR_CLASSID_PATH "/tmp/cur_classid" +#define CUR_CLASSID_PATH "/var/lib/stc/cur_classid" #define CLASSID_FILE_NAME "net_cls.classid" typedef GArray task_classid_array; @@ -85,6 +85,23 @@ static uint32_t __get_classid_from_cgroup(const char *cgroup, return classid; } +stc_error_e init_current_classid(void) +{ + int ret = 0; + struct stat stat_buf; + + if (stat(STC_CGROUP_NETWORK, &stat_buf) != 0) { + uint32_t classid = STC_RESERVED_CLASSID_MAX; + ret = fwrite_uint(CUR_CLASSID_PATH, classid); + if (ret < 0) { + STC_LOGE("Can not init current classid"); + return STC_ERROR_FAIL; + } + } + + return STC_ERROR_NONE; +} + uint32_t get_classid_by_app_id(const char *app_id, int create) { int ret = 0;