1 diff -urN NetworkManager-0.6.2-o/configure.in NetworkManager-0.6.2/configure.in
2 --- NetworkManager-0.6.2-o/configure.in 2006-03-27 09:05:17.000000000 -0700
3 +++ NetworkManager-0.6.2/configure.in 2006-04-03 13:39:20.000000000 -0600
8 - redhat|suse|gentoo|debian|slackware|arch) ;;
9 + redhat|suse|gentoo|debian|slackware|arch|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_SLACKWARE, test x"$with_distro" = xslackware)
16 AM_CONDITIONAL(TARGET_ARCH, test x"$with_distro" = xarch)
17 +AM_CONDITIONAL(TARGET_PLD, test x"$with_distro" = xpld)
19 AC_MSG_CHECKING([for wireless-tools >= 28pre9])
20 AC_TRY_COMPILE([#include <iwlib.h>],
21 diff -urN NetworkManager-0.6.2-o/src/backends/Makefile.am NetworkManager-0.6.2/src/backends/Makefile.am
22 --- NetworkManager-0.6.2-o/src/backends/Makefile.am 2006-03-09 13:52:16.000000000 -0700
23 +++ NetworkManager-0.6.2/src/backends/Makefile.am 2006-04-03 13:39:20.000000000 -0600
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 -urN NetworkManager-0.6.2-o/src/backends/NetworkManagerPLD.c NetworkManager-0.6.2/src/backends/NetworkManagerPLD.c
36 --- NetworkManager-0.6.2-o/src/backends/NetworkManagerPLD.c 1969-12-31 17:00:00.000000000 -0700
37 +++ NetworkManager-0.6.2/src/backends/NetworkManagerPLD.c 2006-04-03 13:39:45.000000000 -0600
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 "nm-device.h"
69 +#include "nm-device-802-3-ethernet.h"
70 +#include "nm-device-802-11-wireless.h"
71 +#include "nm-utils.h"
74 + * PLD specific backend based on Slackware backend.
80 + * Initializes the distribution-specific system backend
83 +void nm_system_init (void)
85 + nm_system_kill_all_dhcp_daemons();
89 + * nm_system_device_flush_routes
91 + * Flush all routes associated with a network device
94 +void nm_system_device_flush_routes (NMDevice *dev)
98 + g_return_if_fail (dev != NULL);
100 + /* Not really applicable for test devices */
101 + if (nm_device_is_test_device (dev))
104 + nm_system_device_flush_routes_with_iface (nm_device_get_iface (dev));
108 + * nm_system_device_flush_routes_with_iface
110 + * Flush all routes associated with a network device
113 +void nm_system_device_flush_routes_with_iface (const char *iface)
117 + g_return_if_fail (iface != NULL);
119 + /* Remove routing table entries */
120 + buf = g_strdup_printf ("/sbin/ip route flush dev %s", iface);
121 + nm_spawn_process (buf);
126 + * nm_system_device_flush_addresses
128 + * Flush all network addresses associated with a network device
131 +void nm_system_device_flush_addresses (NMDevice *dev)
135 + g_return_if_fail (dev != NULL);
137 + /* Not really applicable for test devices */
138 + if (nm_device_is_test_device (dev))
140 + nm_system_device_flush_addresses_with_iface (nm_device_get_iface (dev));
144 + * nm_system_device_flush_addresses_with_iface
146 + * Flush all network addresses associated with a network device
149 +void nm_system_device_flush_addresses_with_iface (const char *iface)
153 + g_return_if_fail (iface != NULL);
155 + /* Remove all IP addresses for a device */
156 + buf = g_strdup_printf ("/sbin/ip addr flush dev %s", iface);
157 + nm_spawn_process (buf);
162 + * nm_system_device_setup_static_ip4_config
164 + * Set up the device with a particular IPv4 address/netmask/gateway.
166 + * Returns: TRUE on success
170 +gboolean nm_system_device_setup_static_ip4_config (NMDevice *dev)
172 + syslog (LOG_WARNING, "nm_system_device_setup_static_ip4_config() is not implemented yet for this distribution.\n");
176 + * nm_system_device_get_system_config
178 + * Retrieve any relevant configuration info for a particular device
179 + * from the system network configuration information. Clear out existing
180 + * info before setting stuff too.
183 +void *nm_system_device_get_system_config (NMDevice *dev, struct NMData *data)
189 + * nm_system_device_has_active_routes
191 + * Find out whether the specified device has any routes in the routing
195 +gboolean nm_system_device_has_active_routes (NMDevice *dev)
201 + * nm_system_enable_loopback
203 + * Bring up the loopback interface
206 +void nm_system_enable_loopback (void)
208 + nm_spawn_process ("/sbin/ip link set dev lo up");
209 + nm_spawn_process ("/sbin/ip addr add 127.0.0.1/8 brd 127.255.255.255 dev lo label loopback");
213 + * nm_system_delete_default_route
215 + * Remove the old default route in preparation for a new one
218 +void nm_system_delete_default_route (void)
220 + nm_spawn_process ("/sbin/ip route del default");
224 + * nm_system_kill_all_dhcp_daemons
226 + * Kill all DHCP daemons currently running, done at startup.
229 +void nm_system_kill_all_dhcp_daemons (void)
231 + nm_spawn_process ("/bin/killall -q dhcpcd");
235 + * nm_system_update_dns
237 + * Make glibc/nscd aware of any changes to the resolv.conf file by
241 +void nm_system_update_dns (void)
243 + /* I'm not running nscd */
247 + * nm_system_restart_mdns_responder
249 + * Restart the multicast DNS responder so that it knows about new
250 + * network interfaces and IP addresses.
253 +void nm_system_restart_mdns_responder (void)
255 + /* not implemented */
259 + * nm_system_device_add_ip6_link_address
261 + * Add a default link-local IPv6 address to a device.
264 +void nm_system_device_add_ip6_link_address (NMDevice *dev)
267 + struct ether_addr hw_addr;
268 + unsigned char eui[8];
270 + nm_device_get_hw_address (dev, &hw_addr);
271 + memcpy (eui, &(hw_addr.ether_addr_octet), sizeof (hw_addr.ether_addr_octet));
272 + memmove (eui+5, eui+3, 3);
277 + /* Add the default link-local IPv6 address to a device */
278 + buf = g_strdup_printf ("/sbin/ip -6 addr add fe80::%x%02x:%x%02x:%x%02x:%x%02x/64 dev %s",
279 + eui[0], eui[1], eui[2], eui[3], eui[4], eui[5],
280 + eui[6], eui[7], nm_device_get_iface (dev));
281 + nm_spawn_process (buf);
286 + * nm_system_device_add_route_via_device_with_iface
288 + * Add route to the given device
291 +void nm_system_device_add_route_via_device_with_iface (const char *iface, const char *route)
295 + g_return_if_fail (iface != NULL);
297 + /* Add default gateway */
298 + buf = g_strdup_printf ("/sbin/ip route add %s dev %s", route, iface);
299 + nm_spawn_process (buf);
304 + * nm_system_device_add_default_route_via_device
306 + * Flush all routes associated with a network device
309 +void nm_system_device_add_default_route_via_device (NMDevice *dev)
311 + g_return_if_fail (dev != NULL);
313 + /* Not really applicable for test devices */
314 + if (nm_device_is_test_device (dev))
317 + nm_system_device_add_default_route_via_device_with_iface (nm_device_get_iface (dev));
321 + * * nm_system_device_add_default_route_via_device_with_iface
323 + * * Add default route to the given device
326 +void nm_system_device_add_default_route_via_device_with_iface (const char *iface)
330 + g_return_if_fail (iface != NULL);
332 + /* Add default gateway */
333 + buf = g_strdup_printf ("/sbin/ip route add default dev %s", iface);
334 + nm_spawn_process (buf);
339 + * nm_system_flush_loopback_routes
341 + * Flush all routes associated with the loopback device, because it
342 + * sometimes gets the first route for ZeroConf/Link-Local traffic.
345 +void nm_system_flush_loopback_routes (void)
347 + /* Remove routing table entries for lo */
348 + nm_spawn_process ("/sbin/ip route flush dev lo");
352 + * nm_system_flush_arp_cache
354 + * Flush all entries in the arp cache.
357 +void nm_system_flush_arp_cache (void)
359 + nm_spawn_process ("/sbin/ip neigh flush all");
362 +void nm_system_deactivate_all_dialup (GSList *list)
366 +gboolean nm_system_deactivate_dialup (GSList *list, const char *dialup)
371 +gboolean nm_system_activate_dialup (GSList *list, const char *dialup)
377 + * nm_system_get_dialup_config
379 + * Enumerate dial up options on this system, allocate NMDialUpConfig's,
380 + * fill them out, and return.
383 +GSList * nm_system_get_dialup_config (void)
388 +void nm_system_device_free_system_config (NMDevice *dev, void *system_config_data)
392 +NMIP4Config *nm_system_device_new_ip4_system_config (NMDevice *dev)
397 +gboolean nm_system_device_get_use_dhcp (NMDevice *dev)
403 + * nm_system_device_get_disabled
405 + * Return whether the distro-specific system config tells us to use
406 + * dhcp for this device.
409 +gboolean nm_system_device_get_disabled (NMDevice *dev)
415 + * nm_system_activate_nis
417 + * set up the nis domain and write a yp.conf
420 +void nm_system_activate_nis (NMIP4Config *config)
425 + * nm_system_shutdown_nis
430 +void nm_system_shutdown_nis (void)
435 + * nm_system_set_hostname
440 +void nm_system_set_hostname (NMIP4Config *config)
445 + * nm_system_should_modify_resolv_conf
447 + * Can NM update resolv.conf, or is it locked down?
449 +gboolean nm_system_should_modify_resolv_conf (void)
456 + * nm_system_get_mtu
458 + * Return a user-provided or system-mandated MTU for this device or zero if
459 + * no such MTU is provided.
461 +unsigned int nm_system_get_mtu (NMDevice *dev)