SOURCES: NetworkManager-pld.patch - up to 0.5.1 - reimplemented th...
patrys
patrys at pld-linux.org
Tue Dec 27 13:40:49 CET 2005
Author: patrys Date: Tue Dec 27 12:40:49 2005 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- up to 0.5.1
- reimplemented the PLD backend
---- Files affected:
SOURCES:
NetworkManager-pld.patch (1.1 -> 1.2)
---- Diffs:
================================================================
Index: SOURCES/NetworkManager-pld.patch
diff -u SOURCES/NetworkManager-pld.patch:1.1 SOURCES/NetworkManager-pld.patch:1.2
--- SOURCES/NetworkManager-pld.patch:1.1 Sat May 21 01:35:33 2005
+++ SOURCES/NetworkManager-pld.patch Tue Dec 27 13:40:44 2005
@@ -1,12 +1,12 @@
-diff -Nur NetworkManager-0.4.orig/configure.in NetworkManager-0.4/configure.in
+<diff -Nur NetworkManager-0.4.orig/configure.in NetworkManager-0.4/configure.in
--- NetworkManager-0.4.orig/configure.in 2005-05-19 21:58:50.000000000 +0100
+++ NetworkManager-0.4/configure.in 2005-05-20 23:22:23.000000000 +0100
-@@ -56,7 +56,7 @@
+@@ -60,7 +60,7 @@
exit 1
else
case $with_distro in
-- redhat|gentoo|debian|slackware) ;;
-+ redhat|gentoo|debian|slackware|pld) ;;
+- redhat|suse|gentoo|debian|slackware) ;;
++ redhat|suse|gentoo|debian|slackware|pld) ;;
*)
echo "Your distribution (${with_distro}) is not yet supported! (patches welcome)"
exit 1
@@ -32,10 +32,10 @@
libnmbackend_la_LIBADD = $(DBUS_LIBS) $(GTHREAD_LIBS)
libnmbackend_la_CPPFLAGS = $(DBUS_CFLAGS) \
$(GTHREAD_CFLAGS) \
-diff -Nur NetworkManager-0.4.orig/src/backends/NetworkManagerPLD.c NetworkManager-0.4/src/backends/NetworkManagerPLD.c
---- NetworkManager-0.4.orig/src/backends/NetworkManagerPLD.c 1970-01-01 01:00:00.000000000 +0100
-+++ NetworkManager-0.4/src/backends/NetworkManagerPLD.c 2005-05-20 23:22:23.000000000 +0100
-@@ -0,0 +1,232 @@
+diff -Nur NetworkManager-0.5.1/src/backends/NetworkManagerPLD.c NetworkManager-0.5.1-patrys/src/backends/NetworkManagerPLD.c
+--- NetworkManager-0.5.1/src/backends/NetworkManagerPLD.c 1970-01-01 01:00:00.000000000 +0100
++++ NetworkManager-0.5.1-patrys/src/backends/NetworkManagerPLD.c 2005-12-27 12:58:21.682174250 +0100
+@@ -0,0 +1,356 @@
+/* NetworkManager -- Network link manager
+ *
+ * Narayan Newton <narayan_newton at yahoo.com>
@@ -57,6 +57,7 @@
+ * (C) Copyright 2004 RedHat, Inc.
+ * (C) Copyright 2004 Narayan Newton
+ * (C) Copyright 2005 wrobell <wrobell at pld-linux.org>
++ * (C) Copyright 2005 Patryk Zawadzki <patrys at pld-linux.org>
+ */
+
+#include <stdio.h>
@@ -78,6 +79,7 @@
+ */
+void nm_system_init (void)
+{
++ nm_system_kill_all_dhcp_daemons();
+}
+
+/*
@@ -96,12 +98,27 @@
+ if (nm_device_is_test_device (dev))
+ return;
+
++ nm_system_device_flush_routes_with_iface (nm_device_get_iface (dev));
++}
++
++/*
++ * nm_system_device_flush_routes_with_iface
++ *
++ * Flush all routes associated with a network device
++ *
++ */
++void nm_system_device_flush_routes_with_iface (const char *iface)
++{
++ char *buf;
++
++ g_return_if_fail (iface != NULL);
++
+ /* Remove routing table entries */
-+ snprintf (buf, 100, "/sbin/ip route flush dev %s", nm_device_get_iface (dev));
++ buf = g_strdup_printf ("/sbin/ip route flush dev %s", iface);
+ nm_spawn_process (buf);
++ g_free (buf);
+}
+
-+
+/*
+ * nm_system_device_flush_addresses
+ *
@@ -117,13 +134,27 @@
+ /* Not really applicable for test devices */
+ if (nm_device_is_test_device (dev))
+ return;
++ nm_system_device_flush_addresses_with_iface (nm_device_get_iface (dev));
++}
++
++/*
++ * nm_system_device_flush_addresses_with_iface
++ *
++ * Flush all network addresses associated with a network device
++ *
++ */
++void nm_system_device_flush_addresses_with_iface (const char *iface)
++{
++ char *buf;
++
++ g_return_if_fail (iface != NULL);
+
+ /* Remove all IP addresses for a device */
-+ snprintf (buf, 100, "/sbin/ip address flush dev %s", nm_device_get_iface (dev));
++ buf = g_strdup_printf ("/sbin/ip addr flush dev %s", iface);
+ nm_spawn_process (buf);
++ g_free (buf);
+}
+
-+
+/*
+ * nm_system_device_setup_static_ip4_config
+ *
@@ -138,19 +169,30 @@
+ syslog (LOG_WARNING, "nm_system_device_setup_static_ip4_config() is not implemented yet for this distribution.\n");
+}
+
-+
+/*
-+ * nm_system_device_update_config_info
++ * nm_system_device_get_system_config
+ *
+ * Retrieve any relevant configuration info for a particular device
+ * from the system network configuration information. Clear out existing
+ * info before setting stuff too.
+ *
+ */
-+void nm_system_device_update_config_info (NMDevice *dev)
++void *nm_system_device_get_system_config (NMDevice *dev)
+{
++ return NULL;
+}
+
++/*
++ * nm_system_device_has_active_routes
++ *
++ * Find out whether the specified device has any routes in the routing
++ * table.
++ *
++ */
++gboolean nm_system_device_has_active_routes (NMDevice *dev)
++{
++ return FALSE;
++}
+
+/*
+ * nm_system_enable_loopback
@@ -164,7 +206,6 @@
+ nm_spawn_process ("/sbin/ip addr add 127.0.0.1/8 brd 127.255.255.255 dev lo label loopback");
+}
+
-+
+/*
+ * nm_system_delete_default_route
+ *
@@ -176,7 +217,6 @@
+ nm_spawn_process ("/sbin/ip route del default");
+}
+
-+
+/*
+ * nm_system_kill_all_dhcp_daemons
+ *
@@ -188,7 +228,6 @@
+ nm_spawn_process ("/usr/bin/killall -q dhcpcd");
+}
+
-+
+/*
+ * nm_system_update_dns
+ *
@@ -198,20 +237,9 @@
+ */
+void nm_system_update_dns (void)
+{
++ /* I'm not running nscd */
+}
+
-+
-+/*
-+ * nm_system_load_device_modules
-+ *
-+ * These should already be loaded
-+ *
-+ */
-+void nm_system_load_device_modules (void)
-+{
-+}
-+
-+
+/*
+ * nm_system_restart_mdns_responder
+ *
@@ -221,9 +249,9 @@
+ */
+void nm_system_restart_mdns_responder (void)
+{
++ /* not implemented */
+}
+
-+
+/*
+ * nm_system_device_add_ip6_link_address
+ *
@@ -232,8 +260,43 @@
+ */
+void nm_system_device_add_ip6_link_address (NMDevice *dev)
+{
++ char *buf;
++ struct ether_addr hw_addr;
++ unsigned char eui[8];
++
++ nm_device_get_hw_address (dev, &hw_addr);
++
++ memcpy (eui, &(hw_addr.ether_addr_octet), sizeof (hw_addr.ether_addr_octet));
++ memmove (eui+5, eui+3, 3);
++ eui[3] = 0xff;
++ eui[4] = 0xfe;
++ eui[0] ^= 2;
++
++ /* Add the default link-local IPv6 address to a device */
++ buf = g_strdup_printf ("/sbin/ip -6 addr add fe80::%x%02x:%x%02x:%x%02x:%x%02x/64 dev %s",
++ eui[0], eui[1], eui[2], eui[3], eui[4], eui[5],
++ eui[6], eui[7], nm_device_get_iface (dev));
++ nm_spawn_process (buf);
++ g_free (buf);
+}
+
++/*
++ * nm_system_device_add_route_via_device_with_iface
++ *
++ * Add route to the given device
++ *
++ */
++void nm_system_device_add_route_via_device_with_iface (const char *iface, const char *route)
++{
++ char *buf;
++
++ g_return_if_fail (iface != NULL);
++
++ /* Add default gateway */
++ buf = g_strdup_printf ("/sbin/ip route add %s dev %s", route, iface);
++ nm_spawn_process (buf);
++ g_free (buf);
++}
+
+/*
+ * nm_system_device_add_default_route_via_device
@@ -243,9 +306,33 @@
+ */
+void nm_system_device_add_default_route_via_device (NMDevice *dev)
+{
++ g_return_if_fail (dev != NULL);
++
++ /* Not really applicable for test devices */
++ if (nm_device_is_test_device (dev))
++ return;
++
++ nm_system_device_add_default_route_via_device_with_iface (nm_device_get_iface (dev));
++}
++
++/*
++ * * nm_system_device_add_default_route_via_device_with_iface
++ * *
++ * * Add default route to the given device
++ * *
++ * */
++void nm_system_device_add_default_route_via_device_with_iface (const char *iface)
++{
++ char *buf;
++
++ g_return_if_fail (iface != NULL);
++
++ /* Add default gateway */
++ buf = g_strdup_printf ("/sbin/ip route add default dev %s", iface);
++ nm_spawn_process (buf);
++ g_free (buf);
+}
-+
-+
++
+/*
+ * nm_system_flush_loopback_routes
+ *
@@ -255,9 +342,10 @@
+ */
+void nm_system_flush_loopback_routes (void)
+{
++ /* Remove routing table entries for lo */
++ nm_spawn_process ("/sbin/ip route flush dev lo");
+}
+
-+
+/*
+ * nm_system_flush_arp_cache
+ *
@@ -266,5 +354,41 @@
+ */
+void nm_system_flush_arp_cache (void)
+{
++ nm_spawn_process ("/sbin/ip neigh flush all");
++}
++
++void nm_system_deactivate_all_dialup (GSList *list)
++{
++}
++
++gboolean nm_system_activate_dialup (GSList *list, const char *dialup)
++{
++ return FALSE;
++}
++
++/*
++ * nm_system_get_dialup_config
++ *
++ * Enumerate dial up options on this system, allocate NMDialUpConfig's,
++ * fill them out, and return.
++ *
++ */
++GSList * nm_system_get_dialup_config (void)
++{
++ return NULL;
++}
++
++void nm_system_device_free_system_config (NMDevice *dev, void *system_config_data)
++{
++}
++
++NMIP4Config *nm_system_device_new_ip4_system_config (NMDevice *dev)
++{
++ return NULL;
++}
++
++gboolean nm_system_device_get_use_dhcp (NMDevice *dev)
++{
++ return TRUE;
+}
+
================================================================
---- CVS-web:
http://cvs.pld-linux.org/SOURCES/NetworkManager-pld.patch?r1=1.1&r2=1.2&f=u
More information about the pld-cvs-commit
mailing list