<arg type='i' name='error_num' direction='out'/>
<arg type='s' name='error_str' direction='out'/>
</method>
+ <method name='CommitIp6tables'>
+ <arg type='s' name='option' direction='in'/>
+ <arg type='i' name='error_code' direction='out'/>
+ <arg type='i' name='error_num' direction='out'/>
+ <arg type='s' name='error_str' direction='out'/>
+ </method>
</interface>
</node>
}
g_variant_get(message, "(i)", &result);
- STC_LOGD("Successfully Add Rule [%d:%s]", result, rule->nfacct_name);
+ if (STC_DEBUG_LOG)
+ STC_LOGD("Successfully Add Rule [%d:%s]", result, rule->nfacct_name);
g_variant_unref(message);
return STC_ERROR_NONE;
}
g_variant_get(message, "(i)", &result);
- STC_LOGD("Successfully Remove Rule [%d:%s]", result, rule->nfacct_name);
+ if (STC_DEBUG_LOG)
+ STC_LOGD("Successfully Remove Rule [%d:%s]", result, rule->nfacct_name);
g_variant_unref(message);
return STC_ERROR_NONE;
}
g_variant_get(message, "(i)", &result);
- STC_LOGD("Successfully Add 6 Rule [%d:%s]", result, rule->nfacct_name);
+ if (STC_DEBUG_LOG)
+ STC_LOGD("Successfully Add 6 Rule [%d:%s]", result, rule->nfacct_name);
g_variant_unref(message);
return STC_ERROR_NONE;
}
g_variant_get(message, "(i)", &result);
- STC_LOGD("Successfully Remove 6 Rule [%d:%s]", result, rule->nfacct_name);
+ if (STC_DEBUG_LOG)
+ STC_LOGD("Successfully Remove 6 Rule [%d:%s]", result, rule->nfacct_name);
g_variant_unref(message);
return STC_ERROR_NONE;
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;
+}