g_signal_connect(restriction, "handle-set",
G_CALLBACK(handle_restriction_set), stc);
- g_signal_connect(restriction, "handle-exclude",
- G_CALLBACK(handle_restriction_exclude), stc);
-
g_signal_connect(restriction, "handle-get",
G_CALLBACK(handle_restriction_get), stc);
g_signal_connect(restriction, "handle-get-all",
G_CALLBACK(handle_restriction_get_all), stc);
- g_signal_connect(restriction, "handle-get-state",
- G_CALLBACK(handle_restriction_get_state),
+ g_signal_connect(restriction, "handle-get-type",
+ G_CALLBACK(handle_restriction_get_type),
stc);
g_signal_connect(restriction, "handle-unset",
g_signal_connect(manager, "handle-commit-iptables",
G_CALLBACK(handle_manager_commit_iptables), stc);
+ g_signal_connect(manager, "handle-commit-ip6tables",
+ G_CALLBACK(handle_manager_commit_ip6tables), stc);
+
g_dbus_object_manager_server_export(stc->obj_mgr,
G_DBUS_OBJECT_SKELETON(object));
g_object_unref(object);
if (reply == NULL) {
if (error != NULL) {
STC_LOGE("g_dbus_connection_call_sync() failed" //LCOV_EXCL_LINE
- "error [%d: %s]", error->code, error->message);
+ " error [%d: %s]", error->code, error->message);
g_error_free(error); //LCOV_EXCL_LINE
} else {
STC_LOGE("g_dbus_connection_call_sync() failed"); //LCOV_EXCL_LINE
__STC_LOG_FUNC_EXIT__;
return TRUE;
}
+
+gboolean handle_manager_commit_ip6tables(StcManager *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *option,
+ void *user_data)
+{
+ __STC_LOG_FUNC_ENTER__;
+ GVariant *return_parameters = NULL;
+ int ret = STC_ERROR_NONE;
+ int err_num = 0;
+ char *err_str = NULL;
+ char cmd[STC_CMD_SIZE] = { 0, };
+
+ if (option == NULL) {
+ STC_MANAGER_DBUS_REPLY_ERROR(invocation,
+ STC_ERROR_INVALID_PARAMETER);
+ __STC_LOG_FUNC_EXIT__;
+ return TRUE;
+ }
+
+ STC_LOGD("[%s]", option);
+ g_snprintf(cmd, STC_CMD_SIZE, "%s %s", STC_IP6TABLES, option);
+
+ ret = stc_commit_iptables(cmd, &err_num, &err_str);
+
+ return_parameters = g_variant_new("(iis)", ret, err_num, err_str);
+
+ DEBUG_GDBUS_VARIANT("Return parameters: ", return_parameters);
+ STC_DBUS_REPLY(invocation, return_parameters);
+
+ __STC_LOG_FUNC_EXIT__;
+ return TRUE;
+}