#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;
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;