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_IPT_GDBUS_H__
17 #define __STC_IPT_GDBUS_H__
24 #define GMAINTIMEOUT 10000
25 #define DBUS_REPLY_TIMEOUT (120 * 1000)
27 #define STC_IPT_DBUS_SERVICE "net.stc.iptables"
28 #define STC_IPT_DBUS_MANAGER_INTERFACE STC_IPT_DBUS_SERVICE ".manager"
29 #define STC_IPT_DBUS_RULE_INTERFACE STC_IPT_DBUS_SERVICE ".rule"
30 #define STC_IPT_DBUS_CHAIN_INTERFACE STC_IPT_DBUS_SERVICE ".chain"
31 #define STC_IPT_DBUS_SERVICE_MANAGER_PATH "/net/stc/iptables/manager"
32 #define STC_IPT_DBUS_SERVICE_RULE_PATH "/net/stc/iptables/rule"
33 #define STC_IPT_DBUS_SERVICE_CHAIN_PATH "/net/stc/iptables/chain"
37 GDBusConnection *m_pConnection;
38 GCancellable *m_pCancellable;
43 error_e Destroy(void);
44 GDBusConnection *GetConnection(void);
45 GCancellable *GetCancellable(void);
46 error_e ConvertErrorStringToEnum(const char *error);
47 GVariant *InvokeMethod(const char *dest, const char *path,
48 const char *iface_name, const char *method, GVariant *params, error_e *dbus_error);
49 error_e InvokeMethodNonblock(const char *dest, const char *path,
50 const char *iface_name, const char *method, GVariant *params, int timeout,
51 GAsyncReadyCallback notify_func, void *user_data);
54 #endif /* __STC_IPT_GDBUS_H__ */