int netconfig_del_route_ipv4(gchar *ip_addr, gchar *subnet, gchar *interface, gint address_family);
gboolean handle_launch_direct(Wifi *wifi, GDBusMethodInvocation *context);
+gboolean handle_launch_mdns(Network *object, GDBusMethodInvocation *context);
+gboolean handle_ref_mdns(Network *object, GDBusMethodInvocation *context);
+gboolean handle_unref_mdns(Network *object, GDBusMethodInvocation *context);
gboolean netconfig_send_notification_to_net_popup(const char * noti, const char * data);
int netconfig_send_message_to_net_popup(const char *title,
</method>
<method name="CheckGetPrivilege"></method>
<method name="CheckProfilePrivilege"></method>
+ <method name="LaunchMdns"></method>
+ <method name="RefMdns"></method>
+ <method name="UnrefMdns"></method>
</interface>
</node>
\ No newline at end of file
Name: net-config
Summary: TIZEN Network Configuration service
-Version: 1.1.64
+Version: 1.1.65
Release: 2
Group: System/Network
License: Apache-2.0
<check send_destination="net.netconfig" send_interface="net.netconfig.network" send_member="EthernetCableState" privilege="http://tizen.org/privilege/network.get" />
<check send_destination="net.netconfig" send_interface="net.netconfig.network" send_member="CheckGetPrivilege" privilege="http://tizen.org/privilege/network.get" />
<check send_destination="net.netconfig" send_interface="net.netconfig.network" send_member="CheckProfilePrivilege" privilege="http://tizen.org/privilege/network.profile" />
+ <allow send_destination="net.netconfig" send_interface="net.netconfig.network" send_member="LaunchMdns"/>
+ <allow send_destination="net.netconfig" send_interface="net.netconfig.network" send_member="RefMdns"/>
+ <allow send_destination="net.netconfig" send_interface="net.netconfig.network" send_member="UnrefMdns"/>
<check send_destination="net.netconfig" send_interface="net.netconfig.network_statistics" send_member="GetWifiLastRxBytes" privilege="http://tizen.org/privilege/network.get" />
<check send_destination="net.netconfig" send_interface="net.netconfig.network_statistics" send_member="GetWifiLastTxBytes" privilege="http://tizen.org/privilege/network.get" />
G_CALLBACK(handle_ethernet_cable_state), NULL);
g_signal_connect(netconfigstate, "handle-remove-route",
G_CALLBACK(handle_remove_route), NULL);
+ g_signal_connect(netconfigstate, "handle-launch-mdns",
+ G_CALLBACK(handle_launch_mdns), NULL);
+ g_signal_connect(netconfigstate, "handle-ref-mdns",
+ G_CALLBACK(handle_ref_mdns), NULL);
+ g_signal_connect(netconfigstate, "handle-unref-mdns",
+ G_CALLBACK(handle_unref_mdns), NULL);
if (!g_dbus_interface_skeleton_export(interface_network, connection,
NETCONFIG_NETWORK_STATE_PATH, NULL)) {
#define MAC_ADDRESS_MAX_LEN 18
static gboolean netconfig_device_picker_test = FALSE;
+static int mdnsd_ref_count = 0;
GKeyFile *netconfig_keyfile_load(const char *pathname)
{
netconfig_error_wifi_direct_failed(context);
return FALSE;
}
+
wifi_complete_launch_direct(wifi, context);
return TRUE;
#else
#endif
}
+int execute_mdnsd_script(char* op) {
+ const char *path = "/usr/bin/mdnsresponder-server.sh";
+ char *const args[] = { "mdnsresponder-server.sh", op, NULL };
+ char *const envs[] = { NULL };
+
+ return netconfig_execute_file(path, args, envs);
+}
+
+gboolean handle_launch_mdns(Network *object, GDBusMethodInvocation *context)
+{
+ DBG("Launch mdnsresponder daemon");
+
+ if (mdnsd_ref_count != 0) {
+ ERR("Invalid access");
+ netconfig_error_invalid_parameter(context);
+ return FALSE;
+ }
+
+ if (execute_mdnsd_script("start") < 0) {
+ ERR("Failed to launch mdnsresponder daemon");
+ netconfig_error_invalid_parameter(context);
+ return FALSE;
+ }
+
+ network_complete_launch_mdns(object, context);
+ return TRUE;
+}
+
+gboolean handle_ref_mdns(Network *object, GDBusMethodInvocation *context)
+{
+ mdnsd_ref_count++;
+
+ DBG("Ref mdnsresponder daemon. ref count: %d", mdnsd_ref_count);
+ network_complete_ref_mdns(object, context);
+ return TRUE;
+}
+
+gboolean handle_unref_mdns(Network *object, GDBusMethodInvocation *context)
+{
+ DBG("Unef mdnsresponder daemon");
+
+ if (mdnsd_ref_count <= 0) {
+ ERR("Invalid access");
+ netconfig_error_invalid_parameter(context);
+ return FALSE;
+ }
+
+ mdnsd_ref_count--;
+
+ DBG("Unref mdnsresponder daemon. ref count: %d", mdnsd_ref_count);
+ if (mdnsd_ref_count == 0) {
+ if (execute_mdnsd_script("stop") < 0) {
+ ERR("Failed to stop mdnsresponder daemon");
+ netconfig_error_invalid_parameter(context);
+ return FALSE;
+ }
+ }
+
+ network_complete_unref_mdns(object, context);
+ return TRUE;
+}
+
gboolean netconfig_send_notification_to_net_popup(const char * noti, const char * ssid)
{
int ret = 0;