1 <diff -Nur NetworkManager-0.4.orig/configure.in NetworkManager-0.4/configure.in
2 --- NetworkManager-0.4.orig/configure.in 2005-05-19 21:58:50.000000000 +0100
3 +++ NetworkManager-0.4/configure.in 2005-05-20 23:22:23.000000000 +0100
8 - redhat|suse|gentoo|debian|slackware) ;;
9 + redhat|suse|gentoo|debian|slackware|pld) ;;
11 echo "Your distribution (${with_distro}) is not yet supported! (patches welcome)"
14 AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
15 AM_CONDITIONAL(TARGET_MANDRAKE, test x"$with_distro" = xmandrake)
16 AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
17 +AM_CONDITIONAL(TARGET_PLD, test x"$with_distro" = xpld)
19 AC_CHECK_HEADER(iwlib.h, [],
20 [AC_MSG_ERROR(iwlib.h not found. Install wireless-tools.)], [])
21 diff -Nur NetworkManager-0.4.orig/src/backends/Makefile.am NetworkManager-0.4/src/backends/Makefile.am
22 --- NetworkManager-0.4.orig/src/backends/Makefile.am 2005-05-16 19:35:20.000000000 +0100
23 +++ NetworkManager-0.4/src/backends/Makefile.am 2005-05-20 23:23:16.000000000 +0100
25 libnmbackend_la_SOURCES += NetworkManagerSlackware.c
29 +libnmbackend_la_SOURCES += NetworkManagerPLD.c
32 libnmbackend_la_LIBADD = $(DBUS_LIBS) $(GTHREAD_LIBS)
33 libnmbackend_la_CPPFLAGS = $(DBUS_CFLAGS) \
35 diff -Nur NetworkManager-0.5.1/src/backends/NetworkManagerPLD.c NetworkManager-0.5.1-patrys/src/backends/NetworkManagerPLD.c
36 --- NetworkManager-0.5.1/src/backends/NetworkManagerPLD.c 1970-01-01 01:00:00.000000000 +0100
37 +++ NetworkManager-0.5.1-patrys/src/backends/NetworkManagerPLD.c 2005-12-27 12:58:21.682174250 +0100
39 +/* NetworkManager -- Network link manager
41 + * Narayan Newton <narayan_newton@yahoo.com>
43 + * This program is free software; you can redistribute it and/or modify
44 + * it under the terms of the GNU General Public License as published by
45 + * the Free Software Foundation; either version 2 of the License, or
46 + * (at your option) any later version.
48 + * This program is distributed in the hope that it will be useful,
49 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
50 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51 + * GNU General Public License for more details.
53 + * You should have received a copy of the GNU General Public License
54 + * along with this program; if not, write to the Free Software
55 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
57 + * (C) Copyright 2004 RedHat, Inc.
58 + * (C) Copyright 2004 Narayan Newton
59 + * (C) Copyright 2005 wrobell <wrobell@pld-linux.org>
60 + * (C) Copyright 2005 Patryk Zawadzki <patrys@pld-linux.org>
64 +#include <sys/types.h>
66 +#include "NetworkManagerSystem.h"
67 +#include "NetworkManagerUtils.h"
68 +#include "NetworkManagerDevice.h"
71 + * PLD specific backend based on Slackware backend.
77 + * Initializes the distribution-specific system backend
80 +void nm_system_init (void)
82 + nm_system_kill_all_dhcp_daemons();
86 + * nm_system_device_flush_routes
88 + * Flush all routes associated with a network device
91 +void nm_system_device_flush_routes (NMDevice *dev)
95 + g_return_if_fail (dev != NULL);
97 + /* Not really applicable for test devices */
98 + if (nm_device_is_test_device (dev))
101 + nm_system_device_flush_routes_with_iface (nm_device_get_iface (dev));
105 + * nm_system_device_flush_routes_with_iface
107 + * Flush all routes associated with a network device
110 +void nm_system_device_flush_routes_with_iface (const char *iface)
114 + g_return_if_fail (iface != NULL);
116 + /* Remove routing table entries */
117 + buf = g_strdup_printf ("/sbin/ip route flush dev %s", iface);
118 + nm_spawn_process (buf);
123 + * nm_system_device_flush_addresses
125 + * Flush all network addresses associated with a network device
128 +void nm_system_device_flush_addresses (NMDevice *dev)
132 + g_return_if_fail (dev != NULL);
134 + /* Not really applicable for test devices */
135 + if (nm_device_is_test_device (dev))
137 + nm_system_device_flush_addresses_with_iface (nm_device_get_iface (dev));
141 + * nm_system_device_flush_addresses_with_iface
143 + * Flush all network addresses associated with a network device
146 +void nm_system_device_flush_addresses_with_iface (const char *iface)
150 + g_return_if_fail (iface != NULL);
152 + /* Remove all IP addresses for a device */
153 + buf = g_strdup_printf ("/sbin/ip addr flush dev %s", iface);
154 + nm_spawn_process (buf);
159 + * nm_system_device_setup_static_ip4_config
161 + * Set up the device with a particular IPv4 address/netmask/gateway.
163 + * Returns: TRUE on success
167 +gboolean nm_system_device_setup_static_ip4_config (NMDevice *dev)
169 + syslog (LOG_WARNING, "nm_system_device_setup_static_ip4_config() is not implemented yet for this distribution.\n");
173 + * nm_system_device_get_system_config
175 + * Retrieve any relevant configuration info for a particular device
176 + * from the system network configuration information. Clear out existing
177 + * info before setting stuff too.
180 +void *nm_system_device_get_system_config (NMDevice *dev)
186 + * nm_system_device_has_active_routes
188 + * Find out whether the specified device has any routes in the routing
192 +gboolean nm_system_device_has_active_routes (NMDevice *dev)
198 + * nm_system_enable_loopback
200 + * Bring up the loopback interface
203 +void nm_system_enable_loopback (void)
205 + nm_spawn_process ("/sbin/ip link set dev lo up");
206 + nm_spawn_process ("/sbin/ip addr add 127.0.0.1/8 brd 127.255.255.255 dev lo label loopback");
210 + * nm_system_delete_default_route
212 + * Remove the old default route in preparation for a new one
215 +void nm_system_delete_default_route (void)
217 + nm_spawn_process ("/sbin/ip route del default");
221 + * nm_system_kill_all_dhcp_daemons
223 + * Kill all DHCP daemons currently running, done at startup.
226 +void nm_system_kill_all_dhcp_daemons (void)
228 + nm_spawn_process ("/usr/bin/killall -q dhcpcd");
232 + * nm_system_update_dns
234 + * Make glibc/nscd aware of any changes to the resolv.conf file by
238 +void nm_system_update_dns (void)
240 + /* I'm not running nscd */
244 + * nm_system_restart_mdns_responder
246 + * Restart the multicast DNS responder so that it knows about new
247 + * network interfaces and IP addresses.
250 +void nm_system_restart_mdns_responder (void)
252 + /* not implemented */
256 + * nm_system_device_add_ip6_link_address
258 + * Add a default link-local IPv6 address to a device.
261 +void nm_system_device_add_ip6_link_address (NMDevice *dev)
264 + struct ether_addr hw_addr;
265 + unsigned char eui[8];
267 + nm_device_get_hw_address (dev, &hw_addr);
269 + memcpy (eui, &(hw_addr.ether_addr_octet), sizeof (hw_addr.ether_addr_octet));
270 + memmove (eui+5, eui+3, 3);
275 + /* Add the default link-local IPv6 address to a device */
276 + buf = g_strdup_printf ("/sbin/ip -6 addr add fe80::%x%02x:%x%02x:%x%02x:%x%02x/64 dev %s",
277 + eui[0], eui[1], eui[2], eui[3], eui[4], eui[5],
278 + eui[6], eui[7], nm_device_get_iface (dev));
279 + nm_spawn_process (buf);
284 + * nm_system_device_add_route_via_device_with_iface
286 + * Add route to the given device
289 +void nm_system_device_add_route_via_device_with_iface (const char *iface, const char *route)
293 + g_return_if_fail (iface != NULL);
295 + /* Add default gateway */
296 + buf = g_strdup_printf ("/sbin/ip route add %s dev %s", route, iface);
297 + nm_spawn_process (buf);
302 + * nm_system_device_add_default_route_via_device
304 + * Flush all routes associated with a network device
307 +void nm_system_device_add_default_route_via_device (NMDevice *dev)
309 + g_return_if_fail (dev != NULL);
311 + /* Not really applicable for test devices */
312 + if (nm_device_is_test_device (dev))
315 + nm_system_device_add_default_route_via_device_with_iface (nm_device_get_iface (dev));
319 + * * nm_system_device_add_default_route_via_device_with_iface
321 + * * Add default route to the given device
324 +void nm_system_device_add_default_route_via_device_with_iface (const char *iface)
328 + g_return_if_fail (iface != NULL);
330 + /* Add default gateway */
331 + buf = g_strdup_printf ("/sbin/ip route add default dev %s", iface);
332 + nm_spawn_process (buf);
337 + * nm_system_flush_loopback_routes
339 + * Flush all routes associated with the loopback device, because it
340 + * sometimes gets the first route for ZeroConf/Link-Local traffic.
343 +void nm_system_flush_loopback_routes (void)
345 + /* Remove routing table entries for lo */
346 + nm_spawn_process ("/sbin/ip route flush dev lo");
350 + * nm_system_flush_arp_cache
352 + * Flush all entries in the arp cache.
355 +void nm_system_flush_arp_cache (void)
357 + nm_spawn_process ("/sbin/ip neigh flush all");
360 +void nm_system_deactivate_all_dialup (GSList *list)
364 +gboolean nm_system_activate_dialup (GSList *list, const char *dialup)
370 + * nm_system_get_dialup_config
372 + * Enumerate dial up options on this system, allocate NMDialUpConfig's,
373 + * fill them out, and return.
376 +GSList * nm_system_get_dialup_config (void)
381 +void nm_system_device_free_system_config (NMDevice *dev, void *system_config_data)
385 +NMIP4Config *nm_system_device_new_ip4_system_config (NMDevice *dev)
390 +gboolean nm_system_device_get_use_dhcp (NMDevice *dev)