4 * Copyright (c) 2000 - 2013 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.
23 * @desc Performance management daemon. Helper function
24 * for working with entity storage.
30 #ifndef _TRAFFIC_CONTROL_TRAFFIC_STAT_STORAGE_H_
31 #define _TRAFFIC_CONTROL_TRAFFIC_STAT_STORAGE_H_
34 #include <resourced.h>
40 * @desc Initialize database.
41 * At present it tweak "pragma synchronous = off"
42 * and "pragma temp_store = memory"
43 * @param filename - Full path to database
45 resourced_ret_c init_database(const char *filename);
48 * @desc Store result list to database.
49 * @param stats - List of resolved application information
50 * @param flush_period - Time interval for storing data
51 * @return 1 if flushed, 0 if not
53 int store_result(struct application_stat_tree *stats, int flush_period);
56 * @desc Just close sqlite statements.
58 void finalize_storage_stm(void);
61 * @desc Return arguments for network interface processing.
62 * Argument contains handler function for react on interface changes.
63 * Changes should be reflect in the database. Whats why it's here.
64 * We doesn't provide special entity for working with database.
66 iface_callback *create_iface_storage_callback(void);
68 #endif /*_TRAFFIC_CONTROL_TRAFFIC_STAT_STORAGE_H_*/