2 * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 #ifndef __STC_MGR_RESTRICTION_H__
17 #define __STC_MGR_RESTRICTION_H__
25 #define RESTRICTION_RULE_APP_ID "app_id"
26 #define RESTRICTION_RULE_IFNAME "ifname"
27 #define RESTRICTION_RULE_IFTYPE "iftype"
28 #define RESTRICTION_RULE_ROAMING "roaming"
29 #define RESTRICTION_RULE_SUBSCRIBER_ID "subscriber_id"
30 #define RESTRICTION_RULE_DATA_LIMIT "data_limit"
31 #define RESTRICTION_RULE_DATA_WARN_LIMIT "data_warn_limit"
35 RESTRICTION_ACTIVATED,
38 RESTRICTION_BACKGROUND,
39 RESTRICTION_LAST_ELEM,
40 } restriction_status_e;
45 char m_AppID[APP_ID_LEN];
46 char m_IfaceName[IFNAME_LEN];
47 char m_SubscriberID[SUBSCRIBER_ID_LEN];
48 iface_type_e m_IfaceType;
50 int64_t m_DataWarnLimit;
51 roaming_type_e m_RoamingType;
57 class Restriction : public GDbus {
63 error_e SetRule(const char *app_id, const char *iface_name,
64 const char *subscriber_id, iface_type_e iface_type,
65 int64_t data_limit, int64_t data_warn_limit,
66 roaming_type_e roaming_type);
67 void MakeRuleParams(GVariant **params);
68 void MakeGetParams(GVariant **params);
69 void MakeStatusParams(GVariant **params);
70 error_e SetRstriction(void);
71 error_e ExcludeRstriction(void);
72 error_e UnsetRstriction(void);
73 error_e GetRstrictionStatus(restriction_status_e *status);
74 error_e GetRstriction(void);
75 error_e GetAllRstriction(void);
78 #endif /* __STC_MGR_RESTRICTION_H__ */