Don't link plugins against libwireshark: any program that loads the dissector
authorJeff Morriss <jeff.morriss@ulticom.com>
Sun, 16 Mar 2008 00:58:15 +0000 (00:58 -0000)
committerJeff Morriss <jeff.morriss@ulticom.com>
Sun, 16 Mar 2008 00:58:15 +0000 (00:58 -0000)
plugins should already be linked against libwireshark.

Don't link capinfos and editcap against libwireshark: they only needed to be
because the plugins were linked against libwireshark (see rev 24123 and the
ensuing discussion on -dev).

capinfos and editcap: don't complain if plugins fail to load: dissector
plugins should fail to load because they need libwireshark.  I am assuming
here that wiretap plugins don't need libwireshark (I've never seen such a
plugin but LEGO's code and comments suggest this is the case).

(The goal of this checkin is to stop linking capinfos and editcap against
libwireshark while still allowing wiretap plugins.  Since we don't have any
such plugins in the tree I do somewhat doubt the need for all this but I don't
want to be the one to remove the functionality.)

svn path=/trunk/; revision=24650

Makefile.am
capinfos.c
configure.in
editcap.c

index a2aae2902a52af7e7d642adc6e4e7f3783ad7076..e3bab7f4081fc7c0f4df03797bdd08cc592dc05b 100644 (file)
@@ -384,34 +384,12 @@ mergecap_LDADD = \
 # Libraries with which to link capinfos.
 capinfos_LDADD = \
        wiretap/libwiretap.la           \
-       epan/libwireshark.la            \
-       @INET_PTON_LO@                  \
-       @SSL_LIBS@                      \
-       $(plugin_ldadd)                 \
-       @PCRE_LIBS@                     \
-       @GLIB_LIBS@ -lm                 \
-       @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@ @ADNS_LIBS@ @KRB5_LIBS@    \
-       @FRAMEWORKS@                    \
-       @LIBICONV@                      \
-       @LIBGCRYPT_LIBS@                \
-       @LIBGNUTLS_LIBS@                \
-       @LIBSMI_LDFLAGS@
+       @GLIB_LIBS@
 
 # Libraries with which to link editcap.
 editcap_LDADD = \
        wiretap/libwiretap.la           \
-       epan/libwireshark.la            \
-       @INET_PTON_LO@                  \
-       @SSL_LIBS@                      \
-       $(plugin_ldadd)                 \
-       @PCRE_LIBS@                     \
-       @GLIB_LIBS@ -lm                 \
-       @PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@ @ADNS_LIBS@ @KRB5_LIBS@    \
-       @FRAMEWORKS@                    \
-       @LIBICONV@                      \
-       @LIBGCRYPT_LIBS@                \
-       @LIBGNUTLS_LIBS@                \
-       @LIBSMI_LDFLAGS@
+       @GLIB_LIBS@
 
 # Libraries with which to link randpkt.
 randpkt_LDADD = \
index e94a3bb18c9fdee84e5ec5d8b524df0106c0cffb..d9be5194d129444eacbc19fb01ece3152f065e24 100644 (file)
@@ -262,14 +262,14 @@ usage(gboolean is_error)
 }
 
 /*
- * Errors are reported with a console message.
+ *  Don't report failures to load plugins because most (non-wiretap) plugins
+ *  *should* fail to load (because we're not linked against libwireshark and
+ *  dissector plugins need libwireshark).
  */
 static void
-failure_message(const char *msg_format, va_list ap)
+failure_message(const char *msg_format _U_, va_list ap _U_)
 {
-       fprintf(stderr, "capinfos: ");
-       vfprintf(stderr, msg_format, ap);
-       fprintf(stderr, "\n");
+       return;
 }
 
 
index 3b5c19ac0db4f58b426203753891530db4c88993..4fa55e36e41dc4ccb7be186e806dabec8ec938ee 100644 (file)
@@ -1567,7 +1567,7 @@ CPPFLAGS="$CPPFLAGS '-DPLUGIN_DIR=\"\$(plugindir)\"'"
 #
 # The plugin dissectors reside in ./plugins/PROTO/
 #
-PLUGIN_LIBS="-L../../epan -lwireshark"
+PLUGIN_LIBS=""
 AC_SUBST(PLUGIN_LIBS)
 
 dnl libtool defs
index 006477947bf62716b9e3b04f951e315b347bb3df..12732423c3d8461cebc067921aeb9f02212d80ac 100644 (file)
--- a/editcap.c
+++ b/editcap.c
@@ -370,12 +370,15 @@ list_encap_types(void) {
     }
 }
 
+/*
+ *  Don't report failures to load plugins because most (non-wiretap) plugins
+ *  *should* fail to load (because we're not linked against libwireshark and
+ *  dissector plugins need libwireshark).
+ */
 static void
-failure_message(const char *msg_format, va_list ap)
+failure_message(const char *msg_format _U_, va_list ap _U_)
 {
-       fprintf(stderr, "editcap: ");
-       vfprintf(stderr, msg_format, ap);
-       fprintf(stderr, "\n");
+       return;
 }
 
 int