[haiku-commits] r39841 - haiku/trunk/src/servers/net

  • From: axeld@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 13 Dec 2010 23:24:39 +0100 (CET)

Author: axeld
Date: 2010-12-13 23:24:39 +0100 (Mon, 13 Dec 2010)
New Revision: 39841
Changeset: http://dev.haiku-os.org/changeset/39841

Modified:
   haiku/trunk/src/servers/net/Settings.cpp
   haiku/trunk/src/servers/net/Settings.h
Log:
* Moved the network definitions into their own file "wireless_networks".


Modified: haiku/trunk/src/servers/net/Settings.cpp
===================================================================
--- haiku/trunk/src/servers/net/Settings.cpp    2010-12-13 22:11:39 UTC (rev 
39840)
+++ haiku/trunk/src/servers/net/Settings.cpp    2010-12-13 22:24:39 UTC (rev 
39841)
@@ -51,6 +51,13 @@
        {0, NULL, NULL}
 };
 
+const static settings_template kInterfacesTemplate[] = {
+       {B_MESSAGE_TYPE, "interface", kInterfaceTemplate},
+       {0, NULL, NULL}
+};
+
+// Network templates
+
 const static settings_template kNetworkTemplate[] = {
        {B_STRING_TYPE, "name", NULL, true},
        {B_STRING_TYPE, "mac", NULL},
@@ -61,8 +68,7 @@
        {0, NULL, NULL}
 };
 
-const static settings_template kInterfacesTemplate[] = {
-       {B_MESSAGE_TYPE, "interface", kInterfaceTemplate},
+const static settings_template kNetworksTemplate[] = {
        {B_MESSAGE_TYPE, "network", kNetworkTemplate},
        {0, NULL, NULL}
 };
@@ -282,6 +288,12 @@
                if (status == B_OK && _type != NULL)
                        *_type = kMsgInterfaceSettingsUpdated;
        }
+       if (name == NULL || !strcmp(name, "wireless_networks")) {
+               status = _ConvertFromDriverSettings("wireless_networks",
+                       kNetworksTemplate, fNetworks);
+               if (status == B_OK && _type != NULL)
+                       *_type = kMsgInterfaceSettingsUpdated;
+       }
        if (name == NULL || !strcmp(name, "services")) {
                status = _ConvertFromDriverSettings("services", 
kServicesTemplate,
                        fServices);
@@ -318,6 +330,8 @@
 
        status_t status = _StartWatching("interfaces", target);
        if (status == B_OK)
+               status = _StartWatching("wireless_networks", target);
+       if (status == B_OK)
                status = _StartWatching("services", target);
 
        return status;
@@ -382,7 +396,7 @@
 status_t
 Settings::GetNextNetwork(uint32& cookie, BMessage& network)
 {
-       status_t status = fInterfaces.FindMessage("network", cookie, &network);
+       status_t status = fNetworks.FindMessage("network", cookie, &network);
        if (status != B_OK)
                return status;
 

Modified: haiku/trunk/src/servers/net/Settings.h
===================================================================
--- haiku/trunk/src/servers/net/Settings.h      2010-12-13 22:11:39 UTC (rev 
39840)
+++ haiku/trunk/src/servers/net/Settings.h      2010-12-13 22:24:39 UTC (rev 
39841)
@@ -72,6 +72,7 @@
 private:
                        BMessenger                      fListener;
                        BMessage                        fInterfaces;
+                       BMessage                        fNetworks;
                        BMessage                        fServices;
 };
 


Other related posts:

  • » [haiku-commits] r39841 - haiku/trunk/src/servers/net - axeld