mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-23 19:24:38 +00:00
2004-06-24 Dan Williams <dcbw@redhat.com>
* Makefile.am Makefile.in configure.in dispatcher-daemon/Makefile.am dispatcher-daemon/Makefile.in dispatcher-daemon/NetworkManagerDispatcher.c Add a daemon that receives signals from NetworkManager and will (eventually) call scripts in /etc/somewhere when devices go up or down. * NetworkManager.c NetworkManagerDbus.c Spacing cleanups. * NetworkManagerPolicy.c - Rename nm_policy_switch_interface->nm_policy_switch_device - nm_policy_switch_device(): Use kill (pid) instead of system ("kill <pid>") - nm_state_modification_monitor(): Add wireless essid to output of debug statements Correct typo in device compare to switch or not (should be !=) Don't sleep after sending "no longer active" signal, was useless git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@9 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
d7df622d00
commit
873738b61b
28
ChangeLog
28
ChangeLog
|
@ -1,3 +1,31 @@
|
|||
2004-06-24 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* Makefile.am
|
||||
Makefile.in
|
||||
configure.in
|
||||
dispatcher-daemon/Makefile.am
|
||||
dispatcher-daemon/Makefile.in
|
||||
dispatcher-daemon/NetworkManagerDispatcher.c
|
||||
|
||||
Add a daemon that receives signals from NetworkManager
|
||||
and will (eventually) call scripts in /etc/somewhere
|
||||
when devices go up or down.
|
||||
|
||||
* NetworkManager.c
|
||||
NetworkManagerDbus.c
|
||||
|
||||
Spacing cleanups.
|
||||
|
||||
* NetworkManagerPolicy.c
|
||||
|
||||
- Rename nm_policy_switch_interface->nm_policy_switch_device
|
||||
- nm_policy_switch_device():
|
||||
Use kill (pid) instead of system ("kill <pid>")
|
||||
- nm_state_modification_monitor():
|
||||
Add wireless essid to output of debug statements
|
||||
Correct typo in device compare to switch or not (should be !=)
|
||||
Don't sleep after sending "no longer active" signal, was useless
|
||||
|
||||
2004-06-24 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* Initial import
|
||||
|
|
|
@ -1 +1 @@
|
|||
SUBDIRS = src initscript test
|
||||
SUBDIRS = src dispatcher-daemon initscript test
|
||||
|
|
|
@ -107,7 +107,7 @@ sbindir = @sbindir@
|
|||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
SUBDIRS = src initscript test
|
||||
SUBDIRS = src dispatcher-daemon initscript test
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
|
|
5
configure
vendored
5
configure
vendored
|
@ -3616,7 +3616,7 @@ echo "$as_me: error: Library requirements (dbus-glib-1 >= 0.20 hal >= 0.2.91 gth
|
|||
|
||||
|
||||
|
||||
ac_config_files="$ac_config_files Makefile test/Makefile src/Makefile initscript/Makefile"
|
||||
ac_config_files="$ac_config_files Makefile src/Makefile dispatcher-daemon/Makefile test/Makefile initscript/Makefile"
|
||||
cat >confcache <<\_ACEOF
|
||||
# This file is a shell script that caches the results of configure
|
||||
# tests run on this system so they can be shared between configure
|
||||
|
@ -4193,8 +4193,9 @@ do
|
|||
case "$ac_config_target" in
|
||||
# Handling of arguments.
|
||||
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
|
||||
"test/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
|
||||
"src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
|
||||
"dispatcher-daemon/Makefile" ) CONFIG_FILES="$CONFIG_FILES dispatcher-daemon/Makefile" ;;
|
||||
"test/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
|
||||
"initscript/Makefile" ) CONFIG_FILES="$CONFIG_FILES initscript/Makefile" ;;
|
||||
"depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
|
||||
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
|
||||
|
|
|
@ -17,7 +17,8 @@ AC_SUBST(NM_LIBS)
|
|||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
test/Makefile
|
||||
src/Makefile
|
||||
dispatcher-daemon/Makefile
|
||||
test/Makefile
|
||||
initscript/Makefile
|
||||
])
|
||||
|
|
12
dispatcher-daemon/Makefile.am
Normal file
12
dispatcher-daemon/Makefile.am
Normal file
|
@ -0,0 +1,12 @@
|
|||
INCLUDES = \
|
||||
$(NM_CFLAGS) \
|
||||
-DDBUS_API_SUBJECT_TO_CHANGE \
|
||||
-DBINDIR=\"$(bindir)\" \
|
||||
-DDATADIR=\"$(datadir)\"
|
||||
|
||||
bin_PROGRAMS = NetworkManagerDispatcher
|
||||
|
||||
NetworkManagerDispatcher_SOURCES = NetworkManagerDispatcher.c
|
||||
|
||||
NetworkManagerDispatcher_LDADD = $(NM_LIBS)
|
||||
|
390
dispatcher-daemon/Makefile.in
Normal file
390
dispatcher-daemon/Makefile.in
Normal file
|
@ -0,0 +1,390 @@
|
|||
# Makefile.in generated by automake 1.7.9 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
IWLIB = @IWLIB@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
NM_CFLAGS = @NM_CFLAGS@
|
||||
NM_LIBS = @NM_LIBS@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
bindir = @bindir@
|
||||
build_alias = @build_alias@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host_alias = @host_alias@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
INCLUDES = \
|
||||
$(NM_CFLAGS) \
|
||||
-DDBUS_API_SUBJECT_TO_CHANGE \
|
||||
-DBINDIR=\"$(bindir)\" \
|
||||
-DDATADIR=\"$(datadir)\"
|
||||
|
||||
|
||||
bin_PROGRAMS = NetworkManagerDispatcher
|
||||
|
||||
NetworkManagerDispatcher_SOURCES = NetworkManagerDispatcher.c
|
||||
|
||||
NetworkManagerDispatcher_LDADD = $(NM_LIBS)
|
||||
subdir = dispatcher-daemon
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_CLEAN_FILES =
|
||||
bin_PROGRAMS = NetworkManagerDispatcher$(EXEEXT)
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
|
||||
am_NetworkManagerDispatcher_OBJECTS = NetworkManagerDispatcher.$(OBJEXT)
|
||||
NetworkManagerDispatcher_OBJECTS = \
|
||||
$(am_NetworkManagerDispatcher_OBJECTS)
|
||||
NetworkManagerDispatcher_DEPENDENCIES =
|
||||
NetworkManagerDispatcher_LDFLAGS =
|
||||
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/NetworkManagerDispatcher.Po
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
DIST_SOURCES = $(NetworkManagerDispatcher_SOURCES)
|
||||
DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
|
||||
SOURCES = $(NetworkManagerDispatcher_SOURCES)
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .obj
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu dispatcher-daemon/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
|
||||
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
if test -f $$p \
|
||||
; then \
|
||||
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
|
||||
rm -f $(DESTDIR)$(bindir)/$$f; \
|
||||
done
|
||||
|
||||
clean-binPROGRAMS:
|
||||
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
|
||||
NetworkManagerDispatcher$(EXEEXT): $(NetworkManagerDispatcher_OBJECTS) $(NetworkManagerDispatcher_DEPENDENCIES)
|
||||
@rm -f NetworkManagerDispatcher$(EXEEXT)
|
||||
$(LINK) $(NetworkManagerDispatcher_LDFLAGS) $(NetworkManagerDispatcher_OBJECTS) $(NetworkManagerDispatcher_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT) core *.core
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManagerDispatcher.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
|
||||
uninstall-info-am:
|
||||
|
||||
ETAGS = etags
|
||||
ETAGSFLAGS =
|
||||
|
||||
CTAGS = ctags
|
||||
CTAGSFLAGS =
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|
||||
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
top_distdir = ..
|
||||
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkinstalldirs) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(PROGRAMS)
|
||||
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am: install-binPROGRAMS
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-binPROGRAMS uninstall-info-am
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
|
||||
clean-generic ctags distclean distclean-compile \
|
||||
distclean-generic distclean-tags distdir dvi dvi-am info \
|
||||
info-am install install-am install-binPROGRAMS install-data \
|
||||
install-data-am install-exec install-exec-am install-info \
|
||||
install-info-am install-man install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am uninstall-binPROGRAMS uninstall-info-am
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
226
dispatcher-daemon/NetworkManagerDispatcher.c
Normal file
226
dispatcher-daemon/NetworkManagerDispatcher.c
Normal file
|
@ -0,0 +1,226 @@
|
|||
/* NetworkManagerDispatcher -- Dispatches messages from NetworkManager
|
||||
*
|
||||
* Dan Williams <dcbw@redhat.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* (C) Copyright 2004 Red Hat, Inc.
|
||||
*/
|
||||
|
||||
#include <glib.h>
|
||||
#include <dbus/dbus-glib.h>
|
||||
#include <getopt.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
||||
/* Globals */
|
||||
DBusConnection *connection = NULL;
|
||||
|
||||
|
||||
static DBusHandlerResult nmd_dbus_filter (DBusConnection *connection, DBusMessage *message, void *user_data)
|
||||
{
|
||||
const char *object_path;
|
||||
DBusError error;
|
||||
char *dev_object_path = NULL;
|
||||
gboolean handled = FALSE;
|
||||
|
||||
dbus_error_init (&error);
|
||||
object_path = dbus_message_get_path (message);
|
||||
|
||||
fprintf (stderr, "*** in filter_func, object_path=%s\n", object_path);
|
||||
|
||||
if (dbus_message_is_signal (message, "org.freedesktop.NetworkManager", "DeviceNoLongerActive"))
|
||||
{
|
||||
if (dbus_message_get_args (message, &error, DBUS_TYPE_STRING, &dev_object_path, DBUS_TYPE_INVALID))
|
||||
{
|
||||
fprintf (stderr, "Device %s no longer active\n", dev_object_path);
|
||||
handled = TRUE;
|
||||
dbus_free (dev_object_path);
|
||||
}
|
||||
}
|
||||
else if (dbus_message_is_signal (message, "org.freedesktop.NetworkManager", "DeviceNowActive"))
|
||||
{
|
||||
if (dbus_message_get_args (message, &error, DBUS_TYPE_STRING, &dev_object_path, DBUS_TYPE_INVALID))
|
||||
{
|
||||
fprintf (stderr, "Device %s now active\n", dev_object_path);
|
||||
handled = TRUE;
|
||||
dbus_free (dev_object_path);
|
||||
}
|
||||
}
|
||||
|
||||
return (handled ? DBUS_HANDLER_RESULT_HANDLED : DBUS_HANDLER_RESULT_NOT_YET_HANDLED);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* nmd_dbus_init
|
||||
*
|
||||
* Initialize a connection to NetworkManager
|
||||
*/
|
||||
static DBusConnection *nmd_dbus_init (void)
|
||||
{
|
||||
DBusConnection *connection = NULL;
|
||||
DBusError error;
|
||||
|
||||
/* connect to hald service on the system bus */
|
||||
dbus_error_init (&error);
|
||||
connection = dbus_bus_get (DBUS_BUS_SYSTEM, &error);
|
||||
if (connection == NULL)
|
||||
{
|
||||
fprintf (stderr, "nmd_dbus_init(): could not connect to the message bus. dbus says: '%s'\n", error.message);
|
||||
dbus_error_free (&error);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
dbus_connection_setup_with_g_main (connection, NULL);
|
||||
|
||||
if (!dbus_connection_add_filter (connection, nmd_dbus_filter, NULL, NULL))
|
||||
return (NULL);
|
||||
|
||||
dbus_bus_add_match (connection,
|
||||
"type='signal',"
|
||||
"interface='org.freedesktop.NetworkManager',"
|
||||
"sender='org.freedesktop.NetworkManager',"
|
||||
"path='/org/freedesktop/NetworkManager'", &error);
|
||||
if (dbus_error_is_set (&error))
|
||||
return (NULL);
|
||||
|
||||
return (connection);
|
||||
}
|
||||
|
||||
/*
|
||||
* nmd_print_usage
|
||||
*
|
||||
* Prints program usage.
|
||||
*
|
||||
*/
|
||||
static void nmd_print_usage (void)
|
||||
{
|
||||
fprintf (stderr, "\n" "usage : NetworkManagerDispatcher [--daemon=yes|no] [--help]\n");
|
||||
fprintf (stderr,
|
||||
"\n"
|
||||
" --daemon=yes|no Become a daemon\n"
|
||||
" --help Show this information and exit\n"
|
||||
"\n"
|
||||
"NetworkManagerDispatcher listens for device messages from NetworkManager\n"
|
||||
"and runs scripts in /etc/networkmanager.\n"
|
||||
"\n");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* main
|
||||
*
|
||||
*/
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
gboolean become_daemon = TRUE;
|
||||
GMainLoop *loop = NULL;
|
||||
|
||||
/* Parse options */
|
||||
while (1)
|
||||
{
|
||||
int c;
|
||||
int option_index = 0;
|
||||
const char *opt;
|
||||
|
||||
static struct option options[] = {
|
||||
{"daemon", 1, NULL, 0},
|
||||
{"help", 0, NULL, 0},
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
||||
c = getopt_long (argc, argv, "", options, &option_index);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case 0:
|
||||
opt = options[option_index].name;
|
||||
if (strcmp (opt, "help") == 0)
|
||||
{
|
||||
nmd_print_usage ();
|
||||
return 0;
|
||||
}
|
||||
else if (strcmp (opt, "daemon") == 0)
|
||||
{
|
||||
if (strcmp ("yes", optarg) == 0)
|
||||
become_daemon = TRUE;
|
||||
else if (strcmp ("no", optarg) == 0)
|
||||
become_daemon = FALSE;
|
||||
else
|
||||
{
|
||||
nmd_print_usage ();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
nmd_print_usage ();
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (become_daemon)
|
||||
{
|
||||
int child_pid;
|
||||
int dev_null_fd;
|
||||
|
||||
if (chdir ("/") < 0)
|
||||
{
|
||||
fprintf( stderr, "NetworkManagerDispatcher could not chdir to /. errno=%d", errno);
|
||||
return 1;
|
||||
}
|
||||
|
||||
child_pid = fork ();
|
||||
switch (child_pid)
|
||||
{
|
||||
case -1:
|
||||
fprintf( stderr, "NetworkManagerDispatcher could not daemonize. errno = %d\n", errno );
|
||||
break;
|
||||
|
||||
case 0:
|
||||
/* Child */
|
||||
break;
|
||||
|
||||
default:
|
||||
exit (0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
g_type_init ();
|
||||
if (!g_thread_supported ())
|
||||
g_thread_init (NULL);
|
||||
|
||||
/* Create our dbus service */
|
||||
connection = nmd_dbus_init ();
|
||||
if (connection)
|
||||
{
|
||||
/* Run the main loop, all events processed by callbacks from libhal. */
|
||||
loop = g_main_loop_new (NULL, FALSE);
|
||||
g_main_loop_run (loop);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -46,7 +46,6 @@ gboolean debug = TRUE;
|
|||
static gboolean quit = FALSE;
|
||||
|
||||
|
||||
|
||||
static void nm_data_free (NMData *data);
|
||||
|
||||
|
||||
|
|
|
@ -567,25 +567,19 @@ static DBusHandlerResult nm_dbus_nm_message_handler (DBusConnection *connection,
|
|||
method = dbus_message_get_member (message);
|
||||
path = dbus_message_get_path (message);
|
||||
|
||||
NM_DEBUG_PRINT_2 ("nm_dbus_devices_message_handler() got method %s for path %s\n", method, path);
|
||||
/* NM_DEBUG_PRINT_2 ("nm_dbus_nm_message_handler() got method %s for path %s\n", method, path); */
|
||||
|
||||
if (strcmp ("getActiveDevice", method) == 0)
|
||||
{
|
||||
reply_message = nm_dbus_nm_get_active_device (connection, message);
|
||||
}
|
||||
else if (strcmp ("getDevices", method) == 0)
|
||||
{
|
||||
reply_message = nm_dbus_nm_get_devices (connection, message);
|
||||
}
|
||||
else
|
||||
{
|
||||
reply_message = nm_dbus_create_error_message (message, NM_DBUS_NM_NAMESPACE, "UnknownMethod",
|
||||
"NetworkManager knows nothing about the method %s for object %s", method, path);
|
||||
}
|
||||
|
||||
dbus_connection_send (connection, reply_message, NULL);
|
||||
|
||||
return DBUS_HANDLER_RESULT_HANDLED;
|
||||
return (DBUS_HANDLER_RESULT_HANDLED);
|
||||
}
|
||||
|
||||
|
||||
|
@ -616,12 +610,12 @@ static DBusHandlerResult nm_dbus_devices_message_handler (DBusConnection *connec
|
|||
method = dbus_message_get_member (message);
|
||||
path = dbus_message_get_path (message);
|
||||
|
||||
/* NM_DEBUG_PRINT_2 ("nm_dbus_nm_message_handler() got method %s for path %s\n", method, path); */
|
||||
/* NM_DEBUG_PRINT_2 ("nm_dbus_devices_message_handler() got method %s for path %s\n", method, path); */
|
||||
|
||||
reply_message = nm_dbus_devices_handle_request (connection, message, path, method);
|
||||
dbus_connection_send (connection, reply_message, NULL);
|
||||
|
||||
return DBUS_HANDLER_RESULT_HANDLED;
|
||||
return (DBUS_HANDLER_RESULT_HANDLED);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <signal.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "NetworkManagerPolicy.h"
|
||||
|
@ -34,12 +35,12 @@ extern gboolean debug;
|
|||
|
||||
|
||||
/*
|
||||
* nm_policy_activate_interface
|
||||
* nm_policy_activate_device
|
||||
*
|
||||
* Performs interface switching and related networking goo.
|
||||
*
|
||||
*/
|
||||
static void nm_policy_switch_interface (NMData *data, NMDevice *switch_to_dev, NMDevice *old_dev)
|
||||
static void nm_policy_switch_device (NMData *data, NMDevice *switch_to_dev, NMDevice *old_dev)
|
||||
{
|
||||
unsigned char buf[500];
|
||||
unsigned char hostname[500] = "\0";
|
||||
|
@ -47,7 +48,6 @@ static void nm_policy_switch_interface (NMData *data, NMDevice *switch_to_dev, N
|
|||
int host_err;
|
||||
int dhclient_err;
|
||||
FILE *pidfile;
|
||||
unsigned char pid[20];
|
||||
|
||||
g_return_if_fail (data != NULL);
|
||||
g_return_if_fail (switch_to_dev != NULL);
|
||||
|
@ -115,18 +115,18 @@ static void nm_policy_switch_interface (NMData *data, NMDevice *switch_to_dev, N
|
|||
pidfile = fopen (buf, "r");
|
||||
if (pidfile)
|
||||
{
|
||||
int len;
|
||||
int len;
|
||||
unsigned char s_pid[20];
|
||||
pid_t n_pid = -1;
|
||||
|
||||
fgets (pid, 20, pidfile);
|
||||
len = strnlen (buf, 20);
|
||||
if (len >= 20)
|
||||
pid[0] = '\0';
|
||||
else
|
||||
pid[len-1] = '\0';
|
||||
memset (s_pid, 0, 20);
|
||||
fgets (s_pid, 19, pidfile);
|
||||
len = strnlen (s_pid, 20);
|
||||
fclose (pidfile);
|
||||
|
||||
snprintf (buf, 500, "kill -9 %s", pid);
|
||||
system (buf);
|
||||
n_pid = atoi (s_pid);
|
||||
if (n_pid > 0)
|
||||
kill (n_pid, 9);
|
||||
}
|
||||
|
||||
snprintf (buf, 500, "/sbin/dhclient -1 -q -lf /var/lib/dhcp/dhclient-%s.leases -pf /var/run/dhclient-%s.pid -cf /etc/dhclient-%s.conf %s\n",
|
||||
|
@ -255,7 +255,8 @@ gboolean nm_state_modification_monitor (gpointer user_data)
|
|||
}
|
||||
|
||||
NM_DEBUG_PRINT_1 ("Best wired device = %s\n", best_wired_dev ? nm_device_get_iface (best_wired_dev) : "(null)");
|
||||
NM_DEBUG_PRINT_1 ("Best wireless device = %s\n", best_wireless_dev ? nm_device_get_iface (best_wireless_dev) : "(null)");
|
||||
NM_DEBUG_PRINT_2 ("Best wireless device = %s (%s)\n", best_wireless_dev ? nm_device_get_iface (best_wireless_dev) : "(null)",
|
||||
best_wireless_dev ? nm_device_get_essid (best_wireless_dev) : "null" );
|
||||
|
||||
if (best_wireless_dev || best_wired_dev)
|
||||
{
|
||||
|
@ -290,27 +291,27 @@ gboolean nm_state_modification_monitor (gpointer user_data)
|
|||
|
||||
/* If the highest priority device is different than data->active_device, switch the connection. */
|
||||
if ( essid_change_needed
|
||||
|| (!data->active_device || (highest_priority_dev == data->active_device)))
|
||||
|| (!data->active_device || (highest_priority_dev != data->active_device)))
|
||||
{
|
||||
|
||||
NM_DEBUG_PRINT_2 ("**** Switching active interface from '%s' to '%s'\n",
|
||||
data->active_device ? nm_device_get_iface (data->active_device) : "(null)",
|
||||
nm_device_get_iface (highest_priority_dev));
|
||||
|
||||
/* FIXME
|
||||
* How long should we wait between the signal to the bus,
|
||||
* and deactivating the device?
|
||||
* We should probably wait a bit before forcibly changing connections
|
||||
* after we send the signal. However, dbus delivers its messages in the
|
||||
* glib main loop. If we call g_main_context_iteration(), we can deadlock
|
||||
* but if we split this function into two steps and execute the second half,
|
||||
* after a main loop iteration, we make a much more complicated state machine.
|
||||
*/
|
||||
if (data->active_device)
|
||||
{
|
||||
nm_dbus_signal_device_no_longer_active (data->dbus_connection, data->active_device);
|
||||
sleep (2);
|
||||
}
|
||||
|
||||
nm_policy_switch_interface (data, highest_priority_dev, data->active_device);
|
||||
nm_policy_switch_device (data, highest_priority_dev, data->active_device);
|
||||
|
||||
if (data->active_device)
|
||||
nm_device_unref (data->active_device);
|
||||
|
||||
data->active_device = highest_priority_dev;
|
||||
nm_device_ref (data->active_device);
|
||||
|
||||
|
@ -405,7 +406,7 @@ void nm_policy_update_allowed_access_points (NMData *data)
|
|||
if (strlen (essid) > 0)
|
||||
{
|
||||
NMAccessPoint *ap;
|
||||
guint prio_num = atoi (prio);
|
||||
guint prio_num = atoi (prio);
|
||||
|
||||
if (prio_num < 1)
|
||||
prio_num = NM_AP_PRIORITY_WORST;
|
||||
|
|
Loading…
Reference in a new issue