core: Ability to bind to specific networks
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Wed, 26 Jan 2011 18:51:09 +0000 (20:51 +0200)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Mon, 31 Jan 2011 14:12:36 +0000 (16:12 +0200)
data/rygel-default.conf
data/rygel-maemo.conf
src/rygel/rygel-main.vala

index d32c445..088fd16 100644 (file)
@@ -26,8 +26,9 @@ enable-mp2ts-transcoder=true
 # Set it to 'false' if you want to disable WMV transcoding support.
 enable-wmv-transcoder=true
 
-# The network interface to attach rygel to. Leave it blank for dynamic
-# configuration.
+# The network interface to attach rygel to. You can also use network IP or even
+# ESSID for wireless networks if you are using NetworkManager. Leave it blank
+# for dynamic configuration.
 interface=
 # The port to run HTTP server on. 0 means dynamic.
 port=0
index 2aca50a..bd2e5e0 100644 (file)
@@ -26,8 +26,9 @@ enable-mp2ts-transcoder=false
 # Set it to 'true' if you want to enable WMV transcoding support.
 enable-wmv-transcoder=false
 
-# The network interface to attach rygel to. Leave it blank for dynamic
-# configuration.
+# The network interface to attach rygel to. You can also use network IP or even
+# ESSID for wireless networks if you are using NetworkManager. Leave it blank
+# for dynamic configuration.
 interface=
 # The port to run HTTP server on. 0 means dynamic.
 port=0
index 14c70f0..5232dd1 100644 (file)
@@ -121,7 +121,8 @@ public class Rygel.Main : Object {
                                        GUPnP.Context        context) {
         string iface = null;
 
-        debug ("new network context %s (%s) available.",
+        debug ("New network %s (%s) context available. IP: %s",
+               context.network,
                context.interface,
                context.host_ip);
 
@@ -129,7 +130,9 @@ public class Rygel.Main : Object {
             iface = this.config.get_interface ();
         } catch (GLib.Error err) {}
 
-        if (iface == null || iface == context.interface) {
+        if (iface == null ||
+            iface == context.interface ||
+            iface == context.network) {
             try {
                 var factory = new RootDeviceFactory (context);
                 this.factories.add (factory);
@@ -143,15 +146,16 @@ public class Rygel.Main : Object {
                          err.message);
             }
         } else {
-            debug ("Ignoring network context %s (%s).",
-                   context.interface,
-                   context.host_ip);
+            debug ("Ignoring network %s (%s) context.",
+                   context.network,
+                   context.interface);
         }
     }
 
     private void on_context_unavailable (GUPnP.ContextManager manager,
                                          GUPnP.Context        context) {
-        debug ("Network context %s (%s) now unavailable.",
+        debug ("Network %s (%s) context now unavailable. IP: %s",
+               context.network,
                context.interface,
                context.host_ip);